Skip to content

Pytest documentation + build tweaks #8026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 20, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests.py when passing modules instead of paths.
  • Loading branch information
QuLogic committed Feb 16, 2017
commit d9fbe8d14bd1f699ab6e8f41ff64ea8f62cb3b2b
17 changes: 15 additions & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,8 +1536,21 @@ def test(verbosity=None, coverage=False, switch_backend_warn=True,
import pytest

args = kwargs.pop('argv', [])
if not any(os.path.exists(arg) for arg in args):
args += ['--pyargs'] + default_test_modules
provide_default_modules = True
use_pyargs = True
for arg in args:
if any(arg.startswith(module_path)
for module_path in default_test_modules):
provide_default_modules = False
break
if os.path.exists(arg):
provide_default_modules = False
use_pyargs = False
break
if use_pyargs:
args += ['--pyargs']
if provide_default_modules:
args += default_test_modules

if coverage:
args += ['--cov']
Expand Down