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

Skip to content

Commit 8f3dccb

Browse files
committed
Make it possible to toggle coverage from matplotlib.test()
1 parent 6fa4a76 commit 8f3dccb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ def _get_nose_env():
15361536
return env
15371537

15381538

1539-
def test(verbosity=1):
1539+
def test(verbosity=1, coverage=False):
15401540
"""run the matplotlib test suite"""
15411541
_init_tests()
15421542

@@ -1560,9 +1560,14 @@ def test(verbosity=1):
15601560
# a list.
15611561
multiprocess._instantiate_plugins = plugins
15621562

1563+
env = _get_nose_env()
1564+
if coverage:
1565+
env['NOSE_WITH_COVERAGE'] = 1
1566+
15631567
success = nose.run(
15641568
defaultTest=default_test_modules,
15651569
config=config,
1570+
env=env,
15661571
)
15671572
finally:
15681573
if old_backend.lower() != 'agg':

0 commit comments

Comments
 (0)