Skip to content

Commit 328c582

Browse files
committed
Check redefined names with flake8
1 parent e5c7945 commit 328c582

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exclude =
77
test_imports.py,
88
hypothesis-python/tests/py2/*,
99
test_lambda_formatting.py
10-
ignore = F811,D1,D205,D209,D213,D400,D401,D412,D413,D999,D202,E203,E501,W503,B008,B011
10+
ignore = D1,D205,D209,D213,D400,D401,D412,D413,D999,D202,E203,E501,W503,B008,B011
1111

1212
# Use flake8-alfred to forbid builtins that require compatibility wrappers.
1313
warn-symbols=

hypothesis-python/src/hypothesis/_strategies.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,13 @@ def one_of(args):
298298
pass # pragma: no cover
299299

300300

301-
@overload
301+
@overload # noqa: F811
302302
def one_of(*args):
303303
# type: (SearchStrategy[Any]) -> SearchStrategy[Any]
304304
pass # pragma: no cover
305305

306306

307-
def one_of(*args):
307+
def one_of(*args): # noqa: F811
308308
# Mypy workaround alert: Any is too loose above; the return parameter
309309
# should be the union of the input parameters. Unfortunately, Mypy <=0.600
310310
# raises errors due to incompatible inputs instead. See #1270 for links.
@@ -669,14 +669,14 @@ def sampled_from(elements):
669669
pass # pragma: no cover
670670

671671

672-
@overload
672+
@overload # noqa: F811
673673
def sampled_from(elements):
674674
# type: (Type[enum.Enum]) -> SearchStrategy[Any]
675675
# `SearchStrategy[Enum]` is unreliable due to metaclass issues.
676676
pass # pragma: no cover
677677

678678

679-
@defines_strategy
679+
@defines_strategy # noqa: F811
680680
def sampled_from(elements):
681681
"""Returns a strategy which generates any value present in ``elements``.
682682

hypothesis-python/src/hypothesis/extra/pytestplugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pytest
2323

2424
from hypothesis import Verbosity, core, settings
25-
from hypothesis._settings import Verbosity, note_deprecation
25+
from hypothesis._settings import note_deprecation
2626
from hypothesis.errors import InvalidArgument
2727
from hypothesis.internal.compat import text_type
2828
from hypothesis.internal.detection import is_hypothesis_test

hypothesis-python/src/hypothesis/internal/floats.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def reinterpret_bits(x, from_, to):
5151
pass
5252
else:
5353

54-
def reinterpret_bits(x, from_, to): # pylint: disable=function-redefined
54+
def reinterpret_bits(x, from_, to): # noqa: F811
5555
if from_ == b"!e":
5656
arr = numpy.array([x], dtype=">f2")
5757
if numpy.isfinite(x) and not numpy.isfinite(arr[0]):

hypothesis-python/tests/cover/test_conjecture_test_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pytest
2323

2424
import hypothesis.strategies as st
25-
from hypothesis import given, strategies as st
25+
from hypothesis import given
2626
from hypothesis.errors import Frozen, InvalidArgument
2727
from hypothesis.internal.compat import hbytes, hrange
2828
from hypothesis.internal.conjecture.data import (

hypothesis-python/tests/cover/test_simple_collections.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import pytest
2424

2525
from hypothesis import given, settings
26-
from hypothesis.internal.compat import OrderedDict
2726
from hypothesis.strategies import (
2827
booleans,
2928
dictionaries,

0 commit comments

Comments
 (0)