Skip to content

Commit af6bef9

Browse files
committed
Fix coverage exclusions.
It's no longer sufficient to use just the envname.
1 parent 29293fe commit af6bef9

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.coveragerc

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ directory = htmlcov-${TOX_ENVNAME}
99

1010
[report]
1111
exclude_lines =
12-
✘${TOX_ENVNAME}
12+
✘py${COVERAGE_MAJOR}
13+
✘py${COVERAGE_MAJORMINOR}
1314
pragma: no ?cover

ebb_lint/checkers/check_misc_dubious_syntax.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def check_for_print(p):
8080
pass_filename=True, pass_future_features=True, pass_grammar=True,
8181
python_disabled_version=(3, 0))
8282
def check_for_implicit_relative_imports(
83-
filename, future_features, grammar, mod): # ✘py33 ✘py34 ✘py35
83+
filename, future_features, grammar, mod): # ✘py3
8484
if 'absolute_import' in future_features:
8585
return
8686
[mod] = mod

ebb_lint/flake8.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ def source(self):
176176
if self._source is None:
177177
if self.filename != 'stdin':
178178
self._source = read_file_using_source_encoding(self.filename)
179-
elif six.PY2: # ✘py33 ✘py34 ✘py35
179+
elif six.PY2: # ✘py3
180180
# On python 2, reading from stdin gives you bytes, which must
181181
# be decoded.
182182
self._source = decode_bytes_using_source_encoding(
183183
pycodestyle.stdin_get_value())
184-
else: # ✘py27
184+
else: # ✘py2
185185
# On python 3, reading from stdin gives you text.
186186
self._source = pycodestyle.stdin_get_value()
187187
return self._source

tox.ini

+7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ envlist = py{27,33,34,35}-flake8_{26,3}
33

44
[testenv]
55
setenv =
6+
py27: COVERAGE_MAJOR = 2
7+
py27: COVERAGE_MAJORMINOR = 27
8+
py{33,34,35}: COVERAGE_MAJOR = 3
9+
py33: COVERAGE_MAJORMINOR = 33
10+
py34: COVERAGE_MAJORMINOR = 34
11+
py35: COVERAGE_MAJORMINOR = 35
612
TOX_ENVNAME = {envname}
13+
714
extras = all
815
deps =
916
flake8_26: flake8 ~= 2.6.0

0 commit comments

Comments
 (0)