summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import
Commit message (Collapse)AuthorAgeFilesLines
* gh-94315: Check for DAC override capability (GH-94316)Christian Heimes2022-06-271-2/+1
| | | | | ``os.geteuid() == 0`` is not a reliable check whether the current user has the capability to bypass permission checks. Tests now probe for DAC override.
* gh-84461: Skip test_unwritable_directory again on Emscripten (GH-94007)Christian Heimes2022-06-191-0/+1
| | | GH-93992 removed geteuid() and enabled the test again on Emscripten.
* gh-93461: Invalidate sys.path_importer_cache entries with relative paths ↵Christian Heimes2022-06-101-7/+7
| | | | (GH-93653)
* gh-90473: Make chmod a dummy on WASI, skip chmod tests (GH-93534)Christian Heimes2022-06-061-0/+3
| | | WASI does not have the ``chmod(2)`` syscall yet.
* gh-90473: Skip and document more failing tests on WASI (GH-93436)Christian Heimes2022-06-021-2/+6
| | | | | | | - Mark more ``umask()`` cases - ``dup()`` is not supported - ``/dev/null`` is not available - document missing features - mark more modules as not available
* bpo-40280: Detect missing threading on WASM platforms (GH-32352)Christian Heimes2022-04-071-0/+1
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-3/+13
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-45020: Freeze os, site, and codecs. (gh-28398)Eric Snow2021-09-171-2/+3
| | | https://bugs.python.org/issue45020
* bpo-45020: Freeze some of the modules imported during startup. (gh-28335)Eric Snow2021-09-151-3/+5
| | | | | | | Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.) Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain. https://bugs.python.org/issue45020
* bpo-44717: improve AttributeError on circular imports of submodules (GH-27338)Filipe Laíns2021-07-244-0/+14
|
* Revert "bpo-44717: improve AttributeError on circular imports of submodules ↵Pablo Galindo Salgado2021-07-244-14/+0
| | | | | (GH-27299)" (GH-27331) This reverts commit 8072a1181dd64135f700b44372fbf7bf91e68072.
* bpo-44717: improve AttributeError on circular imports of submodules (GH-27299)Filipe Laíns2021-07-244-0/+14
| | | | | Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-28395: Remove unnecessary semicolons in tests (GH-26868)Dong-hee Na2021-06-231-2/+2
|
* bpo-43105: Importlib now resolves relative paths when creating module spec ↵Steve Dower2021-04-071-7/+7
| | | | objects from file locations (GH-25121)
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181)Inada Naoki2021-04-051-22/+23
| | | | | | * Fix test_shutil * Fix test_imp * Fix test_import * Fix test_importlib
* bpo-40275: Use new test.support helper submodules in tests (GH-21743)Hai Shi2020-08-061-2/+1
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21412)Hai Shi2020-07-091-11/+12
|
* bpo-41043: Escape literal part of the path for glob(). (GH-20994)Serhiy Storchaka2020-06-201-1/+1
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-1/+2
|
* bpo-38091: Import deadlock detection causes deadlock (GH-17518)Armin Rigo2020-03-031-0/+8
| | | Automerge-Triggered-By: @brettcannon
* bpo-39336: Allow packages to not let their child modules be set on them (#18006)Dino Viehland2020-01-233-0/+26
| | | | | * bpo-39336: Allow setattr to fail on modules which aren't assignable When attaching a child module to a package if the object in sys.modules raises an AttributeError (e.g. because it is immutable) it causes the whole import to fail. This now allows immutable packages to exist and an ImportWarning is reported and the AttributeError exception is ignored.
* bpo-37409: fix relative import with no parent (#14956)Ben Lewis2019-09-111-0/+5
| | | | | | | | | | | | | Relative imports use resolve_name to get the absolute target name, which first seeks the current module's absolute package name from the globals: If __package__ (and __spec__.parent) are missing then import uses __name__, truncating the last segment if the module is a submodule rather than a package __init__.py (which it guesses from whether __path__ is defined). The __name__ attempt should fail if there is no parent package (top level modules), if __name__ is '__main__' (-m entry points), or both (scripts). That is, if both __name__ has no subcomponents and the module does not seem to be a package __init__ module then import should fail.
* bpo-20490: Improve circular import error message (GH-15308)Anthony Sottile2019-09-093-0/+14
|
* bpo-37473: Don't import importlib ASAP in tests (GH-14661)Victor Stinner2019-07-141-9/+7
| | | | | | | | | bpo-15386, bpo-37473: test_import, regrtest and libregrtest no longer import importlib as soon as possible, as the first import, "to test bpo-15386". It is tested by test_import.test_there_can_be_only_one(). Sort test_import imports.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-4/+3
|
* bpo-37032: Add CodeType.replace() method (GH-13542)Victor Stinner2019-05-241-7/+1
|
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-36085: Enable better DLL resolution on Windows (GH-12302)Steve Dower2019-03-291-0/+48
|
* bpo-33237: Improve AttributeError message for partially initialized module. ↵Serhiy Storchaka2018-10-303-0/+17
| | | | (GH-6398)
* Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)Victor Stinner2018-06-261-2/+2
| | | This reverts commit 8fbbdf0c3107c3052659e166f73990b466eacbb0.
* bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)Victor Stinner2018-06-221-2/+2
| | | | | | | | * Add support.MS_WINDOWS: True if Python is running on Microsoft Windows. * Add support.MACOS: True if Python is running on Apple macOS. * Replace support.is_android with support.ANDROID * Replace support.is_jython with support.JYTHON * Cleanup code to initialize unix_shell
* bpo-33465: Use an unlikely to be built-in C extension in a test (#6797)Barry Warsaw2018-05-151-5/+6
|
* bpo-33053: -m now adds *starting* directory to sys.path (GH-6231)Nick Coghlan2018-03-251-4/+7
| | | | | | | | | | | | Historically, -m added the empty string as sys.path zero, meaning it resolved imports against the current working directory, the same way -c and the interactive prompt do. This changes the sys.path initialisation to add the *starting* working directory as sys.path[0] instead, such that changes to the working directory while the program is running will have no effect on imports when using the -m switch.
* bpo-32932: More revealing error message when non-str objects in __all__ ↵Xiang Zhang2018-03-241-0/+21
| | | | (GH-5848)
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bpo-31492: Fix assertion failures in case of a module with a bad __name__ ↵Oren Milman2017-09-191-0/+12
| | | | attribute. (#3620)
* bpo-31286, bpo-30024: Fixed stack usage in absolute imports with (#3217)Serhiy Storchaka2017-08-291-0/+17
| | | binding a submodule to a name.
* bpo-30876: Relative import from unloaded package now reimports the package ↵Serhiy Storchaka2017-07-123-3/+21
| | | | | | | | | (#2639) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
* bpo-30814: Fixed a race condition when import a submodule from a package. ↵Serhiy Storchaka2017-07-063-0/+30
| | | | (#2580)
* Fix skipping test_UNC_path on AppVeyor due to a different error being raised ↵Segev Finer2017-06-021-1/+1
| | | | | | (#1920) We get `ERROR_BAD_NETPATH` (53) on AppVeyor which is translated to ENOENT (2).
* bpo-30024: Circular imports involving absolute imports with binding (#1264)Serhiy Storchaka2017-05-093-0/+8
| | | a submodule to a name are now supported.
* bpo-29693: Fix for DeprecationWarning in test_import (#421)Anish Shah2017-03-031-2/+2
| | | Patch by Anish Shah.
* use select instead of _opcode for import test (#372)Benjamin Peterson2017-03-011-5/+5
|
* weaken test_from_import_missing_attr_has_name_and_path regular expression (#371)Benjamin Peterson2017-03-011-1/+1
| | | Windows uses backslashes for separators.
* bpo-29546: Improve from-import error message with location (#103)Matthias Bussonnier2017-02-221-1/+13
| | | | bpo-29546: Improve from-import error message with location
* bpo-29546: Set 'path' on ImportError for ``from ... import ...`` (GH-91)Matthias Bussonnier2017-02-151-0/+19
|
* Remove unused imports.Serhiy Storchaka2016-12-161-1/+0
|
* Issue #15767: Use ModuleNotFoundError.Eric Snow2016-09-071-0/+12
|
* Issue #26583: Skip test_timestamp_overflow in test_import if bytecodeNed Deily2016-03-171-0/+1
| | | | files cannot be written.
* Issue #24492: make sure that ``from ... import ...` raises anBrett Cannon2015-08-121-0/+13
| | | | | | ImportError if __name__ is not defined on a package. Thanks to Armin Rigo for the bug report and diagnosing the cause.