Skip to content

Conversation

sweeneyde
Copy link
Member

@sweeneyde sweeneyde commented Sep 8, 2022

This seems to reflect better the original meaning of the code before c735d54, and it should fix the consistent warning on most refleak buildbots.

@sweeneyde sweeneyde requested a review from cjw296 as a code owner September 8, 2022 18:28
@sweeneyde sweeneyde changed the title Fix test_dotted_but_module_not_loaded in testpatch.py gh-96624: Fix test_dotted_but_module_not_loaded in testpatch.py Sep 8, 2022
@sweeneyde sweeneyde added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 8, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @sweeneyde for commit dff1c60 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 8, 2022
@sweeneyde
Copy link
Member Author

All of the refleak buildbots that ran no longer have the warnings about failing and re-trying test_unittest.

Unfortunately, they all emit at least one other warning (#96696), so they're still "orange", not green.

Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This seems to reflect better the original meaning of the code before c735d54,

Specifically this bit: c735d54#diff-a166f2dc69b03117686d52e8c67698b174f612d6e57c692a74d5f4cce1798c84L1922-L1926

         # make sure it's there
-        import unittest.test.testmock.support
+        import test.test_unittest.testmock.support
         # now make sure it's not:
         with patch.dict('sys.modules'):
-            del sys.modules['unittest.test.testmock.support']
-            del sys.modules['unittest.test.testmock']
-            del sys.modules['unittest.test']
+            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']

@sweeneyde sweeneyde merged commit 569ca27 into python:main Sep 9, 2022
@sweeneyde sweeneyde deleted the testpatch_fix branch September 9, 2022 03:46
@cjw296
Copy link
Contributor

cjw296 commented Sep 12, 2022

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants