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
fix test_enum
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
  • Loading branch information
arihant2math committed Feb 13, 2025
commit e4528a89dfb8fb4b85892ec7bfcb9d5557977d79
22 changes: 6 additions & 16 deletions Lib/test/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,10 +1369,8 @@ class Inner(Enum):
[Outer.a, Outer.b, Outer.Inner],
)

@unittest.skipIf(
python_version < (3, 13),
'inner classes are still members',
)
# TODO: RUSTPYTHON
@unittest.expectedFailure
Comment thread
arihant2math marked this conversation as resolved.
def test_nested_classes_in_enum_are_not_members(self):
"""Support locally-defined nested classes."""
class Outer(Enum):
Expand Down Expand Up @@ -4555,20 +4553,16 @@ class Color(Enum):
self.assertEqual(Color.green.value, 3)
self.assertEqual(Color.yellow.value, 4)

@unittest.skipIf(
python_version < (3, 13),
'mixed types with auto() will raise in 3.13',
)
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_auto_garbage_fail(self):
with self.assertRaisesRegex(TypeError, 'will require all values to be sortable'):
class Color(Enum):
red = 'red'
blue = auto()

@unittest.skipIf(
python_version < (3, 13),
'mixed types with auto() will raise in 3.13',
)
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_auto_garbage_corrected_fail(self):
with self.assertRaisesRegex(TypeError, 'will require all values to be sortable'):
class Color(Enum):
Expand Down Expand Up @@ -4597,10 +4591,6 @@ def _generate_next_value_(name, start, count, last):
self.assertEqual(Color.red.value, 'pathological case')
self.assertEqual(Color.blue.value, 'blue')

@unittest.skipIf(
python_version < (3, 13),
'auto() will return highest value + 1 in 3.13',
)
def test_auto_with_aliases(self):
class Color(Enum):
red = auto()
Expand Down