Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change recursion tests and disabled it at the root
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
  • Loading branch information
arihant2math committed Feb 17, 2025
commit 5339f299a1417818868baa29b2dd1349a63c6c02
3 changes: 2 additions & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,8 @@ def infinite_recursion(max_depth=None):
# Pick a number large enough to cause problems
# but not take too long for code that can handle
# very deep recursion.
max_depth = 20_000
# TODO: RUSTPYTHON: Fix this function
max_depth = 50
elif max_depth < 3:
raise ValueError("max_depth must be at least 3, got {max_depth}")
depth = get_recursion_depth()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_faulthandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def test_dump_ext_modules(self):
self.assertIn(name, modules)

# TODO: RUSTPYTHON, AttributeError: module 'faulthandler' has no attribute 'is_enabled'
@unittest.expectedFailure
@unittest.skip("TODO: RUSTPYTHOn")
def test_is_enabled(self):
orig_stderr = sys.stderr
try:
Expand Down
12 changes: 0 additions & 12 deletions Lib/test/test_isinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,12 @@ def test_subclass_tuple(self):
self.assertEqual(True, issubclass(int, (int, (float, int))))
self.assertEqual(True, issubclass(str, (str, (Child, str))))

# TODO: RUSTPYTHON
@unittest.skip("RustPython stackoverflow")
def test_subclass_recursion_limit(self):
# make sure that issubclass raises RecursionError before the C stack is
# blown
with support.infinite_recursion():
self.assertRaises(RecursionError, blowstack, issubclass, str, str)

# TODO: RUSTPYTHON
@unittest.skip("RustPython stackoverflow")
def test_isinstance_recursion_limit(self):
# make sure that issubclass raises RecursionError before the C stack is
# blown
Expand Down Expand Up @@ -310,8 +306,6 @@ def __bases__(self):

self.assertEqual(True, issubclass(B(), int))

# TODO: RUSTPYTHON
@unittest.skip("RustPython stackoverflow")
def test_infinite_recursion_in_bases(self):
class X:
@property
Expand All @@ -322,8 +316,6 @@ def __bases__(self):
self.assertRaises(RecursionError, issubclass, int, X())
self.assertRaises(RecursionError, isinstance, 1, X())

# TODO: RUSTPYTHON
@unittest.skip("RustPython stackoverflow")
def test_infinite_recursion_via_bases_tuple(self):
"""Regression test for bpo-30570."""
class Failure(object):
Expand All @@ -333,8 +325,6 @@ def __getattr__(self, attr):
with self.assertRaises(RecursionError):
issubclass(Failure(), int)

# TODO: RUSTPYTHON
@unittest.skip("RustPython stackoverflow")
def test_infinite_cycle_in_bases(self):
"""Regression test for bpo-30570."""
class X:
Expand All @@ -344,8 +334,6 @@ def __bases__(self):
with support.infinite_recursion():
self.assertRaises(RecursionError, issubclass, X(), int)

# TODO: RUSTPYTHON
@unittest.skip("RustPython stackoverflow")
def test_infinitely_many_bases(self):
"""Regression test for bpo-30570."""
class X:
Expand Down