[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
3aef0b9de6
commit
9d2ffe207b
|
@ -656,7 +656,7 @@ def _init_checker_class() -> Type["doctest.OutputChecker"]:
|
||||||
precision = 0 if fraction is None else len(fraction)
|
precision = 0 if fraction is None else len(fraction)
|
||||||
if exponent is not None:
|
if exponent is not None:
|
||||||
precision -= int(exponent)
|
precision -= int(exponent)
|
||||||
if float(w.group()) == approx(float(g.group()), abs=10 ** -precision):
|
if float(w.group()) == approx(float(g.group()), abs=10**-precision):
|
||||||
# They're close enough. Replace the text we actually
|
# They're close enough. Replace the text we actually
|
||||||
# got with the text we want, so that it will match when we
|
# got with the text we want, so that it will match when we
|
||||||
# check the string literally.
|
# check the string literally.
|
||||||
|
|
|
@ -56,7 +56,7 @@ def test_terminalwriter_not_unicode() -> None:
|
||||||
file = io.TextIOWrapper(buffer, encoding="cp1252")
|
file = io.TextIOWrapper(buffer, encoding="cp1252")
|
||||||
tw = terminalwriter.TerminalWriter(file)
|
tw = terminalwriter.TerminalWriter(file)
|
||||||
tw.write("hello 🌀 wôrld אבג", flush=True)
|
tw.write("hello 🌀 wôrld אבג", flush=True)
|
||||||
assert buffer.getvalue() == br"hello \U0001f300 w\xf4rld \u05d0\u05d1\u05d2"
|
assert buffer.getvalue() == rb"hello \U0001f300 w\xf4rld \u05d0\u05d1\u05d2"
|
||||||
|
|
||||||
|
|
||||||
win32 = int(sys.platform == "win32")
|
win32 = int(sys.platform == "win32")
|
||||||
|
|
|
@ -771,7 +771,7 @@ class TestApprox:
|
||||||
def test_expected_value_type_error(self, x, name):
|
def test_expected_value_type_error(self, x, name):
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
TypeError,
|
TypeError,
|
||||||
match=fr"pytest.approx\(\) does not support nested {name}:",
|
match=rf"pytest.approx\(\) does not support nested {name}:",
|
||||||
):
|
):
|
||||||
approx(x)
|
approx(x)
|
||||||
|
|
||||||
|
|
|
@ -1313,7 +1313,7 @@ class TestIssue2121:
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
sys.maxsize <= (2 ** 31 - 1), reason="Causes OverflowError on 32bit systems"
|
sys.maxsize <= (2**31 - 1), reason="Causes OverflowError on 32bit systems"
|
||||||
)
|
)
|
||||||
@pytest.mark.parametrize("offset", [-1, +1])
|
@pytest.mark.parametrize("offset", [-1, +1])
|
||||||
def test_source_mtime_long_long(pytester: Pytester, offset) -> None:
|
def test_source_mtime_long_long(pytester: Pytester, offset) -> None:
|
||||||
|
@ -1332,7 +1332,7 @@ def test_source_mtime_long_long(pytester: Pytester, offset) -> None:
|
||||||
# use unsigned long timestamp which overflows signed long,
|
# use unsigned long timestamp which overflows signed long,
|
||||||
# which was the cause of the bug
|
# which was the cause of the bug
|
||||||
# +1 offset also tests masking of 0xFFFFFFFF
|
# +1 offset also tests masking of 0xFFFFFFFF
|
||||||
timestamp = 2 ** 32 + offset
|
timestamp = 2**32 + offset
|
||||||
os.utime(str(p), (timestamp, timestamp))
|
os.utime(str(p), (timestamp, timestamp))
|
||||||
result = pytester.runpytest()
|
result = pytester.runpytest()
|
||||||
assert result.ret == 0
|
assert result.ret == 0
|
||||||
|
|
Loading…
Reference in New Issue