summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/import_
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38839: Fix some unused functions in tests (GH-17189)Adam Johnson2019-11-191-0/+1
|
* bpo-37444: Update differing exception between builtins and importlib (GH-14869)Ngalim Siregar2019-08-031-2/+2
| | | | | | | | | | Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure. https://bugs.python.org/issue37444 Automerge-Triggered-By: @brettcannon
* bpo-33169: Remove values of `None` from sys.path_importer_cache when ↵Brett Cannon2018-04-061-0/+21
| | | | | invalidating caches (GH-6402) An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
* bpo-21720: Restore the Python 2.7 logic in handling a fromlist. (#4118)Serhiy Storchaka2017-10-261-0/+43
| | | | | | BytesWarning no longer emitted when the fromlist argument of __import__() or the __all__ attribute of the module contain bytes instances.
* bpo-31642: Restore blocking "from" import by setting None in sys.modules. ↵Serhiy Storchaka2017-10-081-0/+14
| | | | (#3834)
* Spelling fixes (#2902)Ville Skyttä2017-08-031-1/+1
|
* bpo-30876: Relative import from unloaded package now reimports the package ↵Serhiy Storchaka2017-07-121-1/+1
| | | | | | | | | (#2639) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
* Issue #15767: Use ModuleNotFoundError.Eric Snow2016-09-072-5/+9
|
* Issue #26896: Disambiguate uses of "importer" with "finder".Brett Cannon2016-07-081-1/+0
| | | | Thanks to Oren Milman for the patch.
* Issue #21099: Switch applicable importlib tests to use PEP 451 API.Eric Snow2016-05-101-15/+53
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|
* Issue #23277: Remove unused sys and os importsBerker Peksag2016-04-241-1/+0
| | | | Patch by Jon Dufresne.
* 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 #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
|
* Issue #23911: Move path-based bootstrap code to a separate frozen module.Eric Snow2015-05-031-1/+1
|
* Issue #22834: Drop a redundant comment and use errno instead of anBrett Cannon2015-02-271-2/+2
| | | | | | integer. Thanks to Serhiy Storchaka and Martin Panter for the suggestions.
* Issue #22834: Fix a failing test under Solaris due to the platform notBrett Cannon2015-02-201-2/+8
| | | | | | allowing the deletion of the cwd. Thanks to Martin Panter for the initial fix.
* Issue #23014: Make importlib.abc.Loader.create_module() required whenBrett Cannon2015-01-092-0/+7
| | | | | | | | | importlib.abc.Loader.exec_module() is also defined. Before this change, create_module() was optional **and** could return None to trigger default semantics. This change now reduces the options for choosing default semantics to one and in the most backporting-friendly way (define create_module() to return None).
* Issue #22834: cwd can't not exist on Windows, skip the testZachary Ware2014-11-221-0/+1
|
* Issue #22834: Have import suppress FileNotFoundError when the currentBrett Cannon2014-11-211-0/+12
| | | | | | working directory no longer exists. Thanks to Martin Panter for the bug report.
* Closes #22002: Merge with 3.4Zachary Ware2014-07-232-12/+8
|\
| * Issue #22002: Make full use of test discovery in test sub-packages.Zachary Ware2014-07-232-12/+8
| | | | | | | | | | | | Adds `load_package_tests` function to test.support, uses it in test_asyncio, test_email, test_json, test_tools, test_importlib and all test_importlib sub-packages to implement test discovery.
* | Issue #19593: Use specific asserts in importlib tests.Serhiy Storchaka2014-07-072-2/+2
|\ \ | |/
| * Issue #19593: Use specific asserts in importlib tests.Serhiy Storchaka2014-07-072-2/+2
| |
| * Issue #20763: Fix importlib.machinery.PathFinder to supportBrett Cannon2014-02-261-0/+24
| | | | | | | | | | | | PathEntryFinder instances which only define find_module(). Reported by Yukihiro Nakadaira.
* | Issue #21503: Use test_both() consistently in test_importlib.Eric Snow2014-05-169-34/+69
| |
* | Fix a small typo in test_importlib.Eric Snow2014-05-161-2/+2
| |
* | Issue #19721: Consolidate test_importlib utility code into a singleBrett Cannon2014-05-0910-47/+18
| | | | | | | | module.
* | Issue #20776: Flesh out tests for importlib.machinery.PathFinder.Brett Cannon2014-05-091-0/+47
| |
* | Issue #20763: Fix importlib.machinery.PathFinder to supportBrett Cannon2014-02-261-0/+24
|/ | | | | | PathEntryFinder instances which only define find_module(). Reported by Yukihiro Nakadaira.
* Issue #19712: Update test.test_importlib.import_ to test/use PEP 451Brett Cannon2013-12-067-53/+74
| | | | where appropriate.
* Issue #19712: Port test.test_importlib.import_ tests to use PEP 451Brett Cannon2013-11-293-16/+68
| | | | that don't require changing test.test_importlib.util.mock_modules().
* Implement PEP 451 (ModuleSpec).Eric Snow2013-11-221-2/+2
|
* Issue #16803: test.test_importlib.import_ now tests frozen and source codeBrett Cannon2013-11-0810-152/+146
|
* [Issue #19357] Ensure module "loaded" during tests gets forgotten.Eric Snow2013-10-231-1/+1
|\
| * [Issue #19357] Ensure module "loaded" during tests gets forgotten.Eric Snow2013-10-231-1/+1
| |
| * Issue #16793. Replace deprecated unittest asserts with modern counterparts.Serhiy Storchaka2012-12-271-1/+1
| |
* | Issue #18416: Have importlib.machinery.PathFinder treat '' as the cwdBrett Cannon2013-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and stop importlib.machinery.FileFinder treating '' as '.'. Previous PathFinder transformed '' into '.' which led to __file__ for modules imported from the cwd to always be relative paths. This meant the values of the attribute were wrong as soon as the cwd changed. This change now means that as long as the site module is run (which makes all entries in sys.path absolute) then all values for __file__ will also be absolute unless it's for __main__ when specified by file path in a relative way (modules imported by runpy will have an absolute path). Now that PathFinder is no longer treating '' as '.' it only makes sense for FileFinder to stop doing so as well. Now no transformation is performed for the directory given to the __init__ method. Thanks to Madison May for the initial patch.
* | Issue #15767: back out 8a0ed9f63c6e, finishing the removal ofBrett Cannon2013-07-042-8/+4
| | | | | | | | ModuleNotFoundError.
* | Issue #15767: Back out 8d28d44f3a9a related to ModuleNotFoundError.Brett Cannon2013-07-041-7/+0
| |
* | Issue #17177: The imp module is pending deprecation.Brett Cannon2013-06-161-1/+0
| | | | | | | | | | | | To make sure there is no issue with code that is both Python 2 and 3 compatible, there are no plans to remove the module any sooner than Python 4 (unless the community moves to Python 3 solidly before then).
* | Issue #17177: stop using imp in test_importlibBrett Cannon2013-06-153-6/+6
| |
* | Issue #15767: Add an explicit test for raising ModuleNotFoundErrorBrett Cannon2013-06-131-0/+7
| | | | | | | | when None in sys.modules.
* | Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-122-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImportError. The exception is raised by import when a module could not be found. Technically this is defined as no viable loader could be found for the specified module. This includes ``from ... import`` statements so that the module usage is consistent for all situations where import couldn't find what was requested. This should allow for the common idiom of:: try: import something except ImportError: pass to be updated to using ModuleNotFoundError and not accidentally mask ImportError messages that should propagate (e.g. issues with a loader). This work was driven by the fact that the ``from ... import`` statement needed to be able to tell the difference between an ImportError that simply couldn't find a module (and thus silence the exception so that ceval can raise it) and an ImportError that represented an actual problem.
* | Normalize whitespaceBrett Cannon2013-03-131-1/+1
| |