summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>2022-09-09 03:46:13 (GMT)
committerGitHub <noreply@github.com>2022-09-09 03:46:13 (GMT)
commit569ca27293eec89b5b41c3a12e6531d3eddf0e1b (patch)
treef23064c274f4f472fca03c542a109af356b252f0
parentdf50938f583b6abd9f31f1ff1f5ad52d7b04ecbb (diff)
downloadcpython-569ca27293eec89b5b41c3a12e6531d3eddf0e1b.zip
cpython-569ca27293eec89b5b41c3a12e6531d3eddf0e1b.tar.gz
cpython-569ca27293eec89b5b41c3a12e6531d3eddf0e1b.tar.bz2
gh-96624: Fix test_dotted_but_module_not_loaded in testpatch.py (GH-96691)
* Update test_dotted_but_module_not_loaded to reflect the move of unittest.test to test.test_unittest.
-rw-r--r--Lib/test/test_unittest/testmock/testpatch.py2
-rw-r--r--Misc/NEWS.d/next/Tests/2022-09-08-18-31-26.gh-issue-96624.5cANM1.rst1
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_unittest/testmock/testpatch.py b/Lib/test/test_unittest/testmock/testpatch.py
index 93ec0ca..8ceb5d9 100644
--- a/Lib/test/test_unittest/testmock/testpatch.py
+++ b/Lib/test/test_unittest/testmock/testpatch.py
@@ -1923,7 +1923,7 @@ class PatchTest(unittest.TestCase):
del sys.modules['test.test_unittest.testmock.support']
del sys.modules['test.test_unittest.testmock']
del sys.modules['test.test_unittest']
- del sys.modules['unittest']
+ del sys.modules['test']
# now make sure we can patch based on a dotted path:
@patch('test.test_unittest.testmock.support.X')
diff --git a/Misc/NEWS.d/next/Tests/2022-09-08-18-31-26.gh-issue-96624.5cANM1.rst b/Misc/NEWS.d/next/Tests/2022-09-08-18-31-26.gh-issue-96624.5cANM1.rst
new file mode 100644
index 0000000..2d1bcc0
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2022-09-08-18-31-26.gh-issue-96624.5cANM1.rst
@@ -0,0 +1 @@
+Fixed the failure of repeated runs of ``test.test_unittest`` caused by side effects in ``test_dotted_but_module_not_loaded``.