summaryrefslogtreecommitdiff
path: root/tests/test_misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-11 15:22:18 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-11 16:15:40 -0400
commit260359756694728cd13f8c8715dddf7c6e2f371d (patch)
tree4ed1f110286dd34c53b9d1169d1d94c83bc89ac3 /tests/test_misc.py
parentfdaa8224ccfa16233fda0c84860ef95ca073ee95 (diff)
downloadpython-coveragepy-git-260359756694728cd13f8c8715dddf7c6e2f371d.tar.gz
fix: source modules need to be re-imported. #1232
Diffstat (limited to 'tests/test_misc.py')
-rw-r--r--tests/test_misc.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 077c2434..74002232 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -165,8 +165,15 @@ class ImportThirdPartyTest(CoverageTest):
run_in_temp_dir = False
def test_success(self):
+ # Make sure we don't have pytest in sys.modules before we start.
+ del sys.modules["pytest"]
+ # Import pytest
mod = import_third_party("pytest")
+ # Yes, it's really pytest:
assert mod.__name__ == "pytest"
+ print(dir(mod))
+ assert all(hasattr(mod, name) for name in ["skip", "mark", "raises", "warns"])
+ # But it's not in sys.modules:
assert "pytest" not in sys.modules
def test_failure(self):