mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Issue 5354: Change API for import_fresh_module() to better support test_warnings use case (also fixes some bugs in the original implementation)
This commit is contained in:
parent
aca19e6a74
commit
5533ff6a2e
5 changed files with 85 additions and 21 deletions
|
@ -10,8 +10,8 @@ import warning_tests
|
|||
|
||||
import warnings as original_warnings
|
||||
|
||||
py_warnings = test_support.import_fresh_module('warnings', ['_warnings'])
|
||||
c_warnings = test_support.import_fresh_module('warnings')
|
||||
py_warnings = test_support.import_fresh_module('warnings', blocked=['_warnings'])
|
||||
c_warnings = test_support.import_fresh_module('warnings', fresh=['_warnings'])
|
||||
|
||||
@contextmanager
|
||||
def warnings_state(module):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue