Skip to content

Commit cf93725

Browse files
committed
use pytest-flake8 for testing
1 parent f137d3b commit cf93725

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

MANIFEST.in

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
include MANIFEST.in
2-
include LICENSE
3-
include *.rst
4-
include *.md
5-
recursive-include extenum *.py
6-
recursive-include tests *.py
1+
include *.ini
2+
include *.md
3+
include *.rst
4+
include LICENSE
5+
include MANIFEST.in
6+
recursive-include extenum *.py
7+
recursive-include tests *.py

pytest.ini

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[pytest]
2-
pep8ignore =
3-
flakes-ignore =
4-
extenum/__init__.py UnusedImport
5-
tests/test_common_behavior.py ImportStarUsage
6-
tests/test_constant_specific.py RedefinedWhileUnused UndefinedName
7-
tests/test_implicit_enum.py UndefinedName
2+
flake8-ignore =
3+
extenum/__init__.py F401
4+
tests/test_constant_specific.py F811 F821
5+
tests/test_implicit_enum.py F821

tests/test_common_behavior.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
2-
from extenum import * # pragma: no flakes
2+
3+
from extenum import ConstantSpecificEnum
4+
from extenum import ImplicitEnum
35

46

57
@pytest.mark.parametrize('enum_cls', [

tests/test_constant_specific.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class TestEnum(ConstantSpecificEnum):
9999
TWO = 2
100100

101101
@overload(ONE)
102-
def test(self): pass
102+
def test(self):
103+
pass
103104

104105
expected = '<TestEnum.TWO: 2> is not registered'
105106
assert str(excinfo.value) == expected
@@ -111,10 +112,12 @@ class TestEnum(ConstantSpecificEnum):
111112
ONE = 1
112113

113114
@overload(ONE)
114-
def one(self): pass
115+
def one(self):
116+
pass
115117

116118
@overload(TWO)
117-
def one(self): pass
119+
def one(self):
120+
pass
118121

119122
expected = "name 'TWO' is not defined"
120123
assert str(excinfo.value) == expected
@@ -127,13 +130,16 @@ class TestEnum(ConstantSpecificEnum):
127130
TWO = 2
128131

129132
@overload(ONE)
130-
def one(self): pass
133+
def one(self):
134+
pass
131135

132136
@overload(TWO)
133-
def one(self): pass
137+
def one(self):
138+
pass
134139

135140
@overload(TWO)
136-
def two(self): pass
141+
def two(self):
142+
pass
137143

138144
expected = '<TestEnum.ONE: 1>.two function is not registered'
139145
assert str(excinfo.value) == expected

tox.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[tox]
2-
envlist = py34, py35, py36, pypy3.5
2+
envlist = py36, py37, py38, py39, pypy3.6
33

44
[testenv]
55
deps =
66
pytest
7-
pytest-pep8
8-
pytest-flakes
7+
pytest-flake8
98

10-
commands = py.test -v --pep8 --flakes extenum tests
9+
commands = py.test -v --flake8 extenum tests

0 commit comments

Comments
 (0)