Show More
@@ -1845,18 +1845,24 b' class TestRunner(object):' | |||
|
1845 | 1845 | b'gendoc': 100, |
|
1846 | 1846 | b'contrib-perf': 200, |
|
1847 | 1847 | } |
|
1848 | perf = {} | |
|
1848 | 1849 | def sortkey(f): |
|
1849 | 1850 | # run largest tests first, as they tend to take the longest |
|
1850 | 1851 | try: |
|
1851 | val = -os.stat(f).st_size | |
|
1852 |
except |
|
|
1853 |
|
|
|
1854 |
|
|
|
1855 | return -1e9 # file does not exist, tell early | |
|
1856 | for kw, mul in slow.items(): | |
|
1857 |
|
|
|
1858 | val *= mul | |
|
1859 |
return |
|
|
1852 | return perf[f] | |
|
1853 | except KeyError: | |
|
1854 | try: | |
|
1855 | val = -os.stat(f).st_size | |
|
1856 | except OSError as e: | |
|
1857 | if e.errno != errno.ENOENT: | |
|
1858 | raise | |
|
1859 | perf[f] = -1e9 # file does not exist, tell early | |
|
1860 | return -1e9 | |
|
1861 | for kw, mul in slow.items(): | |
|
1862 | if kw in f: | |
|
1863 | val *= mul | |
|
1864 | perf[f] = val | |
|
1865 | return perf[f] | |
|
1860 | 1866 | tests.sort(key=sortkey) |
|
1861 | 1867 | |
|
1862 | 1868 | self._testdir = osenvironb[b'TESTDIR'] = getattr( |
General Comments 0
You need to be logged in to leave comments.
Login now