Skip to content

Commit 93b20c4

Browse files
committed
Fix tests for Python 3.15
1 parent ce3fac9 commit 93b20c4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Bugs fixed
2424
Patch by Adam Turner
2525
* #13713: Fix compatibility with MyST-Parser.
2626
Patch by Adam Turner
27+
* Fix tests for Python 3.15.
28+
Patch by Adam Turner
2729

2830
Testing
2931
-------

tests/test_ext_autosummary/test_ext_autosummary.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
if TYPE_CHECKING:
3333
from xml.etree.ElementTree import Element
3434

35+
if sys.version_info[:2] >= (3, 15):
36+
cached_dunder: tuple[str, ...] = ()
37+
else:
38+
cached_dunder = ('__cached__',)
39+
40+
3541
html_warnfile = StringIO()
3642

3743

@@ -268,7 +274,7 @@ def test_autosummary_generate_content_for_module(app):
268274
'_Exc',
269275
'__all__',
270276
'__builtins__',
271-
'__cached__',
277+
*cached_dunder,
272278
'__doc__',
273279
'__file__',
274280
'__name__',
@@ -377,7 +383,7 @@ def skip_member(app, what, name, obj, skip, options):
377383
'_Exc',
378384
'__all__',
379385
'__builtins__',
380-
'__cached__',
386+
*cached_dunder,
381387
'__doc__',
382388
'__file__',
383389
'__name__',
@@ -424,7 +430,7 @@ def test_autosummary_generate_content_for_module_imported_members(app):
424430
'_Exc',
425431
'__all__',
426432
'__builtins__',
427-
'__cached__',
433+
*cached_dunder,
428434
'__doc__',
429435
'__file__',
430436
'__loader__',
@@ -489,7 +495,7 @@ def test_autosummary_generate_content_for_module_imported_members_inherited_modu
489495
'InheritedAttrClass',
490496
'__all__',
491497
'__builtins__',
492-
'__cached__',
498+
*cached_dunder,
493499
'__doc__',
494500
'__file__',
495501
'__loader__',

0 commit comments

Comments
 (0)