bpo-34200: Fix non-determinism of test_pkg by gpshead · Pull Request #9248 · python/cpython
added 2 commits
test_pkg was using test.support.modules_setup() and test.support.modules_cleanup() in an attempt to save and restore the sys.modules contents before and after tests in setUp and tearDown. An example side effect of this was that Python startup time only code paths such as 'import _bootlocale' being executed from locale.getpreferredencoding() within many of the test cases testing imports happening.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
This causes the tearDown code to only unimport the test modules specifically created as part of each test via the self.mkhier method rather than abusing test.support.modules_setup() and the scary test.support.modules_cleanup() code. https://bugs.python.org/issue34200 (cherry picked from commit 4ae8ece) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
This causes the tearDown code to only unimport the test modules specifically created as part of each test via the self.mkhier method rather than abusing test.support.modules_setup() and the scary test.support.modules_cleanup() code. https://bugs.python.org/issue34200 (cherry picked from commit 4ae8ece) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington added a commit that referenced this pull request
This causes the tearDown code to only unimport the test modules specifically created as part of each test via the self.mkhier method rather than abusing test.support.modules_setup() and the scary test.support.modules_cleanup() code. https://bugs.python.org/issue34200 (cherry picked from commit 4ae8ece) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington added a commit that referenced this pull request
This causes the tearDown code to only unimport the test modules specifically created as part of each test via the self.mkhier method rather than abusing test.support.modules_setup() and the scary test.support.modules_cleanup() code. https://bugs.python.org/issue34200 (cherry picked from commit 4ae8ece) Co-authored-by: Gregory P. Smith <greg@krypto.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters