-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor tests to use per-test imports
- Loading branch information
1 parent
e86c1dc
commit b9cdf53
Showing
8 changed files
with
49 additions
and
14 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,18 @@ | ||
import importlib | ||
import sys | ||
from collections.abc import Generator | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="function") | ||
def import_deps() -> Generator: | ||
_ = importlib.import_module("lsst.cmservice.handlers.interface") | ||
_ = importlib.import_module("lsst.cmservice.handlers.jobs") | ||
_ = importlib.import_module("lsst.cmservice.handlers.functions") | ||
_ = importlib.import_module("lsst.cmservice.handlers.script_handler") | ||
yield | ||
del sys.modules["lsst.cmservice.handlers.interface"] | ||
del sys.modules["lsst.cmservice.handlers.jobs"] | ||
del sys.modules["lsst.cmservice.handlers.functions"] | ||
del sys.modules["lsst.cmservice.handlers.script_handler"] |
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
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
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
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
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
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
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