Skip to content

Commit

Permalink
See if hypo* now work with 3.12 (#447)
Browse files Browse the repository at this point in the history
- Reenable fuzzing
- Have tox install all deps
  • Loading branch information
cooperlees authored Jan 14, 2024
1 parent 12c2dc4 commit 6c96f75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
22 changes: 10 additions & 12 deletions tests/test_bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,18 +969,16 @@ def test_selfclean_test_bugbear(self):


class TestFuzz(unittest.TestCase):
# TODO: enable this test on py312 once hypothesmith supports py312
if sys.version_info < (3, 12):
from hypothesis import HealthCheck, given, settings
from hypothesmith import from_grammar

@settings(suppress_health_check=[HealthCheck.too_slow])
@given(from_grammar().map(ast.parse))
def test_does_not_crash_on_any_valid_code(self, syntax_tree):
# Given any syntatically-valid source code, flake8-bugbear should
# not crash. This tests doesn't check that we do the *right* thing,
# just that we don't crash on valid-if-poorly-styled code!
BugBearVisitor(filename="<string>", lines=[]).visit(syntax_tree)
from hypothesis import HealthCheck, given, settings
from hypothesmith import from_grammar

@settings(suppress_health_check=[HealthCheck.too_slow])
@given(from_grammar().map(ast.parse))
def test_does_not_crash_on_any_valid_code(self, syntax_tree):
# Given any syntatically-valid source code, flake8-bugbear should
# not crash. This tests doesn't check that we do the *right* thing,
# just that we don't crash on valid-if-poorly-styled code!
BugBearVisitor(filename="<string>", lines=[]).visit(syntax_tree)

def test_does_not_crash_on_site_code(self):
# Because the generator isn't perfect, we'll also test on all the code
Expand Down
5 changes: 0 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ deps =
commands =
coverage run tests/test_bugbear.py -k b902 {posargs}
coverage report -m

[testenv:py312]
deps =
# the other dependencies aren't yet installable on py312+
coverage

0 comments on commit 6c96f75

Please sign in to comment.