Skip to content

Commit 2ccc403

Browse files
skirpichevvstinner
andauthored
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 5105ce2 commit 2ccc403

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

Lib/test/test_builtin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2991,7 +2991,7 @@ def test_namespace_order(self):
29912991

29922992
def load_tests(loader, tests, pattern):
29932993
from doctest import DocTestSuite
2994-
if getattr(sys, 'float_repr_style', '') == 'short':
2994+
if sys.float_repr_style == 'short':
29952995
tests.addTest(DocTestSuite(builtins))
29962996
return tests
29972997

Lib/test/test_enum.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def load_tests(loader, tests, ignore):
3636
optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE,
3737
))
3838
howto_tests = os.path.join(REPO_ROOT, 'Doc/howto/enum.rst')
39-
if (os.path.exists(howto_tests)
40-
and getattr(sys, 'float_repr_style', '') == 'short'):
39+
if os.path.exists(howto_tests) and sys.float_repr_style == 'short':
4140
tests.addTests(doctest.DocFileSuite(
4241
howto_tests,
4342
module_relative=False,

Lib/test/test_float.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ def test_format(self):
795795
self.assertRaises(ValueError, format, x, '.6,n')
796796

797797
@support.requires_IEEE_754
798-
@unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
798+
@unittest.skipUnless(sys.float_repr_style == 'short',
799799
"applies only when using short float repr style")
800800
def test_format_testfile(self):
801801
with open(format_testfile, encoding="utf-8") as testfile:

Lib/test/test_statistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3319,7 +3319,7 @@ def tearDown(self):
33193319
def load_tests(loader, tests, ignore):
33203320
"""Used for doctest/unittest integration."""
33213321
tests.addTests(doctest.DocTestSuite())
3322-
if getattr(sys, 'float_repr_style', '') == 'short':
3322+
if sys.float_repr_style == 'short':
33233323
tests.addTests(doctest.DocTestSuite(statistics))
33243324
return tests
33253325

0 commit comments

Comments
 (0)