From f1bdb959342772937b2d4de139b929bb0f5855a0 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 1 Nov 2016 10:16:39 -0400 Subject: Optionally use pytest as the test runner --- tests/test_oddball.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/test_oddball.py') diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 87c65b0e..7fc122af 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -353,7 +353,8 @@ class DoctestTest(CoverageTest): # of coverage will get. Deleting the imported module here is # enough: when the test imports doctest again, it will get a fresh # copy without the monkeypatch. - del sys.modules['doctest'] + if 'doctest' in sys.modules: + del sys.modules['doctest'] def test_doctest(self): self.check_coverage('''\ -- cgit v1.2.1