diff --git a/packages/valory/connections/test_libp2p/tests/base.py b/packages/valory/connections/test_libp2p/tests/base.py index af71953bc6..5a22050877 100644 --- a/packages/valory/connections/test_libp2p/tests/base.py +++ b/packages/valory/connections/test_libp2p/tests/base.py @@ -279,7 +279,7 @@ def _make_libp2p_connection( class BaseP2PLibp2pTest: """Base class for ACN p2p libp2p tests""" - cwd: str + cwd: Path tmp: str tmp_dir: str tmp_client_dir: str @@ -295,7 +295,7 @@ class BaseP2PLibp2pTest: def setup_class(cls): """Set the test up""" atexit.register(cls.teardown_class) - cls.cwd, cls.tmp = os.getcwd(), TEMP_LIBP2P_TEST_DIR + cls.cwd, cls.tmp = Path.cwd(), TEMP_LIBP2P_TEST_DIR if Path(cls.tmp).exists(): cls.remove_temp_test_dir() Path(cls.tmp).mkdir(exist_ok=True) @@ -308,7 +308,7 @@ def teardown_class(cls): cls._disconnect() cls.multiplexers.clear() cls.log_files.clear() - if Path(cls.cwd).exists(): + if cls.cwd.exists(): # can be triggered second time by atexit os.chdir(cls.cwd) if Path(cls.tmp).exists(): @@ -451,7 +451,7 @@ class BaseP2PLibp2pAEATestCaseMany(AEATestCaseMany): log_files: List[str] = [] agent_ledger_id, node_ledger_id = DEFAULT_LEDGER, LIBP2P_LEDGER - conn_key_file = os.path.join(os.path.abspath(os.getcwd()), "./conn_key.txt") + conn_key_file = os.path.join(os.path.abspath(Path.cwd()), "./conn_key.txt") p2p_libp2p_path = f"vendor.{p2p_libp2p.__name__.split('.', 1)[-1]}" p2p_libp2p_client_path = f"vendor.{p2p_libp2p_client.__name__.split('.', 1)[-1]}" package_registry_src_rel: Path = Path(__file__).parent.parent.parent.parent.parent