From 0a218c8d6d2c9835494e182a2f0d4f047279d324 Mon Sep 17 00:00:00 2001 From: "R. Richard" Date: Thu, 1 Aug 2019 15:12:58 +0200 Subject: [PATCH] Fix relative path problem --- tfw/internals/ref_counter/test_ref_counter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tfw/internals/ref_counter/test_ref_counter.py b/tfw/internals/ref_counter/test_ref_counter.py index 3b563b9..6d65997 100644 --- a/tfw/internals/ref_counter/test_ref_counter.py +++ b/tfw/internals/ref_counter/test_ref_counter.py @@ -1,8 +1,8 @@ # pylint: disable=redefined-outer-name from dataclasses import dataclass from textwrap import dedent -from os import mkfifo -from os.path import join +from os import chdir, mkfifo +from os.path import dirname, join, realpath from signal import SIGINT from subprocess import DEVNULL, Popen, PIPE from tempfile import TemporaryDirectory @@ -35,6 +35,7 @@ class CounterContext: @pytest.fixture def context(): with TemporaryDirectory() as workdir: + chdir(dirname(realpath(__file__))) pipepath = join(workdir, 'test.pipe') mkfifo(pipepath) yield CounterContext(join(workdir, 'test.lock'), pipepath)