23 Commits

Author SHA1 Message Date
Shahar Naveh
48ad238349 Update some tests to 3.14.5 (#7909)
* Align patches for `test_class.py`

* Update more tests to 3.14.5

* Update `test_math`

* `test_hash.py`

* Update `test_grammar.py`

* Fix failing test

* Restore `test_grammar.py`
2026-05-19 13:31:33 +09:00
Alok Pandey
f90a5cf650 Fix del obj.__dict__ to match CPython behavior (fixes #5355) (#7568)
* Fix del obj.__dict__ to match CPython behavior (issue #5355)

* Address CodeRabbit concerns: fix GC clearing and improve thread safety of lazy __dict__ recreation

* Fix del obj.__dict__: improve GC safety, implement lazy re-creation in setattr, and enable passing CPython tests

* Restore expectedFailure for test_has_inline_values

* Fix ObjExt::new call site to include has_dict parameter

* Remove stray test.py to avoid CI syntax errors

* Remove debug txt files and clean test_class.py comments

* Delete Lib/test/test_class.py

* Restore test_class.py with correct changes (remove expectedFailure, no deletion)

* Fix clippy warnings: remove unused into_inner, collapse nested if-let

* Fix rustfmt formatting and ruff PEP 8 E302 blank line

* Align __dict__ error messages and ensure safety for function/partial objects

* Fix compilation errors: change &self to &Py<Self> in __dict__ methods

* Fix compilation errors: resolve borrow-after-move and replace transpose on PySetterValue

- type.rs: Replace invalid .transpose() on PySetterValue with explicit
  match on Assign/Delete variants in subtype_set_dict
- function.rs: Fix borrow-after-move in set___dict__ by capturing class
  name before downcast; use as_object() for instance_dict/set_dict calls
- _functools.rs: Same borrow-after-move fix and as_object() calls for
  PyPartial's __dict__ getter/setter

* Fix compilation errors: resolve borrow-after-move and replace transpose on PySetterValue

* Fix snippet formatting and mark test_remote as expected failure

* Fix test_remote by removing HAS_DICT flag from function type

* Fix lint formatting error

* Remove unnecessary print statement in test_del_dict

* Fix trailing newlines in snippet test

* Trigger CI

* Align __dict__ generic setter behavior

* Move __dict__ deletion tests to relevant snippets

---------

Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
2026-04-30 02:09:16 +00:00
Jeong, YunWon
8be5230a9b Fix allow_threads and EINTR handling (#7457)
* Fix allow_threads and EINTR handling

- Wrap Windows SemLock acquire wait with allow_threads
- Retry nanosleep on EINTR with remaining time instead of
  returning early
- Remove expectedFailure for test_sleep in _test_eintr.py

* Remove expectedFailureIfWindows for testHashComparisonOfMethods
2026-03-20 19:59:13 +09:00
Shahar Naveh
f2765982cd Remove some tests from PLATFORM_INDEPENDENT_TESTS (#7459)
* Remove some platform dependent tests

* Mark failing tests
2026-03-18 21:55:56 +09:00
Lee Dogeon
adf9aea274 Fix object.__init__ excess-arg checks for heap types (#7116) 2026-02-14 19:56:49 +09:00
Shahar Naveh
51701ab2a4 Update class related tests from 3.14.2 (#6900)
* Update `test_class` from 3.14.2

* Update test_genericclass

* Update test_subclassinit

* Add test_metaclass

* Patch `test_class`

* Patch test_subclassinit

* Patch `test_metaclass`

----

Co-authored-by: CPython Developers <>
2026-01-30 22:38:49 +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
0717d5a331 remove wrong cpython_only tag 2025-03-20 14:35:04 +09:00
a9bfaa96c5 remove unnecessary cpython_only 2025-03-20 14:35:04 +09:00
2d3b125d51 Add expectedFailure and skip decorators for RUSTPYTHON tests in test_class.py 2025-03-20 14:35:04 +09:00
4081c08b5a add cpython_only tag for tests required _testlimitedcapi 2025-03-20 14:35:04 +09:00
70c36a48a8 Copy test_class.py from cpython v3.13.2 2025-03-20 14:35:04 +09:00
hydrogen602
27a52a7962 test_class.py: testTypeAttributeAccessErrorMessages fix 2024-05-13 16:25:37 +09:00
Jonathan Rotter
6a7be1e142 compat fix for testHashStuff in test_class.py (#5240)
* compat fix for testHashStuff in test_class.py

* accidently fixed 3 more tests
2024-04-19 16:44:23 +09:00
NakanoMiku
e06f5ccfe4 Update Lib/test/test_class.py from CPython v3.12.0 2023-11-23 16:31:27 +08:00
Andrey Maltsev
6c6290d20f Update test_class from Cpython v3.11.2 (#4800)
* Update test_class from Cpython v3.11.2
2023-04-04 10:34:06 +03:00
CPython developers
33690be35b Update tests from CPython 3.10.5 2022-07-18 04:07:35 +09:00
Robert Booth
af6b230dad Change int type checking, amend tests
- add a special_retrieve fudge function to the PyValue trait
- define the special_retrieve function for PyInt
- remove blocks on successful tests to reflect effect of changes
2021-04-25 01:18:57 +09:00
Padraic Fanning
cbe24fa406 Explain testSFBug532646 skip 2021-02-07 15:49:41 -05:00
Jeong YunWon
0aa138817c unskip test_class.py 2020-11-12 11:30:33 +09:00
Jeong YunWon
8d79b0667f skip randomly successful test_class.testHashComparisonOfMethods 2020-09-21 08:30:13 +09:00
Aviv Palivoda
1d29858c04 Mark unsupported tests 2020-02-22 14:25:25 +02:00
Aviv Palivoda
1129c9d59a Add test_class from CPython 3.8 2020-02-22 14:25:03 +02:00