Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 747b849

Browse files
committed
PEP8 test only on python2. 2to3 produces non pep8 compliant code.
1 parent bb1a328 commit 747b849

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from fnmatch import fnmatch
22
import os
3+
import sys
34

45
from nose.tools import assert_equal
56
import pep8
@@ -178,6 +179,11 @@ def test_pep8_conformance():
178179
# The file should be a line separated list of filenames/directories
179180
# as can be passed to the "pep8" tool's exclude list.
180181

182+
# Only run this test with Python 2 - the 2to3 tool generates non pep8
183+
# compliant code.
184+
if sys.version_info[0] != 2:
185+
return
186+
181187
# to get a list of bad files, rather than the specific errors, add
182188
# "reporter=pep8.FileReport" to the StyleGuide constructor.
183189
pep8style = pep8.StyleGuide(quiet=False,

0 commit comments

Comments
 (0)