Skip to content
Merged
Show file tree
Hide file tree
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
Address vstinner review comments.
  • Loading branch information
bitdancer committed Mar 17, 2025
commit ef36eb23235d235da4e1f36ab722e71aeb32643f
2 changes: 1 addition & 1 deletion Doc/library/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ The :mod:`test.support` module defines the following functions:
``musl``, otherwise return a version triple, either ``(0, 0, 0)`` if the
version is unknown, or the actual version if it is known. Intended for use
in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be
compiled with ``musl``; othewise ``platform.libc_ver`` is checked.
compiled with ``musl``; otherwise ``platform.libc_ver`` is checked.


.. function:: check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None)
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -2772,8 +2772,8 @@ def test_fma_infinities(self):
or (sys.platform == "android" and platform.machine() == "x86_64")
or support.linked_to_musl(), # gh-131032
f"this platform doesn't implement IEE 754-2008 properly")
# XXX musl is fixed but the fix is not yet released; when the fixed version
# is known change this to:
# gh-131032: musl is fixed but the fix is not yet released; when the fixed
# version is known change this to:
# or support.linked_to_musl() < (1, <m>, <p>)
def test_fma_zero_result(self):
nonnegative_finites = [0.0, 1e-300, 2.3, 1e300]
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,7 @@ def test_fpathconf(self):
support.linked_to_musl(),
'musl pathconf ignores the file descriptor and returns a constant',
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
)
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I prefer the style I used because it lines up better with how python's statements work (first line only is outdented, lack of outdent signals return to outer logic block). This is accepted by PEP 8, are there additional style constrains on the cpython code base these days?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven't seen lots of use of hanging indents in the lib. There is no additional constraints but usually we try to be consistent with the surrounding code when possible.

def test_fpathconf_with_bad_fd(self):
def test_fpathconf_bad_fd(self):
self.check(os.pathconf, "PC_NAME_MAX")
self.check(os.fpathconf, "PC_NAME_MAX")

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,10 @@ def test_get_signal_name(self):
def test_linked_to_musl(self):
linked = support.linked_to_musl()
self.assertIsNotNone(linked)
if support.is_wasi:
if support.is_wasi or support.is_emscripten:
self.assertTrue(linked)
# The value is cached, so make sure it returns the same value again.
self.assertEqual(linked, support.linked_to_musl())
self.assertIs(linked, support.linked_to_musl())
# The unlike libc, the musl version is a triple.
if linked:
self.assertIsInstance(linked, tuple)
Expand Down
Loading