summaryrefslogtreecommitdiff
path: root/test/farm/run/run_timid.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/farm/run/run_timid.py')
-rw-r--r--test/farm/run/run_timid.py27
1 files changed, 19 insertions, 8 deletions
diff --git a/test/farm/run/run_timid.py b/test/farm/run/run_timid.py
index f63ef63c..64be5817 100644
--- a/test/farm/run/run_timid.py
+++ b/test/farm/run/run_timid.py
@@ -2,21 +2,31 @@
# function for a simpler one.
#
# This is complicated by the fact that the tests are run twice for each
-# version: once with a compiled C-based trace function, and once without it, to
-# also test the Python trace function. So this test has to examine an
-# environment variable set in igor.py to know whether to expect to see the C
-# trace function or not.
+# version: once with a compiled C-based trace function, and once without
+# it, to also test the Python trace function. So this test has to examine
+# an environment variable set in igor.py to know whether to expect to see
+# the C trace function or not.
import os
+# When meta-coverage testing, this test doesn't work, because it finds
+# coverage.py's own trace function.
+if os.environ.get('COVERAGE_COVERAGE', ''):
+ skip("Can't test timid during coverage measurement.")
+
copy("src", "out")
run("""
+ python showtrace.py none
coverage -e -x showtrace.py regular
coverage -e -x --timid showtrace.py timid
""", rundir="out", outfile="showtraceout.txt")
+# When running without coverage, no trace function
# When running timidly, the trace function is always Python.
-contains("out/showtraceout.txt", "timid PyTracer")
+contains("out/showtraceout.txt",
+ "none None",
+ "timid PyTracer",
+ )
if os.environ.get('COVERAGE_TEST_TRACER', 'c') == 'c':
# If the C trace function is being tested, then regular running should have
@@ -37,9 +47,10 @@ run("""
""", rundir="out", outfile="showtraceout.txt")
contains("out/showtraceout.txt",
- "timid PyTracer",
- "regular PyTracer"
- )
+ "none None",
+ "timid PyTracer",
+ "regular PyTracer",
+ )
if old_opts:
os.environ['COVERAGE_OPTIONS'] = old_opts