Skip to content

Commit

Permalink
Ensure error is raised on Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 3, 2020
1 parent e781385 commit 2018a3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,15 @@ class C(object):
)


@pytest.mark.skipif(not PY2, reason="Needs to be only caught on Python 2.")
def test_auto_detect_raises_on_py2():
"""
Trying to pass auto_detect=True to attr.s raises PythonTooOldError.
"""
with pytest.raises(PythonTooOldError):
attr.s(auto_detect=True)


@pytest.mark.skipif(PY2, reason="Auto-detection is Python 3-only.")
class TestAutoDetect:
def test_determine_detects_non_presence_correctly(self):
Expand Down

0 comments on commit 2018a3e

Please sign in to comment.