Skip to content

Commit

Permalink
Test for importing all Python modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugobuddel committed Jan 17, 2024
1 parent 44f5926 commit 68d5c43
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scopesim/tests/test_import_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Test whether all Python files can be imported."""
import importlib.util
from pathlib import Path

import scopesim


def test_import_all():
"""Test whether all Python files can be imported.
This ensures that all files are included in the code coverage.
"""
path_scopesim = Path(scopesim.__file__).parent
paths_modules = path_scopesim.glob("**/*.py")
for pm in paths_modules:
spec = importlib.util.spec_from_file_location("module.name", pm)
_ = importlib.util.module_from_spec(spec)

0 comments on commit 68d5c43

Please sign in to comment.