Question
How can I import helper functions in test files without creating packages in the test
directory?
Contex
my option is to create an extra dir in tests
dir and add it to pythonpath in the conftest so.
tests/
helpers/
utils.py
...
conftest.py
setup.cfg
in the conftest.py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
in setup.cfg
[pytest]
norecursedirs=tests/helpers
this module will be available with import utils
, only be careful to name clashing.