MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / test

Function test

site-packages/matplotlib/__init__.py:1499–1544  ·  view source on GitHub ↗

run the matplotlib test suite

(verbosity=None, coverage=False, switch_backend_warn=True,
         recursionlimit=0, **kwargs)

Source from the content-addressed store, hash-verified

1497
1498
1499def test(verbosity=None, coverage=False, switch_backend_warn=True,
1500 recursionlimit=0, **kwargs):
1501 """run the matplotlib test suite"""
1502 _init_tests()
1503 if not os.path.isdir(os.path.join(os.path.dirname(__file__), 'tests')):
1504 raise ImportError("Matplotlib test data is not installed")
1505
1506 old_backend = get_backend()
1507 old_recursionlimit = sys.getrecursionlimit()
1508 try:
1509 use('agg')
1510 if recursionlimit:
1511 sys.setrecursionlimit(recursionlimit)
1512 import pytest
1513
1514 args = kwargs.pop('argv', [])
1515 provide_default_modules = True
1516 use_pyargs = True
1517 for arg in args:
1518 if any(arg.startswith(module_path)
1519 for module_path in default_test_modules):
1520 provide_default_modules = False
1521 break
1522 if os.path.exists(arg):
1523 provide_default_modules = False
1524 use_pyargs = False
1525 break
1526 if use_pyargs:
1527 args += ['--pyargs']
1528 if provide_default_modules:
1529 args += default_test_modules
1530
1531 if coverage:
1532 args += ['--cov']
1533
1534 if verbosity:
1535 args += ['-' + 'v' * verbosity]
1536
1537 retcode = pytest.main(args, **kwargs)
1538 finally:
1539 if old_backend.lower() != 'agg':
1540 use(old_backend, warn=switch_backend_warn)
1541 if recursionlimit:
1542 sys.setrecursionlimit(old_recursionlimit)
1543
1544 return retcode
1545
1546
1547test.__test__ = False # pytest: this function is not a test

Callers

nothing calls this directly

Calls 11

_init_testsFunction · 0.85
get_backendFunction · 0.85
anyFunction · 0.85
startswithMethod · 0.80
lowerMethod · 0.80
useFunction · 0.70
isdirMethod · 0.45
joinMethod · 0.45
popMethod · 0.45
existsMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected