summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
Commit message (Collapse)AuthorAgeFilesLines
* Issue #19927: Add __eq__ to path-based loaders in importlib.Eric Snow2014-01-043-2/+23
|
* Issue #20097: Fix bad use of "self" in importlib's WindowsRegistryFinder.Eric Snow2014-01-031-0/+29
|
* Issue #18864: Add a setter for ModuleSpec.has_location.Eric Snow2013-12-111-0/+7
|
* Remove commented-out module spec test code and an out-of-date note.Eric Snow2013-12-101-10/+0
|
* Issue 19851: Fix a regression in reloading submodules.Eric Snow2013-12-101-0/+68
|
* Issue #19758: silence PendingDeprecationWarnings in test_importlib.Eric Snow2013-12-081-4/+8
|
* Issue #19712: Update test.test_importlib.source for PEP 451Brett Cannon2013-12-064-24/+140
|
* Issue #19712: Update test.test_importlib.import_ to test/use PEP 451Brett Cannon2013-12-068-61/+114
| | | | 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().
* Issue #19698: Remove exec_module() from the built-in and extensionBrett Cannon2013-11-292-137/+0
| | | | | | | | | | | | | module loaders. Due to the fact that the call signatures for extension modules and built-in modules does not allow for the specifying of what module to initialize and that on Windows all extension modules are built-in modules, work to clean up built-in and extension module initialization will have to wait until Python 3.5. Because of this the semantics of exec_module() would be incorrect, so removing the methods for now is the best option; load_module() is still used as a fallback by importlib and so this won't affect semantics.
* Make test_importlib output easier to trace back to the failing testBrett Cannon2013-11-221-0/+1
| | | | class.
* Issue #18864: Don't try and use unittest as a testing module forBrett Cannon2013-11-221-6/+18
| | | | | built-in loading; leads to a reload scenario where attributes get set which are wrong after the test.
* Implement PEP 451 (ModuleSpec).Eric Snow2013-11-2213-336/+1403
|
* Issue #16803: test.test_importlib.source now tests frozen and source codeBrett Cannon2013-11-085-74/+91
|
* Simplify test.test_importlib.__main__Brett Cannon2013-11-081-10/+1
|
* Issue #16803: test.test_importlib.import_ now tests frozen and source codeBrett Cannon2013-11-0811-154/+146
|
* Issue #16803: test.test_importlib.frozen now runs both frozen and source codeBrett Cannon2013-11-082-31/+33
|
* Issue #19413: Disregard duplicate namespace portions during reload tests.Eric Snow2013-11-011-2/+2
|
* Issue #19413: Restore pre-3.3 reload() semantics of re-finding modules.Eric Snow2013-11-011-0/+120
|
* Issue #16803: Move test.test_importlib.extension to use both frozen and ↵Brett Cannon2013-10-254-44/+44
| | | | source importlib code
* Issue #16803: Have test.test_importlib.builtin test both frozen andBrett Cannon2013-10-252-26/+33
| | | | source importlib.
* Issue #16803: Stop having test.test_importlib.abc ABCs inherit fromBrett Cannon2013-10-259-16/+16
| | | | | unittest.TestCase in prep of running tests under frozen and source importlib.
* [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
| |
* | Fix test to not consider mixin a standalone testBrett Cannon2013-10-181-1/+1
| |
* | Issue #16803: Move test_importlib.test_util to use both frozen andBrett Cannon2013-10-182-50/+96
| | | | | | | | source code.
* | Issue #16803: Have test_importlib.test_locks use frozen and sourceBrett Cannon2013-10-181-21/+48
| | | | | | | | code.
* | 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 #16803: test.test_importlib.test_api now runs under frozen andBrett Cannon2013-10-181-37/+69
| | | | | | | | source.
* | [issue 19152] Ensure we have actually registered ExtensionFileLoader as an ↵Eric Snow2013-10-051-0/+1
| | | | | | | | ExecutionLoader.
* | Issue #16803: Run test.test_importlib.test_abc under bothBrett Cannon2013-10-042-120/+308
| | | | | | | | _frozen_importlib and source.
* | Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py scriptSerhiy Storchaka2013-09-161-3/+3
|\ \ | |/ | | | | now detect Python source code encoding only in comment lines.
| * Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py scriptSerhiy Storchaka2013-09-161-3/+3
| | | | | | | | now detect Python source code encoding only in comment lines.
* | Issue #16826: Revert fix while Windows issues are being worked out.Meador Inge2013-09-042-86/+18
|\ \ | |/
| * Issue #16826: Revert fix while Windows issues are being worked out.Meador Inge2013-09-042-86/+18
| |
* | Issue #16826: Don't check for PYTHONCASEOK when using -E.Meador Inge2013-09-032-18/+86
|\ \ | |/ | | | | | | This commit fixes a regression that sneaked into Python 3.3 where importlib was not respecting -E when checking for the PYTHONCASEOK environment variable.
| * Issue #16826: Don't check for PYTHONCASEOK when using -E.Meador Inge2013-09-032-18/+86
| | | | | | | | | | This commit fixes a regression that sneaked into Python 3.3 where importlib was not respecting -E when checking for the PYTHONCASEOK environment variable.
* | Closes issue #18698: ensure importlib.reload() returns the module out of ↵Eric Snow2013-08-151-0/+16
| | | | | | | | sys.modules.
* | 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 #18076: Introduce imoportlib.util.decode_source().Brett Cannon2013-06-161-0/+21
| | | | | | | | | | | | | | The helper function makes it easier to implement imoprtlib.abc.InspectLoader.get_source() by making that function require just the raw bytes for source code and handling all other details.
* | Issue #17177: The imp module is pending deprecation.Brett Cannon2013-06-162-2/+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-1516-76/+78
| |
* | Issue #17907: touch up the code for imp.new_module().Brett Cannon2013-06-151-0/+116
| |
* | Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document theBrett Cannon2013-06-141-0/+11
| | | | | | | | deprecation of imp.get_magic().
* | Issue #18193: Add importlib.reload(), documenting (but notBrett Cannon2013-06-141-0/+12
| | | | | | | | | | | | implementing in code) the deprecation of imp.reload(). Thanks to Berker Peksag for the patch.
* | 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.
* | Issue #18065: For frozen packages set __path__ to [].Brett Cannon2013-06-011-1/+1
| | | | | | | | | | | | | | Previously __path__ was set to [__name__], but that could lead to bad results if someone managed to circumvent the frozen importer and somehow ended up with a finder that thought __name__ was a legit directory/location.
* | Issues #18088, 18089: IntroduceBrett Cannon2013-05-313-30/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | importlib.abc.Loader.init_module_attrs() and implement importlib.abc.InspectLoader.load_module(). The importlib.abc.Loader.init_module_attrs() method sets the various attributes on the module being loaded. It is done unconditionally to support reloading. Typically people used importlib.util.module_for_loader, but since that's a decorator there was no way to override it's actions, so init_module_attrs() came into existence to allow for overriding. This is also why module_for_loader is now pending deprecation (having its other use replaced by importlib.util.module_to_load). All of this allowed for importlib.abc.InspectLoader.load_module() to be implemented. At this point you can now implement a loader with nothing more than get_code() (which only requires get_source(); package support requires is_package()). Thanks to init_module_attrs() the implementation of load_module() is basically a context manager containing 2 methods calls, a call to exec(), and a return statement.