Skip to content

Commit 8558f2e

Browse files
committed
Fix hardcoded test module name
1 parent 1bfb5b8 commit 8558f2e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@
131131
*graalpython.lib-python.3.test.test_enum.TestHelpers.test_is_descriptor
132132
*graalpython.lib-python.3.test.test_enum.TestHelpers.test_is_dunder
133133
*graalpython.lib-python.3.test.test_enum.TestHelpers.test_is_sunder
134+
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert
134135
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert_raise
136+
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert_value_lookup_priority
137+
*graalpython.lib-python.3.test.test_enum.TestIntEnumConvert.test_convert_warn
135138
*graalpython.lib-python.3.test.test_enum.TestIntFlag.test_and
136139
*graalpython.lib-python.3.test.test_enum.TestIntFlag.test_bool
137140
*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)