Created
November 6, 2019 18:43
-
-
Save astrofrog/a8a6366184bb4b427e748390fae4789a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import glob | |
import subprocess | |
import warnings | |
warnings.simplefilter('ignore') | |
for subpackage in sorted(glob.glob(os.path.join('astropy', '*'))): | |
if os.path.isdir(subpackage) and '_' not in subpackage and 'extern' not in subpackage: | |
output = subprocess.check_output([sys.executable, '-m', 'pytest', subpackage]) | |
nwarn = 0 | |
for line in output.splitlines(): | |
if b'seconds ======' in line: | |
if b'warnings' in line: | |
nwarn = int(line.split(b'warnings')[0].split()[-1]) | |
break | |
print(f'{subpackage}: {nwarn}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment