+10
-10
lines changedFilter options
+10
-10
lines changed Original file line number Diff line number Diff line change
@@ -387,6 +387,11 @@ def tearDown(self):
387
387
def test_cover_files_written_no_highlight(self):
388
388
argv = '-m trace --count'.split() + [self.codefile]
389
389
status, stdout, stderr = assert_python_ok(*argv)
390
+
self.assertEqual(stderr, b'')
391
+
tracedir = os.path.dirname(os.path.abspath(trace.__file__))
392
+
tracecoverpath = os.path.join(tracedir, "trace.cover")
393
+
self.assertFalse(os.path.exists(tracecoverpath))
394
+
390
395
self.assertTrue(os.path.exists(self.coverfile))
391
396
with open(self.coverfile) as f:
392
397
self.assertEqual(f.read(),
Original file line number Diff line number Diff line change
@@ -63,14 +63,6 @@
63
63
64
64
import threading
65
65
66
-
def _settrace(func):
67
-
threading.settrace(func)
68
-
sys.settrace(func)
69
-
70
-
def _unsettrace():
71
-
sys.settrace(None)
72
-
threading.settrace(None)
73
-
74
66
PRAGMA_NOCOVER = "#pragma NO COVER"
75
67
76
68
class _Ignore:
@@ -451,12 +443,14 @@ def runctx(self, cmd, globals=None, locals=None):
451
443
if globals is None: globals = {}
452
444
if locals is None: locals = {}
453
445
if not self.donothing:
454
-
_settrace(self.globaltrace)
446
+
threading.settrace(self.globaltrace)
447
+
sys.settrace(self.globaltrace)
455
448
try:
456
449
exec(cmd, globals, locals)
457
450
finally:
458
451
if not self.donothing:
459
-
_unsettrace()
452
+
sys.settrace(None)
453
+
threading.settrace(None)
460
454
461
455
def runfunc(self, func, *args, **kw):
462
456
result = None
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
+
Running the :mod:`trace` module no longer creates the ``trace.cover`` file.
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4