Skip to content
Merged
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
Override test methods instead of skipping them
  • Loading branch information
ShaharNaveh committed Jul 11, 2025
commit a3ae24ef4f3aecd28498f92de5659eed0b10e34e
27 changes: 15 additions & 12 deletions Lib/test/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,6 @@ def test_dunder_is_original(self):

@support.requires_docstrings
def test_attrgetter_signature(self):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to mark those signature tests with unittest.expectedFailure but then the test fails on "UNEXPECTED SUCCESS", very strange.

I have tried to mess with defining __text_signature__ but I'm guessing that I'm doing something wrong because it completely ignores it. I would appreciate any suggestion that you have:)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is a base class of multiple other tests

# TODO: RUSTPYTHON fails only when running inside COperatorTestCase
if type(self).__name__ == 'COperatorTestCase':
self.skipTest("TODO: RUSTPYTHON")

operator = self.module
sig = inspect.signature(operator.attrgetter)
self.assertEqual(str(sig), '(attr, /, *attrs)')
Expand All @@ -617,10 +613,6 @@ def test_attrgetter_signature(self):

@support.requires_docstrings
def test_itemgetter_signature(self):
# TODO: RUSTPYTHON fails only when running inside COperatorTestCase
if type(self).__name__ == 'COperatorTestCase':
self.skipTest("TODO: RUSTPYTHON")

operator = self.module
sig = inspect.signature(operator.itemgetter)
self.assertEqual(str(sig), '(item, /, *items)')
Expand All @@ -629,10 +621,6 @@ def test_itemgetter_signature(self):

@support.requires_docstrings
def test_methodcaller_signature(self):
# TODO: RUSTPYTHON fails only when running inside COperatorTestCase
if type(self).__name__ == 'COperatorTestCase':
self.skipTest("TODO: RUSTPYTHON")

operator = self.module
sig = inspect.signature(operator.methodcaller)
self.assertEqual(str(sig), '(name, /, *args, **kwargs)')
Expand All @@ -647,6 +635,21 @@ class PyOperatorTestCase(OperatorTestCase, unittest.TestCase):
class COperatorTestCase(OperatorTestCase, unittest.TestCase):
module = c_operator

#TODO: RUSTPYTHON
@unittest.expectedFailure
def test_attrgetter_signature(self):
super().test_attrgetter_signature()

#TODO: RUSTPYTHON
@unittest.expectedFailure
def test_itemgetter_signature(self):
super().test_itemgetter_signature()

#TODO: RUSTPYTHON
@unittest.expectedFailure
def test_methodcaller_signature(self):
super().test_methodcaller_signature()


class OperatorPickleTestCase:
def copy(self, obj, proto):
Expand Down
Loading