Skip to content

Commit

Permalink
Merge pull request #16 from ArneBinder/fix_conftest
Browse files Browse the repository at this point in the history
fix importing all modules in conftest.py
  • Loading branch information
ArneBinder authored Nov 2, 2023
2 parents fd055f7 + 439d952 commit 0dbfb64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
# this is necessary because we calculate coverage by calling "pytest --cov"
for src_root in SRC_ROOTS:
for file in glob.glob(f"{src_root}/**/*.py", recursive=True):
import_path = file.replace(os.sep, ".").rstrip(".py")
# get the base file path without the extension
import_base_path = os.path.splitext(file)[0]
import_path = import_base_path.replace(os.sep, ".")
__import__(import_path)


Expand Down

0 comments on commit 0dbfb64

Please sign in to comment.