106 Commits

Author SHA1 Message Date
Shahar Naveh
a781980d9b Update importlib to 3.14.5 (#8013) 2026-06-02 18:06:36 +09:00
Jeong, YunWon
53ddc7ef48 Remove expectedFailure for encoding tests now passing
Remove @unittest.expectedFailure decorators from:
- test_source_encoding: test_encoding_on_first_line, test_encoding_on_second_line, test_bom_conflict
- test_runpy: test_encoding
2026-03-03 21:27:11 +09:00
fanninpm
919a14623d Remove test_importlib from polluters (#7279) 2026-03-01 10:58:47 +09:00
Jeong, YunWon
470bd5990b Fix test_import: import machinery, circular imports, and script shadowing (#7034)
* Fix test_import: import machinery and errors

- Emit IMPORT_FROM instead of LOAD_ATTR for `import a.b.c as m`
- Add "partially initialized module" error for circular imports
- Add "cannot access submodule" error for initializing submodules
- Implement script shadowing detection with "consider renaming" hint
  - Detect user scripts shadowing stdlib/third-party modules
  - Compute original sys.path[0] from sys.argv[0]
  - Check sys.stdlib_module_names for stdlib detection
  - Respect safe_path setting
- Implement _imp._fix_co_filename for code source_path rewriting
- Add data parameter to _imp.get_frozen_object with marshal deser
- Fix import_from: check __spec__.has_location before using origin
- Set ImportError.path attribute on import failures
- Fix import_star error messages for non-str __all__/__dict__ items
- Always call builtins.__import__ in import_inner

* Propagate __bool__ errors from fromlist in import

Previously, try_to_bool errors were silently swallowed via .ok(),
causing fromlist with broken __bool__ to default to false.
2026-02-09 01:40:26 +09:00
Jeong, YunWon
bcc5cf30ac impl more importlib 2026-02-05 00:21:34 +09:00
CPython Developers
afdf8cefe8 Update importlib from v3.14.2 2026-02-05 00:21:34 +09:00
Copilot
f8d4d991f1 Upgrade zipimport to Python 3.14.2 (#6857) 2026-01-24 16:11:36 +09:00
Jeong, YunWon
97167ab1cc Instruction 3.14 (#6805)
* renumber enum Instruction

* renumber magic

* Update test__opcode from 3.14.2

---------

Co-authored-by: CPython Devleopers <>
2026-01-20 03:52:52 +09:00
Jeong, YunWon
b76906a8bf Add sys._stdlib_dir (#6798) 2026-01-20 03:38:40 +09:00
Jeong, YunWon
6616961d08 skip flaky tests (#6764) 2026-01-18 11:16:25 +09:00
Terry Tianlin Luan
609dbb1439 Downgraded skips in tests (#6716)
* Downgraded skips in tests

* Fixed failing tests

* Fixed test_ftplib + test_socket + test_ssl + test_threaded_import failures

* Removed comments about which tests are run in which environment

* Addressed PR comments

* Annotated skips on failing tests

* Removed unneeded tests

* Removed unneeded sys import from test_ftplib

* Added annotation to test_ftplib

* Readded skipIf to test_cleanup_with_symlink_modes with a more general ENV_POLLUTING_TESTS_WINDOWS

* Addressed PR comments

* Made changes to minimize diff in PR

* Apply suggestion from @youknowone

---------

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-01-15 21:43:22 +09:00
Jeong, YunWon
69601a18a4 Upgrade threading to 3.13.11; sys.setprofile & impl more threading (#6691)
* Upgrade threading,test_threading from 3.13.11

* increase ci limit to 45mins

* impl more threading

* no static for asyncgen
2026-01-12 15:33:28 +09:00
Padraic Fanning
1827af100b Skip tests that pollute the environment for some reason 2026-01-10 22:10:35 -05:00
Jeong, YunWon
eee360822c Rework compiler about exception handling (#6638)
* asyncgen

* fix coroutine

* rewrite compiler

* tests

* set pyc magic number
2026-01-04 09:15:38 +09:00
Jeong, YunWon
546d35b8c1 impl multiprocessing SemLock (#6542) 2026-01-03 00:14:43 +09:00
Jeong, YunWon
75ecd72428 test_builtin.test_import (#6546)
* fix warnings

* fix test_import
2025-12-27 21:38:12 +09:00
Jeong, YunWon
7f4d308efc Implement maybe_pyc_file and .pyc file execution (#6539)
* Implement maybe_pyc_file and .pyc file execution

* unmark failing tests
2025-12-26 22:13:00 +09:00
fanninpm
3473d824a8 Replace skips in test_importlib/source/test_file_loader with expectedFailures (#6194)
* Replace skips with expectedFailure markings for SimpleTest

* Uncomment Source-PEP451 tests and apply similar monkey-patches as before

* Uncomment Source-PEP302 tests and apply similar monkey-patches as before

* Uncomment Sourceless-PEP451 tests and apply similar monkey-patches as
before

* Uncomment Sourceless-PEP302 tests and apply similar monkey-patches as
before
2025-10-20 17:32:05 +09:00
Jiseok CHOI
ff35dcd95a feat(vm/slot): implement Py_TPFLAGS_MANAGED_DICT for class objects (#5949) 2025-07-20 14:11:36 +09:00
Jiseok CHOI
bd8e557b70 test(importlib): Enable bad bytecode tests for PEP451 loaders (#5997) 2025-07-19 12:16:19 +09:00
Ashwin Naren
b4f0a589ed platform-dependent Windows testing (#5536)
* disable test_argparse on windows

* fix test_exceptions and mark it as platform dependent

* test importlib on windows

* explain why windows tests fail

* mark test_argparse as non platform-independent

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-02-23 09:48:02 +09:00
Noa
fbd0c7a99e Implement IncrementalNewlineDecoder in rust 2024-11-14 23:06:53 -06:00
Moreal
959e7c11ce Unmark fixed tests 2024-04-15 16:22:53 +09:00
Jeong, YunWon
af884cb284 First step for Python 3.12 support (#5078)
* Mark 3.12

* Update importlib from Python 3.12.0

* Update test_importlib from Python3.12

* Mark failings tests from importlib

* Update test.support from Python3.12

* Fix unsupported parser feature

* mark failing test

* Update functools from Python 3.12

* manual type annotation

* slice behavior changed in 3.12

* empty unittest.main returns non-zero

* test_decimal from CPython 3.12

* Mark failing tests

* Update test_unicode from CPython 3.12

* Update test_functools from Python 3.12

* Update enum from Python 3.12

* enum

* Doc format changed

* Update test_module from CPython

---------

Co-authored-by: CPython developers <>
2023-10-22 19:19:05 -07:00
Ankit Kumar Pandey
f0db8329be rename os module's exit function to _exit as thats how it is defined in cpython (#4887) 2023-04-22 05:22:18 +09:00
Jeong YunWon
367a948ff0 Adapt unittest.expectedFailureIf 2023-03-02 04:41:15 +09:00
Jeong YunWon
7492b46c43 mark success/fail tests for test_import 2023-02-25 22:59:57 +09:00
CPython Developers
496006d629 Update importlib from CPython 3.11.2 2023-02-25 22:59:57 +09:00
yt2b
253fcfb6c4 Remove the decorators 2022-12-25 13:29:33 +09:00
Jeong YunWon
9a40c87dbd mark hanging/failing tests 2022-08-18 03:22:20 +09:00
Jeong YunWon
47dbafe7d3 @writes_bytecode_files to skip
https://github.com/python/cpython/pull/95972
2022-08-18 03:22:20 +09:00
CPython Developers
da109336bb Update importlib/test_importlib from CPython 3.10.6 2022-08-18 03:22:20 +09:00
Jeong YunWon
3efa141378 change partial failing markers to skip in test_importlib 2022-08-15 20:09:34 +09:00
Padraic Fanning
c8748bc98e Fix test.support imports 2022-02-13 17:56:08 -05:00
Dean Li
6f98288e84 test: use import_helper 2021-11-29 21:03:02 +08:00
Dean Li
cad10fedd4 test: update importlib 2021-11-28 20:51:34 +08:00
Dean Li
5ee4fb899b test: use os_helper 2021-11-28 20:51:32 +08:00
Jeong YunWon
913b78ca44 Revert "Merge pull request #3433 from deantvv/test-update"
This reverts commit 9fa5c5ac66, reversing
changes made to e7fa32c687.
2021-11-17 17:06:51 +09:00
Dean Li
a1202f5602 test: update importlib 2021-11-13 14:21:59 +08:00
Dean Li
49a5805d11 test: use os_helper 2021-11-13 02:18:33 +00:00
Dean Li
a59556ad25 Refactor OSError
Implement `raw_os_error_to_exc_type` to reduce duplication of errno to
exception type.
2021-10-30 17:05:54 +08:00
Padraic Fanning
bab6f75016 Clean up skips in test_importlib.source 2021-10-18 21:56:47 -04:00
Padraic Fanning
5d4faf0ccf Skip tests that sometimes hang the CI
Tested with `act`.
2021-08-19 00:42:35 +09:00
Padraic Fanning
44d10c7e1e Skip flaky test in test_importlib/test_locks 2021-07-10 19:21:08 -04:00
Noah
c2d4d7380a Unskip tests 2021-05-13 19:46:17 -05:00
Noah
501c555c54 Unskip tests 2021-04-11 17:38:44 -05:00
Padraic Fanning
18491e7bb8 Unskip tests in test_importlib.test_util
WARNING: Contains a monkeypatch to accomodate differential testing
behavior.
2021-02-25 20:18:39 -05:00
Padraic Fanning
febed3b28c Unskip tests in test_importlib.test_read 2021-02-25 17:38:37 -05:00
Padraic Fanning
e51699d9ee Unskip tests in test_importlib.test_open 2021-02-25 17:37:34 -05:00
Padraic Fanning
b8a9f5509c Unskip tests in test_importlib.test_lazy 2021-02-25 17:36:07 -05:00