Skip to content

Commit e332caa

Browse files
committed
Fix tests.py when passed explicit filenames.
1 parent 3cb2752 commit e332caa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,16 +1535,16 @@ def test(verbosity=None, coverage=False, switch_backend_warn=True,
15351535
sys.setrecursionlimit(recursionlimit)
15361536
import pytest
15371537

1538-
args = ['--pyargs'] + default_test_modules
1538+
args = kwargs.pop('argv', [])
1539+
if not any(os.path.exists(arg) for arg in args):
1540+
args = ['--pyargs'] + default_test_modules
15391541

15401542
if coverage:
15411543
args += ['--cov']
15421544

15431545
if verbosity:
15441546
args += ['-' + 'v' * verbosity]
15451547

1546-
args += kwargs.pop('argv', [])
1547-
15481548
retcode = pytest.main(args, **kwargs)
15491549
finally:
15501550
if old_backend.lower() != 'agg':

0 commit comments

Comments
 (0)