]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 30 Sep 2021 16:20:39 +0000 (19:20 +0300)
committerGitHub <noreply@github.com>
Thu, 30 Sep 2021 16:20:39 +0000 (19:20 +0300)
commitec4d917a6a68824f1895f75d113add9410283da7
tree5e6e616f4be55cfef8928882f50ce37e6709fbb8
parentb07fddd527efe67174ce6b0fdbe8dac390b16e4e
bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)

* Work correctly if an additional fresh module imports other
  additional fresh module which imports a blocked module.
* Raises ImportError if the specified module cannot be imported
  while all additional fresh modules are successfully imported.
* Support blocking packages.
* Always restore the import state of fresh and blocked modules
  and their submodules.
* Fix test_decimal and test_xml_etree which depended on an undesired
  side effect of import_fresh_module().
Lib/test/support/import_helper.py
Lib/test/test_decimal.py
Lib/test/test_xml_etree.py
Misc/NEWS.d/next/Tests/2021-09-30-16-54-39.bpo-40173.J_slCw.rst [new file with mode: 0644]