Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
The commited suggestions will restore compatibility with Python 3.6.

Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
MaxG87 and cclauss authored Apr 1, 2021
1 parent d122090 commit 80794d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions test_mccabe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
from io import StringIO

import pytest
import hypothesmith
from hypothesis import HealthCheck, given, settings, strategies as st
try:
import hypothesmith
from hypothesis import HealthCheck, given, settings, strategies as st
except ImportError:
hypothesmith = None

import mccabe
from mccabe import get_code_complexity
Expand Down Expand Up @@ -251,6 +254,7 @@ def test_get_module_complexity(self):
src_contents=hypothesmith.from_grammar() | hypothesmith.from_node(),
max_complexity=st.integers(min_value=1),
)
@pytest.mark.skipif(not hypothesmith, reason="hypothesmith could not be imported")
def test_idempotent_any_syntatically_valid_python(
src_contents: str, max_complexity: int
) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ envlist =
[testenv]
deps =
pytest
hypothesis
hypothesmith
hypothesis ; python_version >= "3.6"
hypothesmith ; python_version >= "3.6"
commands =
pytest

Expand Down

0 comments on commit 80794d3

Please sign in to comment.