This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Guido.van.Rossum, Mark.Shannon, corona10, gvanrossum, paul.moore, serhiy.storchaka, shihai1991, shreyanavigyan, steve.dower, tim.golden, tim.peters, vstinner, zach.ware
Date 2021-04-27.23:40:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
FYI I used the following patch to debug this issue:

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

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

     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)))

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:

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.
Date User Action Args
2021-04-27 23:40:30vstinnersetrecipients: + vstinner, gvanrossum, tim.peters, paul.moore, tim.golden, Mark.Shannon, zach.ware, serhiy.storchaka, steve.dower, Guido.van.Rossum, corona10, shihai1991, shreyanavigyan
2021-04-27 23:40:30vstinnersetmessageid: <>
2021-04-27 23:40:30vstinnerlinkissue43955 messages
2021-04-27 23:40:30vstinnercreate