◐ Shell
clean mode source ↗

bpo-34200: Fix non-determinism of test_pkg by gpshead · Pull Request #9248 · python/cpython

added 2 commits

September 12, 2018 16:53
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.

@gpshead

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Sep 13, 2018
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

Sep 13, 2018
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

Sep 13, 2018
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

Sep 13, 2018
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>