Skip to content

Update test.support from CPython 3.11.2 #4537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 24, 2023

Conversation

@@ -57,6 +57,8 @@ def test_import_module(self):
self.assertRaises(unittest.SkipTest,
import_helper.import_module, "foo")

# TODO: RUSTPYTHON
@unittest.expectedFailure
Copy link
Member Author

Choose a reason for hiding this comment

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

broken due to #4540

@@ -320,6 +325,8 @@ def test_check_syntax_error(self):
with self.assertRaises(AssertionError):
support.check_syntax_error(self, "x=1")

# TODO: RUSTPYTHON
@unittest.expectedFailure
Copy link
Member Author

Choose a reason for hiding this comment

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

broken due to #4540

@youknowone youknowone force-pushed the lib-support branch 2 times, most recently from 5ad9566 to 3e50134 Compare February 23, 2023 10:43
@youknowone youknowone marked this pull request as ready for review February 23, 2023 10:43
Comment on lines 702 to 706
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_has_strftime_extensions(self):
if support.is_emscripten or sys.platform == "win32":
self.assertFalse(support.has_strftime_extensions)
else:
self.assertTrue(support.has_strftime_extensions)
Copy link
Contributor

Choose a reason for hiding this comment

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

support.has_strftime_extensions will always be False when sys.platform == "win32".

I suggest using the os-dependent version:

def test_whatever(self):
    ...

# TODO: RUSTPYTHON
if sys.platform != "win32":
    # TODO: RUSTPYTHON
    test_whatever = unittest.expectedFailure(test_whatever)

Comment on lines +546 to +553
# Does strftime() support glibc extension like '%4Y'?
has_strftime_extensions = False
if sys.platform != "win32":
# bpo-47037: Windows debug builds crash with "Debug Assertion Failed"
try:
has_strftime_extensions = time.strftime("%4Y") != "%4Y"
except ValueError:
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

@itsankitkp This is probably what I was looking for in #4474.

@@ -1364,7 +1456,7 @@ def skip_if_buggy_ucrt_strfptime(test):
global _buggy_ucrt
if _buggy_ucrt is None:
if(sys.platform == 'win32' and
locale.getdefaultlocale()[1] == 'cp65001' and
locale.getencoding() == 'cp65001' and
Copy link
Contributor

Choose a reason for hiding this comment

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

This is blocked on #4155.

@youknowone youknowone requested a review from fanninpm February 23, 2023 17:41
Copy link
Contributor

@fanninpm fanninpm left a comment

Choose a reason for hiding this comment

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

LGTM.

@youknowone youknowone merged commit cfc2e3e into RustPython:main Feb 24, 2023
@youknowone youknowone deleted the lib-support branch February 24, 2023 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants