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

Skip to content

Commit 9366eb4

Browse files
committed
TST : made search for examples smarter
Will find examples if cwd is anywhere is the source tree.
1 parent ae7345b commit 9366eb4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/matplotlib/tests/test_coding_standards.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ def test_pep8_conformance_installed_files():
258258

259259
def test_pep8_conformance_examples():
260260
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+
261270
if mpldir is None:
262271
raise KnownFailureTest("can not find the examples, set env "
263272
"MPL_REPO_DIR to point to the top-level path "

0 commit comments

Comments
 (0)