Skip to content

Commit 970153b

Browse files
committed
Fix tests on Windows.
1 parent ec57918 commit 970153b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/test/test_atexit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ def start_thread():
9999

100100
return_code, stdout, stderr = script_helper.assert_python_ok("-c", textwrap.dedent(source))
101101
self.assertEqual(return_code, 0)
102+
end = "\r\n" if os.name == "nt" else "\n"
103+
self.assertEqual(stdout, f"24{end}42{end}".encode("utf-8"))
102104
self.assertEqual(stderr, b"")
103-
self.assertEqual(stdout, b"24\n42\n")
104105

105106

106107
@support.cpython_only

Lib/test/test_capi/test_misc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,8 @@ def create_pending_call():
16691669
"""
16701670
return_code, stdout, stderr = script_helper.assert_python_ok('-c', textwrap.dedent(source))
16711671
self.assertEqual(return_code, 0)
1672-
self.assertEqual(stdout, b"24\n42\n")
1672+
end = "\r\n" if os.name == "nt" else "\n"
1673+
self.assertEqual(stdout, f"24{end}42{end}".encode("utf-8"))
16731674
self.assertEqual(stderr, b"")
16741675

16751676

0 commit comments

Comments
 (0)