summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/source
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42135: Deprecate implementations of find_module() and find_loader() ↵Brett Cannon2021-04-061-1/+4
| | | | (GH-25169)
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181)Inada Naoki2021-04-052-6/+6
| | | | | | * Fix test_shutil * Fix test_imp * Fix test_import * Fix test_importlib
* bpo-40275: Fix failed test cases by using test helpers (GH-21811)Hai Shi2020-08-101-3/+3
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21727)Hai Shi2020-08-042-2/+2
|
* bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627)idomic2020-03-091-0/+4
| | | | | The importlib module now ignores the PYTHONCASEOK environment variable when the -E or -I command line options are being used.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-1/+1
|
* bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH ↵Elvis Pranskevichus2018-10-101-0/+15
| | | | | | | | | | | | | | | | | | | | (GH-9607) Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in 3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides *invalidation_mode*, even if it was passed as an explicit argument to ``py_compile.compile()`` or ``compileall``. An environment variable should *never* override an explicit argument to a library function. That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH`` environment variable is set. This changes ``py_compile.compile()`` to only look at ``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified. I also made various relevant tests run with explicit control over the value of ``SOURCE_DATE_EPOCH``. While looking at this, I noticed that ``zipimport`` does not work with hash-based .pycs _at all_, though I left the fixes for subsequent commits.
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-1/+1
|
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * 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
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-15/+195
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* Merge for #27083Brett Cannon2016-07-161-10/+3
|\
| * Fix regressions introduced by fixes for issue #27083.Brett Cannon2016-07-161-10/+3
| |
* | 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 #21099: Switch applicable importlib tests to use PEP 451 API.Eric Snow2016-05-102-8/+12
| |
* | 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-241-1/+0
|/ | | | Patch by Jon Dufresne.
* Issue #26581: Use the first coding cookie on a line, not the last one.Serhiy Storchaka2016-03-201-1/+1
|
* Issue #23911: Move path-based bootstrap code to a separate frozen module.Eric Snow2015-05-031-2/+2
|
* 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 #21503: Use test_both() consistently in test_importlib.Eric Snow2014-05-165-34/+82
| |
* | Issue #19721: Consolidate test_importlib utility code into a singleBrett Cannon2014-05-096-140/+39
|/ | | | module.
* merge 3.3 (#20796)Benjamin Peterson2014-02-271-0/+1
|\
| * fix importlib test failure when bytecode writing is disabled (closes #20796)Benjamin Peterson2014-02-271-0/+1
| | | | | | | | Patch by Berker Peksag.
* | Issue 19713: Add PEP 451-related deprecations.Eric Snow2014-01-073-31/+93
| |
* | Issue #19927: Add __eq__ to path-based loaders in importlib.Eric Snow2014-01-041-0/+13
| |
* | Issue #19712: Update test.test_importlib.source for PEP 451Brett Cannon2013-12-064-24/+140
| |
* | Issue #16803: test.test_importlib.source now tests frozen and source codeBrett Cannon2013-11-085-74/+91
| |
* | Issue #16803: Stop having test.test_importlib.abc ABCs inherit fromBrett Cannon2013-10-252-2/+7
| | | | | | | | | | unittest.TestCase in prep of running tests under frozen and source importlib.
* | 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-041-57/+10
|\ \ | |/
| * Issue #16826: Revert fix while Windows issues are being worked out.Meador Inge2013-09-041-57/+10
| |
* | Issue #16826: Don't check for PYTHONCASEOK when using -E.Meador Inge2013-09-031-10/+57
|\ \ | |/ | | | | | | 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-031-10/+57
| | | | | | | | | | 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 #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-155-14/+14
| |
* | Issues #18088, 18089: IntroduceBrett Cannon2013-05-311-25/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/returnBrett Cannon2013-04-091-410/+0
| | | | | | | | | | | | | | | | | | | | the default exception/value when called instead of raising/returning NotimplementedError/NotImplemented (except where appropriate). This should allow for the ABCs to act as the bottom/end of the MRO with expected default results. As part of this work, also make importlib.abc.Loader.module_repr() optional instead of an abstractmethod.
* | #11420: merge with 3.3.Ezio Melotti2013-03-161-1/+2
|\ \ | |/
| * #11420: merge with 3.2.Ezio Melotti2013-03-161-1/+2
| |
* | Merge from 3.3 for fix for issue #16730Brett Cannon2013-01-111-0/+35
|\ \ | |/
| * Issue #16730: Don't raise an exception inBrett Cannon2013-01-111-0/+35
| | | | | | | | | | | | | | | | importlib.machinery.FileFinder when the directory has become unreadable or a file. This brings semantics in line with Python 3.2 import. Reported and diagnosed by David Pritchard.
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-252-8/+8
| |
* | Issue #15627: This is simply an update to the name of a new method recently ↵Eric Snow2012-12-051-2/+2
| | | | | | | | | | | | added to importlib.abc.SourceLoader.
* | Issue #15627: Add the compile_source() method toBrett Cannon2012-11-181-6/+9
| | | | | | | | | | | | | | importlib.abc.SourceLoader. This provides an easy hook into the import system to allow for source transformations, AST optimizations, etc.
* | Issue #15641: Clean up deprecated classes from importlibAndrew Svetlov2012-11-051-502/+3
|/ | | | Patch by Taras Lyapun.
* Close #14846: Handle a sys.path entry going awayNick Coghlan2012-08-201-3/+12
|
* Issue #15576: Allow extension modules to be a package's __init__Brett Cannon2012-08-103-9/+7
| | | | | module again. Also took the opportunity to stop accidentally exporting _imp.extension_suffixes() as public.