Skip to content

Commit dd5edc3

Browse files
committed
address review: rename decorator
1 parent 6ca94a6 commit dd5edc3

4 files changed

Lines changed: 13 additions & 14 deletions

File tree

Lib/test/support/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"run_no_yield_async_fn", "run_yielding_async_fn", "async_yield",
7474
"reset_code", "on_github_actions",
7575
"requires_root_user", "requires_non_root_user",
76-
"skip_if_have_double_rounding",
76+
"skip_if_double_rounding",
7777
]
7878

7979

@@ -527,10 +527,9 @@ def dec(*args, **kwargs):
527527

528528
# detect evidence of double-rounding:
529529
x, y = 1e16, 2.9999 # use temporary values to defeat peephole optimizer
530-
skip_if_have_double_rounding = unittest.skipIf(x + y == 1e16 + 4,
531-
("accuracy not guaranteed on "
532-
"machines with double "
533-
"rounding"))
530+
skip_if_double_rounding = unittest.skipIf(x + y == 1e16 + 4,
531+
("accuracy not guaranteed on "
532+
"machines with double rounding"))
534533

535534

536535
def requires_zlib(reason='requires zlib'):

Lib/test/test_builtin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from test.support.script_helper import assert_python_ok
4040
from test.support.testcase import ComplexesAreIdenticalMixin
4141
from test.support.warnings_helper import check_warnings
42-
from test.support import requires_IEEE_754, skip_if_have_double_rounding
42+
from test.support import requires_IEEE_754, skip_if_double_rounding
4343
from unittest.mock import MagicMock, patch
4444
try:
4545
import pty, signal
@@ -2230,7 +2230,7 @@ def __getitem__(self, index):
22302230
complex(2, -0.0))
22312231

22322232
@requires_IEEE_754
2233-
@skip_if_have_double_rounding
2233+
@skip_if_double_rounding
22342234
@support.cpython_only # Other implementations may choose a different algorithm
22352235
def test_sum_accuracy(self):
22362236
self.assertEqual(sum([0.1] * 10), 1.0)

Lib/test/test_math.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# XXXX Should not do tests around zero only
33

44
from test.support import (verbose, requires_IEEE_754,
5-
skip_if_have_double_rounding)
5+
skip_if_double_rounding)
66
from test import support
77
import unittest
88
import fractions
@@ -679,7 +679,7 @@ def testfrexp(name, result, expected):
679679
self.assertTrue(math.isnan(math.frexp(NAN)[0]))
680680

681681
@requires_IEEE_754
682-
@skip_if_have_double_rounding
682+
@skip_if_double_rounding
683683
def testFsum(self):
684684
# math.fsum relies on exact rounding for correct operation.
685685
# There's a known problem with IA32 floating-point that causes
@@ -915,7 +915,7 @@ def testHypot(self):
915915
self.assertRaises(TypeError, math.hypot, *([1.0]*18), 'spam')
916916

917917
@requires_IEEE_754
918-
@skip_if_have_double_rounding
918+
@skip_if_double_rounding
919919
def testHypotAccuracy(self):
920920
# Verify improved accuracy in cases that were known to be inaccurate.
921921
#
@@ -1404,7 +1404,7 @@ def __rmul__(self, other):
14041404
self.assertEqual(sumprod(*args), 0.0)
14051405

14061406
@requires_IEEE_754
1407-
@skip_if_have_double_rounding
1407+
@skip_if_double_rounding
14081408
@support.cpython_only # Other implementations may choose a different algorithm
14091409
def test_sumprod_accuracy(self):
14101410
sumprod = math.sumprod
@@ -1489,7 +1489,7 @@ def run(func, *args):
14891489
)
14901490

14911491
@requires_IEEE_754
1492-
@skip_if_have_double_rounding
1492+
@skip_if_double_rounding
14931493
@support.cpython_only # Other implementations may choose a different algorithm
14941494
@support.requires_resource('cpu')
14951495
def test_sumprod_extended_precision_accuracy(self):

Lib/test/test_statistics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import unittest
1818
from test import support
1919
from test.support import (import_helper, requires_IEEE_754,
20-
skip_if_have_double_rounding)
20+
skip_if_double_rounding)
2121

2222
from decimal import Decimal
2323
from fractions import Fraction
@@ -2791,7 +2791,7 @@ def test_sqrtprod_helper_function_fundamentals(self):
27912791
self.assertEqual(sign(actual), sign(expected))
27922792

27932793
@requires_IEEE_754
2794-
@skip_if_have_double_rounding
2794+
@skip_if_double_rounding
27952795
@support.cpython_only # Allow for a weaker sumprod() implementation
27962796
def test_sqrtprod_helper_function_improved_accuracy(self):
27972797
# Test a known example where accuracy is improved

0 commit comments

Comments
 (0)