summaryrefslogtreecommitdiff
path: root/tests/test_oddball.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_oddball.py')
-rw-r--r--tests/test_oddball.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index 52f80734..a97fc190 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -81,17 +81,18 @@ class RecursionTest(CoverageTest):
def test_long_recursion(self):
# We can't finish a very deep recursion, but we don't crash.
with pytest.raises(RuntimeError):
- self.check_coverage("""\
- def recur(n):
- if n == 0:
- return 0
- else:
- return recur(n-1)+1
-
- recur(100000) # This is definitely too many frames.
- """,
- [1, 2, 3, 5, 7], ""
- )
+ with pytest.warns(None):
+ self.check_coverage("""\
+ def recur(n):
+ if n == 0:
+ return 0
+ else:
+ return recur(n-1)+1
+
+ recur(100000) # This is definitely too many frames.
+ """,
+ [1, 2, 3, 5, 7], ""
+ )
def test_long_recursion_recovery(self):
# Test the core of bug 93: https://github.com/nedbat/coveragepy/issues/93
@@ -117,7 +118,8 @@ class RecursionTest(CoverageTest):
""")
cov = coverage.Coverage()
- self.start_import_stop(cov, "recur")
+ with pytest.warns(None):
+ self.start_import_stop(cov, "recur")
pytrace = (cov._collector.tracer_name() == "PyTracer")
expected_missing = [3]