STINNER Victor <vstin...@python.org> added the comment:

FYI I used the following patch to debug this issue:

diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index 872f121127..ee2e1ff77f 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -546,6 +546,8 @@ def _callSetUp(self):
         self.setUp()

     def _callTestMethod(self, method):
+        if sys.gettrace() is not None:
+            raise Exception("sys.gettrace() is not None")
         method()

     def _callTearDown(self):

And I used the following script:
---------------
import random
import os.path
import sys

with open("tests") as fp:
    lines = list(filter(bool, (line.strip() for line in fp)))
print(len(lines))

filename = "test"
loop = 2
while os.path.exists(filename):
    filename = "test%s" % loop
    loop += 1

with open(filename, "w") as fp:
    for _ in range(5):
        test = random.choice(lines)
        print(test, file=fp)
    print("test_signal", file=fp)

with open(filename) as fp:
    for line in fp:
        print(line.rstrip())

args = [sys.executable, "-m", "test", "--fromfile=" + filename]
print("RUN", args)

os.execv(args[0], args)
---------------

I created the "tests" file using the command:

   python -m test --list-tests > tests

Then I removed all tests starting at test_signal, including test_signal. I 
removed slow tests like asyncio and multiprocessing tests.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43955>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to