File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,14 @@ class Coverage:
297
297
# Tweaks to the .coveragerc file
298
298
options : Optional [str ] = None
299
299
300
+ class CoveragePR (Coverage ):
301
+ """A version of coverage.py from a pull request."""
302
+ def __init__ (self , number , options = None ):
303
+ super ().__init__ (
304
+ slug = f"#{ number } " ,
305
+ pip_args = f"git+https://github.com/nedbat/coveragepy.git@refs/pull/{ number } /merge" ,
306
+ options = options ,
307
+ )
300
308
301
309
@dataclasses .dataclass
302
310
class Env :
@@ -421,6 +429,29 @@ def as_table_row(vals):
421
429
with change_dir (PERF_DIR ):
422
430
423
431
if 1 :
432
+ exp = Experiment (
433
+ py_versions = [
434
+ Python (3 , 11 ),
435
+ ],
436
+ cov_versions = [
437
+ Coverage ("6.4.1" , "coverage==6.4.1" ),
438
+ CoveragePR (1394 ),
439
+ ],
440
+ projects = [
441
+ AdHocProject ("/src/bugs/bug1339/bug1339.py" ),
442
+ SlipcoverBenchmark ("bm_sudoku.py" ),
443
+ SlipcoverBenchmark ("bm_spectral_norm.py" ),
444
+ ],
445
+ )
446
+ exp .run (num_runs = 5 )
447
+ exp .show_results (
448
+ rows = ["pyver" , "proj" ],
449
+ column = "cov" ,
450
+ ratios = [
451
+ ("#1394 vs 6.4.1" , "#1394" , "6.4.1" ),
452
+ ],
453
+ )
454
+ if 0 :
424
455
exp = Experiment (
425
456
py_versions = [
426
457
Python (3 , 10 ),
You can’t perform that action at this time.
0 commit comments