Skip to content

Commit 2414de2

Browse files
committed
[GR-23295] Make test_enum pass
PullRequest: graalpython/1417
2 parents 1bfb5b8 + 2cc1667 commit 2414de2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_enum.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*graalpython.lib-python.3.test.test_enum.MiscTestCase.test__all__
12
*graalpython.lib-python.3.test.test_enum.TestEmptyAndNonLatinStrings.test_empty_string
23
*graalpython.lib-python.3.test.test_enum.TestEmptyAndNonLatinStrings.test_non_latin_character_string
34
*graalpython.lib-python.3.test.test_enum.TestEmptyAndNonLatinStrings.test_non_latin_number_string
@@ -79,6 +80,8 @@
7980
*graalpython.lib-python.3.test.test_enum.TestEnum.test_pickle_enum
8081
*graalpython.lib-python.3.test.test_enum.TestEnum.test_pickle_enum_function
8182
*graalpython.lib-python.3.test.test_enum.TestEnum.test_pickle_enum_function_with_module
83+
*graalpython.lib-python.3.test.test_enum.TestEnum.test_pickle_float
84+
*graalpython.lib-python.3.test.test_enum.TestEnum.test_pickle_int
8285
*graalpython.lib-python.3.test.test_enum.TestEnum.test_programmatic_function_from_dict
8386
*graalpython.lib-python.3.test.test_enum.TestEnum.test_programmatic_function_iterable
8487
*graalpython.lib-python.3.test.test_enum.TestEnum.test_programmatic_function_string
@@ -102,6 +105,7 @@
102105
*graalpython.lib-python.3.test.test_enum.TestEnum.test_subclasses_without_direct_pickle_support
103106
*graalpython.lib-python.3.test.test_enum.TestEnum.test_subclasses_without_direct_pickle_support_using_name
104107
*graalpython.lib-python.3.test.test_enum.TestEnum.test_subclassing
108+
*graalpython.lib-python.3.test.test_enum.TestEnum.test_tuple_subclass
105109
*graalpython.lib-python.3.test.test_enum.TestEnum.test_value_name
106110
*graalpython.lib-python.3.test.test_enum.TestEnum.test_wrong_enum_in_call
107111
*graalpython.lib-python.3.test.test_enum.TestEnum.test_wrong_enum_in_mixed_call
@@ -131,7 +135,10 @@
131135
*graalpython.lib-python.3.test.test_enum.TestHelpers.test_is_descriptor
132136
*graalpython.lib-python.3.test.test_enum.TestHelpers.test_is_dunder
133137
*graalpython.lib-python.3.test.test_enum.TestHelpers.test_is_sunder
138+
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert
134139
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert_raise
140+
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert_value_lookup_priority
141+
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert_warn
135142
*graalpython.lib-python.3.test.test_enum.TestIntFlag.test_and
136143
*graalpython.lib-python.3.test.test_enum.TestIntFlag.test_bool
137144
*graalpython.lib-python.3.test.test_enum.TestIntFlag.test_contains

graalpython/lib-python/3/test/test_enum.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,19 +2970,21 @@ def test__all__(self):
29702970

29712971
class TestIntEnumConvert(unittest.TestCase):
29722972
def test_convert_value_lookup_priority(self):
2973+
# Graalpython change: the test hardcoded test module FQDN which is different under our runner, use __name__
29732974
test_type = enum.IntEnum._convert_(
29742975
'UnittestConvert',
2975-
('test.test_enum', '__main__')[__name__=='__main__'],
2976+
__name__,
29762977
filter=lambda x: x.startswith('CONVERT_TEST_'))
29772978
# We don't want the reverse lookup value to vary when there are
29782979
# multiple possible names for a given value. It should always
29792980
# report the first lexigraphical name in that case.
29802981
self.assertEqual(test_type(5).name, 'CONVERT_TEST_NAME_A')
29812982

29822983
def test_convert(self):
2984+
# Graalpython change: the test hardcoded test module FQDN which is different under our runner, use __name__
29832985
test_type = enum.IntEnum._convert_(
29842986
'UnittestConvert',
2985-
('test.test_enum', '__main__')[__name__=='__main__'],
2987+
__name__,
29862988
filter=lambda x: x.startswith('CONVERT_TEST_'))
29872989
# Ensure that test_type has all of the desired names and values.
29882990
self.assertEqual(test_type.CONVERT_TEST_NAME_F,
@@ -3000,9 +3002,10 @@ def test_convert(self):
30003002
'_convert was deprecated in 3.8')
30013003
def test_convert_warn(self):
30023004
with self.assertWarns(DeprecationWarning):
3005+
# Graalpython change: the test hardcoded test module FQDN which is different under our runner, use __name__
30033006
enum.IntEnum._convert(
30043007
'UnittestConvert',
3005-
('test.test_enum', '__main__')[__name__=='__main__'],
3008+
__name__,
30063009
filter=lambda x: x.startswith('CONVERT_TEST_'))
30073010

30083011
@unittest.skipUnless(sys.version_info >= (3, 9),

0 commit comments

Comments
 (0)