From 1e77cb323578ff5d5e929e8541726c1e449e2aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 3 Dec 2023 12:26:17 +0100 Subject: [PATCH] make tests a module --- tests/__init__.py | 0 tests/conftest.py | 13 ++++--------- tests/sshd.py | 5 +++-- tests/test_cli.py | 3 ++- 4 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/conftest.py b/tests/conftest.py index ce1e92e..034ef38 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,11 +1,6 @@ -import os -import sys - -sys.path.append(os.path.dirname(__file__)) - pytest_plugins = [ - "root", - "command", - "ports", - "sshd", + "tests.root", + "tests.command", + "tests.ports", + "tests.sshd", ] diff --git a/tests/sshd.py b/tests/sshd.py index 4827aed..0a1db15 100644 --- a/tests/sshd.py +++ b/tests/sshd.py @@ -8,8 +8,9 @@ from sys import platform from tempfile import TemporaryDirectory import pytest -from command import Command -from ports import Ports + +from .command import Command +from .ports import Ports class Sshd: diff --git a/tests/test_cli.py b/tests/test_cli.py index 4bba778..8eb0d10 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3,10 +3,11 @@ import os import pwd import pytest -from sshd import Sshd from nix_fast_build import async_main +from .sshd import Sshd + def cli(args: list[str]) -> None: asyncio.run(async_main(args))