summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-29514: Make magic number test work for candidates (GH-7945)Ned Deily2018-06-271-1/+1
|
* bpo-32374: Ignore Python-level exceptions in test_bad_traverse (GH-7145)Miss Islington (bot)2018-05-281-7/+13
| | | | | (cherry picked from commit 08c5aca9d13b24b35faf89ebd26fc348ae1731b2) Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
* bpo-33629: Prevent coredump in test_importlib (GH-7090)Miss Islington (bot)2018-05-241-1/+4
| | | | | | | | bpo-32374, bpo-33629: Use support.SuppressCrashReport() in test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent leaking a core dump file. (cherry picked from commit 483000e164ec68717d335767b223ae31b4b720cf) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Miss Islington (bot)2018-03-171-1/+15
| | | | | | | | Multi-phase initialized modules allow m_traverse to be called while the module is still being initialized, so module authors may need to account for that. (cherry picked from commit c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9) Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
* Revert "[3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) ↵Barry Warsaw2018-02-262-20/+2
| | | | | (#5504)" (#5911) This reverts commit a71397fb6603d0fe673acd7765c74699cd28fe7b.
* [3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5504)Barry Warsaw2018-02-032-2/+20
| | | | | | | | | | * Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages. * Make sure ``__spec__.origin` matches ``__file__`` for namespace packages. https://bugs.python.org/issue32303 https://bugs.python.org/issue32305. (cherry picked from commit bbbcf8693b876daae4469765aa62f8924f39a7d2) Co-authored-by: Barry Warsaw <barry@python.org>
* [3.6] bpo-32297: Fix misspellings in Python source code comments (GH-4803) ↵Andrew Svetlov2017-12-141-1/+1
| | | | | | | | | | | | | | (#4864) * [3.6] bpo-32297: Few misspellings found in Python source code comments. (GH-4803) * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py. (cherry picked from commit 53f7a7c2814fbfd8a29200926601a32fa48bacb3)
* [3.6] bpo-21720: Restore the Python 2.7 logic in handling a fromlist. ↵Serhiy Storchaka2017-10-261-0/+43
| | | | | | | | (GH-4118) (#4128) BytesWarning no longer emitted when the fromlist argument of __import__() or the __all__ attribute of the module contain bytes instances.. (cherry picked from commit 41c56940c6edf3ea169332a6b039b6c8796f0475)
* [3.6] bpo-31642: Restore blocking "from" import by setting None in ↵Serhiy Storchaka2017-10-081-0/+14
| | | | | sys.modules. (GH-3834). (#3923) (cherry picked from commit f07e2b64df6304a36fb5e29397d3c77a7ba17704)
* [3.6] bpo-30876: Relative import from unloaded package now reimports the ↵Serhiy Storchaka2017-07-161-1/+1
| | | | | | | | | package (GH-2639) (#2676) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError. (cherry picked from commit 8a9cd20edca7d01b68292036029ae3735ce65edd)
* [3.6] bpo-29514: Check magic number for bugfix releases (#2157)Nick Coghlan2017-06-131-0/+44
| | | | | | | | | | | | Add a test to check the current MAGIC_NUMBER against the expected number for the release if the current release is at candidate or final level. On test failure, describe to the developer the procedure for changing the magic number. This ensures that pre-merge CI will automatically pick up on magic number changes in maintenance releases (and explain why those are problematic), rather than relying on all core developers to be aware of the implications of such changes.
* Issue #26940: Fix test_importlib that hangs on the Android armv7 qemu emulator.Xavier de Gaye2016-12-081-1/+1
|
* Issue #28026: Raise ImportError when exec_module() exists but ↵Eric Snow2016-09-081-7/+1
| | | | create_module() is missing.
* Issue #26667: Add path-like object support to importlib.util.Brett Cannon2016-09-082-0/+25
|
* Issue #15767: Use ModuleNotFoundError.Eric Snow2016-09-072-5/+9
|
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
|
* Merge #27782 fix from 3.5Nick Coghlan2016-08-211-0/+9
|\
| * Issue #27782: Fix m_methods handling in multiphase initNick Coghlan2016-08-211-0/+9
| | | | | | | | | | | | | | | | Multi-phase extension module import now correctly allows the ``m_methods`` field to be used to add module level functions to instances of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
* | Merge for #27083Brett Cannon2016-07-163-18/+18
|\ \ | |/
| * Fix regressions introduced by fixes for issue #27083.Brett Cannon2016-07-163-18/+18
| |
* | Merge for #27083Brett Cannon2016-07-151-6/+9
|\ \ | |/
| * Issue #27083: Respect the PYTHONCASEOK environment variable underBrett Cannon2016-07-151-6/+9
| | | | | | | | | | | | | | | | | | | | Windows. Originally only b'PYTHONCASEOK' was being checked for in os.environ, but that won't work under Windows where all environment variables are strings (on OS X they are bytes). Thanks to Eryk Sun for the bug report.
* | Issue #26896: Disambiguate uses of "importer" with "finder".Brett Cannon2016-07-082-2/+0
| | | | | | | | Thanks to Oren Milman for the patch.
* | Issue #26186: Remove the restriction that built-in and extensionBrett Cannon2016-06-251-0/+2
| | | | | | | | | | | | | | | | modules can't be lazily loaded. Thanks to Python 3.6 allowing for types.ModuleType to have its __class__ mutated, the restriction can be lifted by calling create_module() on the wrapped loader.
* | Merge from 3.5Brett Cannon2016-06-251-3/+13
|\ \ | |/
| * Fix a scoping issue where an UnboundLocalError was triggered if aBrett Cannon2016-06-251-3/+13
| | | | | | | | lazy-loaded module was already in sys.modules.
* | Issue #21099: Switch applicable importlib tests to use PEP 451 API.Eric Snow2016-05-107-38/+106
| |
* | Fixes #19711: Add tests for reloading namespace packages.Eric Snow2016-05-101-1/+33
| |
* | Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-244-6/+0
| |
* | Issue #23277: Remove unused support.run_unittest import.Serhiy Storchaka2016-04-241-1/+0
| |
* | Issue #23277: Remove more unused sys and os imports.Serhiy Storchaka2016-04-241-1/+0
| |
* | Issue #23277: Remove unused sys and os importsBerker Peksag2016-04-245-6/+0
| | | | | | | | Patch by Jon Dufresne.
* | Issue #26668: Remove the redundant Lib/test/test_importlib/regrtest.pyBrett Cannon2016-04-081-17/+0
| |
* | Cleanup regrtest "main()" functionVictor Stinner2016-03-241-2/+2
| | | | | | | | | | | | | | * Rename libregrtest.main_in_temp_cwd() to libregrtest.main() * Add regrtest.main_in_temp_cwd() alias to libregrtest.main() * Move old main_in_temp_cwd() code into libregrtest.Regrtest.main() * Update multiple scripts to call libregrtest.main()
* | Issue #26581: Use the first coding cookie on a line, not the last one.Serhiy Storchaka2016-03-201-1/+1
|\ \ | |/
| * Issue #26581: Use the first coding cookie on a line, not the last one.Serhiy Storchaka2016-03-201-1/+1
| |
* | Merge for issue #26186Brett Cannon2016-02-211-0/+1
|\ \ | |/
| * Issue #26186: Remove an invalid type check inBrett Cannon2016-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | importlib.util.LazyLoader. The class was checking its argument as to whether its implementation of create_module() came directly from importlib.abc.Loader. The problem is that the classes coming from imoprtlib.machinery do not directly inherit from the ABC as they come from _frozen_importlib. Because the documentation has always said that create_module() was ignored, the check has simply been removed.
* | Merge for issue #26367Brett Cannon2016-02-201-0/+5
|\ \ | |/
| * Issue #26367: Have importlib.__init__() raise RuntimeError whenBrett Cannon2016-02-201-0/+5
| | | | | | | | | | | | | | 'level' is specified but no __package__. This brings the function inline with builtins.__import__(). Thanks to Manuel Jacob for the patch.
* | Issue #25985: sys.version_info is now used instead of sys.versionSerhiy Storchaka2016-02-111-1/+1
| | | | | | | | to format short Python version.
* | Issue #18018: Raise an ImportError if a relative import is attemptedBrett Cannon2016-01-231-0/+5
| | | | | | | | | | | | | | | | with no known parent package. Previously SystemError was raised if the parent package didn't exist (e.g., __package__ was set to ''). Thanks to Florent Xicluna and Yongzhi Pan for reporting the issue.
* | whitespace cleanupBrett Cannon2016-01-221-2/+2
| |
* | Issue #25791: Warn when __package__ != __spec__.parent.Brett Cannon2016-01-222-15/+34
| | | | | | | | | | | | | | | | | | In a previous change, __spec__.parent was prioritized over __package__. That is a backwards-compatibility break, but we do eventually want __spec__ to be the ground truth for module details. So this change reverts the change in semantics and instead raises an ImportWarning when __package__ != __spec__.parent to give people time to adjust to using spec objects.
* | Issue #25791: Raise an ImportWarning when __spec__ or __package__ areBrett Cannon2016-01-151-14/+26
|/ | | | | | | | not defined for a relative import. This is the start of work to try and clean up import semantics to rely more on a module's spec than on the myriad attributes that get set on a module. Thanks to Rose Ames for the patch.
* Issue #25595: Fixed test_deleted_cwd in test_importlib on AIX.Serhiy Storchaka2015-11-111-8/+14
|
* use assert method in another placeBenjamin Peterson2015-05-301-1/+1
|
* use assert method (#24328)Benjamin Peterson2015-05-291-1/+1
|
* fix importing one char extension modules (closes #24328)Benjamin Peterson2015-05-291-0/+8
|
* Issue #24285: fix importing extensions from packagesNick Coghlan2015-05-261-0/+7
|