Skip to content

tests: fix imports

Benjamin Tissoires requested to merge bentiss/hid-tools:wip/fix-pytest into master

commit 28d0b730 ("doc: Generate docs for the test suite as well") introduced the file tests/__init__.py which turned the tests folder into a python module.

Problem is that the implicit relative imports do not work anymore, and pytest was failing with:

ImportError while loading conftest 'hid-tools/tests/conftest.py'.
tests/conftest.py:24: in <module>
    from base import create_udev_rule, teardown_udev_rule
E   ModuleNotFoundError: No module named 'base'

Fix the local imports by using relative imports

Signed-off-by: Benjamin Tissoires benjamin.tissoires@gmail.com

Merge request reports

Loading