8000 Merge pull request #3597 from tacaswell/pep8_fix · matplotlib/matplotlib@44ae5a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 44ae5a8

Browse files
committed
Merge pull request #3597 from tacaswell/pep8_fix
BUG/TST : skip example pep8 if don't know source path
2 parents dbeed94 + 9366eb4 commit 44ae5a8

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from nose.tools import assert_equal
88
from nose.plugins.skip import SkipTest
9+
from matplotlib.testing.noseclasses import KnownFailureTest
910

1011
try:
1112
import pep8
@@ -256,8 +257,21 @@ def test_pep8_conformance_installed_files():
256257

257258

258259
def test_pep8_conformance_examples():
259-
mpldirdefault = os.path.join(os.getcwd(), '..', '..', '..')
260-
mpldir = os.environ.get('MPL_REPO_DIR', mpldirdefault)
260+
mpldir = os.environ.get('MPL_REPO_DIR', None)
261+
if mpldir is None:
262+
# try and guess!
263+
fp = os.getcwd()
264+
while len(fp) > 2:
265+
if os.path.isdir(os.path.join(fp, 'examples')):
266+
mpldir = fp
267+
break
268+
fp, tail = os.path.split(fp)
269+
270+
if mpldir is None:
271+
raise KnownFailureTest("can not find the examples, set env "
272+
"MPL_REPO_DIR to point to the top-level path "
273+
"of the source tree")
274+
261275
exdir = os.path.join(mpldir, 'examples')
262276
blacklist = ['color',
263277
'event_handling',

0 commit comments

Comments
 (0)
0