-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for importing all Python modules.
- Loading branch information
1 parent
44f5926
commit 68d5c43
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |