Repository navigation
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.9 (EOL)end of lifeend of lifetestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/serhiy-storchaka'
closed_at = None
created_at = <Date 2015-09-15.18:15:24.258>
labels = ['type-feature', 'tests', '3.9', '3.10', '3.11']
title = 'Make tests more PyPy compatible'
updated_at = <Date 2021-09-08.15:09:06.833>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2021-09-08.15:09:06.833>
actor = 'lukasz.langa'
assignee = 'serhiy.storchaka'
closed = False
closed_date = None
closer = None
components = ['Tests']
creation = <Date 2015-09-15.18:15:24.258>
creator = 'serhiy.storchaka'
dependencies = []
files = ['40475', '40481']
hgrepos = []
issue_num = 25130
keywords = ['patch']
message_count = 18.0
messages = ['250789', '250812', '250816', '250824', '250832', '250835', '250836', '389367', '400439', '400492', '400496', '400497', '400519', '400520', '400522', '400523', '400526', '401387']
nosy_count = 9.0
nosy_names = ['terry.reedy', 'Carl.Friedrich.Bolz', 'benjamin.peterson', 'lukasz.langa', 'fijall', 'martin.panter', 'serhiy.storchaka', 'Ronan.Lamy', 'miss-islington']
pr_nums = ['28005', '28002', '28016', '28017', '28021', '28022', '28023', '28027', '28028']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue25130'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.9 (EOL)end of lifeend of lifetestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Activity
serhiy-storchaka commentedon Sep 15, 2015
PyPy includes modified Python 2.7 tests for testing compatibility. Some of changes skips tests for features that are not implemented in PyPy or are CPython specific, some reflects differences between error types or messages in CPython and PyPy, some are needed because PyPy doesn't use reference counting, some are workarounds for known PyPy or CPython bugs. The purpose of this issue is to port harmless non PyPy-specific changes. I'll split full patch on several parts for easier review.
The first patch in a series just adds gc.collect() or test.test_support.gc_collect() calls to force calling destructors or freeing memory.
vadmium commentedon Sep 15, 2015
Left some comments. There are a few test cases that I suspect are relying on side effects of garbage collection to perform some other test, and it would be better to rework the test. In the other cases, I agree that actual garbage collection behaviour is being tested, and it makes sense to call gc_collect() or similar.
serhiy-storchaka commentedon Sep 16, 2015
Thank you for your comments Martin. I need a time to think over them and provide alternative solutions that less depend on garbage collecting. May be Maciej can answer questions about causes of some PyPy changes.
serhiy-storchaka commentedon Sep 16, 2015
Just for reference here is a full difference between 2.7 tests in PyPy and CPython. It makes tests fail in CPython and skips some tests or makes them too lenient.
fijall commentedon Sep 16, 2015
Hi
I can answer precise questions, which tests are you asking about?
Note that if the point is to unify the test suite, would be cool to make changes to both pypy and cpython and not just change cpython one.
vadmium commentedon Sep 16, 2015
Maciej: I put a few questions and comments in the code review. See the <https://bugs.python.org/review/25130/#ps15551\> (also linked next to Serhiy’s first patch).
fijall commentedon Sep 16, 2015
Hi
Looking through your comments, yes, maybe those tests or those things require fixing. We at pypy don't have enough will to fight python-dev most of the time, so the usual approach is to do "minimal hack that works" without trying to dwelve into why this or that works that way. Obviously feel free to fix the underlaying issue, we'll be happy to commit it to pypy
terryjreedy commentedon Mar 23, 2021
With 2.7 EOL, is this still relevant?
serhiy-storchaka commentedon Aug 27, 2021
Unfortunately Martin's comments are not available now, after shutting down the Rietveld service.
Here is a new PR which contains extraction of PyPy changes related to calling gc.collect() for 3.8. I removed changes which look specific for PyPy and left changes which look common for every implementation without reference counting.
serhiy-storchaka commentedon Aug 28, 2021
New changeset eb263f9 by Carl Friedrich Bolz-Tereick in branch 'main':
bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002)
eb263f9
serhiy-storchaka commentedon Aug 28, 2021
New changeset 779b9ae by Miss Islington (bot) in branch '3.10':
bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28016)
779b9ae
serhiy-storchaka commentedon Aug 28, 2021
New changeset 1046cd0 by Serhiy Storchaka in branch '3.9':
[3.9] bpo-25130: Make unit-test about restricting the maximum number of nested blocks cpython-only (GH-28002) (GH-28017)
1046cd0
serhiy-storchaka commentedon Aug 29, 2021
New changeset 07d3d54 by Serhiy Storchaka in branch 'main':
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
07d3d54
miss-islington commentedon Aug 29, 2021
New changeset a49398b by Miss Islington (bot) in branch '3.10':
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
a49398b
serhiy-storchaka commentedon Aug 29, 2021
New changeset dab74d6 by Serhiy Storchaka in branch '3.9':
[3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)
dab74d6
serhiy-storchaka commentedon Aug 29, 2021
New changeset 2a8127c by Serhiy Storchaka in branch 'main':
bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)
2a8127c
serhiy-storchaka commentedon Aug 29, 2021
New changeset 330aabb by Serhiy Storchaka in branch '3.9':
[3.9] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005). (GH-28028)
330aabb
ambv commentedon Sep 8, 2021
New changeset 462c1f0 by Serhiy Storchaka in branch '3.10':
[3.10] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005) (GH-28027)
462c1f0
methane commentedon Sep 15, 2026
Let's close this and continue in #115142