Skip to content

Commit 82d5ea0

Browse files
tsvikasionelmc
authored andcommitted
fix tests for _
1 parent 43fda5e commit 82d5ea0

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

tests/test_pytest_cov.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def test_central(pytester, testdir, prop):
207207

208208
result = testdir.runpytest('-v', f'--cov={script.dirpath()}', '--cov-report=term-missing', script, *prop.args)
209209

210-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_central* {prop.result} *', '*10 passed*'])
210+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_central* {prop.result} *', '*10 passed*'])
211211
assert result.ret == 0
212212

213213

@@ -218,7 +218,7 @@ def test_annotate(testdir):
218218

219219
result.stdout.fnmatch_lines(
220220
[
221-
'*- coverage: platform *, python * -*',
221+
'*_ coverage: platform *, python * _*',
222222
'Coverage annotated source written next to source',
223223
'*10 passed*',
224224
]
@@ -233,7 +233,7 @@ def test_annotate_output_dir(testdir):
233233

234234
result.stdout.fnmatch_lines(
235235
[
236-
'*- coverage: platform *, python * -*',
236+
'*_ coverage: platform *, python * _*',
237237
'Coverage annotated source written to dir ' + DEST_DIR,
238238
'*10 passed*',
239239
]
@@ -251,7 +251,7 @@ def test_html(testdir):
251251

252252
result.stdout.fnmatch_lines(
253253
[
254-
'*- coverage: platform *, python * -*',
254+
'*_ coverage: platform *, python * _*',
255255
'Coverage HTML written to dir htmlcov',
256256
'*10 passed*',
257257
]
@@ -269,7 +269,7 @@ def test_html_output_dir(testdir):
269269

270270
result.stdout.fnmatch_lines(
271271
[
272-
'*- coverage: platform *, python * -*',
272+
'*_ coverage: platform *, python * _*',
273273
'Coverage HTML written to dir ' + DEST_DIR,
274274
'*10 passed*',
275275
]
@@ -289,7 +289,7 @@ def test_term_report_does_not_interact_with_html_output(testdir):
289289

290290
result.stdout.fnmatch_lines(
291291
[
292-
'*- coverage: platform *, python * -*',
292+
'*_ coverage: platform *, python * _*',
293293
'Coverage HTML written to dir ' + DEST_DIR,
294294
'*1 passed*',
295295
]
@@ -317,7 +317,7 @@ def test_html_configured_output_dir(testdir):
317317

318318
result.stdout.fnmatch_lines(
319319
[
320-
'*- coverage: platform *, python * -*',
320+
'*_ coverage: platform *, python * _*',
321321
'Coverage HTML written to dir somewhere',
322322
'*10 passed*',
323323
]
@@ -335,7 +335,7 @@ def test_xml_output_dir(testdir):
335335

336336
result.stdout.fnmatch_lines(
337337
[
338-
'*- coverage: platform *, python * -*',
338+
'*_ coverage: platform *, python * _*',
339339
'Coverage XML written to file ' + XML_REPORT_NAME,
340340
'*10 passed*',
341341
]
@@ -351,7 +351,7 @@ def test_json_output_dir(testdir):
351351

352352
result.stdout.fnmatch_lines(
353353
[
354-
'*- coverage: platform *, python * -*',
354+
'*_ coverage: platform *, python * _*',
355355
'Coverage JSON written to file ' + JSON_REPORT_NAME,
356356
'*10 passed*',
357357
]
@@ -368,7 +368,7 @@ def test_lcov_output_dir(testdir):
368368

369369
result.stdout.fnmatch_lines(
370370
[
371-
'*- coverage: platform *, python * -*',
371+
'*_ coverage: platform *, python * _*',
372372
'Coverage LCOV written to file ' + LCOV_REPORT_NAME,
373373
'*10 passed*',
374374
]
@@ -490,7 +490,7 @@ def test_central_nonspecific(pytester, testdir, prop):
490490
testdir.tmpdir.join('.coveragerc').write(prop.fullconf)
491491
result = testdir.runpytest('-v', '--cov', '--cov-report=term-missing', script, *prop.args)
492492

493-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_central_nonspecific* {prop.result} *', '*10 passed*'])
493+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_central_nonspecific* {prop.result} *', '*10 passed*'])
494494

495495
# multi-module coverage report
496496
assert any(line.startswith('TOTAL ') for line in result.stdout.lines)
@@ -520,7 +520,7 @@ def test_central_coveragerc(pytester, testdir, prop):
520520

521521
result.stdout.fnmatch_lines(
522522
[
523-
'*- coverage: platform *, python * -*',
523+
'*_ coverage: platform *, python * _*',
524524
f'test_central_coveragerc* {prop.result} *',
525525
'*10 passed*',
526526
]
@@ -557,7 +557,7 @@ def test_central_with_path_aliasing(pytester, testdir, monkeypatch, opts, prop):
557557

558558
result.stdout.fnmatch_lines(
559559
[
560-
'*- coverage: platform *, python * -*',
560+
'*_ coverage: platform *, python * _*',
561561
f'src[\\/]mod* {prop.result} *',
562562
'*10 passed*',
563563
]
@@ -599,7 +599,7 @@ def test_foobar(bad):
599599

600600
result.stdout.fnmatch_lines(
601601
[
602-
'*- coverage: platform *, python * -*',
602+
'*_ coverage: platform *, python * _*',
603603
'*mod* 100%',
604604
'*1 passed*',
605605
]
@@ -636,7 +636,7 @@ def test_subprocess_with_path_aliasing(pytester, testdir, monkeypatch):
636636

637637
result.stdout.fnmatch_lines(
638638
[
639-
'*- coverage: platform *, python * -*',
639+
'*_ coverage: platform *, python * _*',
640640
f'src[\\/]child_script* {CHILD_SCRIPT_RESULT}*',
641641
f'src[\\/]parent_script* {PARENT_SCRIPT_RESULT}*',
642642
]
@@ -661,7 +661,7 @@ def test_show_missing_coveragerc(pytester, testdir, prop):
661661

662662
result.stdout.fnmatch_lines(
663663
[
664-
'*- coverage: platform *, python * -*',
664+
'*_ coverage: platform *, python * _*',
665665
'Name * Stmts * Miss * Cover * Missing',
666666
f'test_show_missing_coveragerc* {prop.result} * 11*',
667667
'*10 passed*',
@@ -767,7 +767,7 @@ def test_dist_collocated(pytester, testdir, prop):
767767
*prop.args,
768768
)
769769

770-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_dist_collocated* {prop.result} *', '*10 passed*'])
770+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_dist_collocated* {prop.result} *', '*10 passed*'])
771771
assert result.ret == 0
772772

773773

@@ -802,7 +802,7 @@ def test_dist_not_collocated(pytester, testdir, prop):
802802
*prop.args,
803803
)
804804

805-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_dist_not_collocated* {prop.result} *', '*10 passed*'])
805+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_dist_not_collocated* {prop.result} *', '*10 passed*'])
806806
assert result.ret == 0
807807

808808

@@ -838,7 +838,7 @@ def test_dist_not_collocated_coveragerc_source(pytester, testdir, prop):
838838
*prop.args,
839839
)
840840

841-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_dist_not_collocated* {prop.result} *', '*10 passed*'])
841+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_dist_not_collocated* {prop.result} *', '*10 passed*'])
842842
assert result.ret == 0
843843

844844

@@ -850,7 +850,7 @@ def test_central_subprocess(testdir):
850850

851851
result.stdout.fnmatch_lines(
852852
[
853-
'*- coverage: platform *, python * -*',
853+
'*_ coverage: platform *, python * _*',
854854
f'child_script* {CHILD_SCRIPT_RESULT}*',
855855
f'parent_script* {PARENT_SCRIPT_RESULT}*',
856856
]
@@ -876,7 +876,7 @@ def test_central_subprocess_change_cwd(testdir):
876876

877877
result.stdout.fnmatch_lines(
878878
[
879-
'*- coverage: platform *, python * -*',
879+
'*_ coverage: platform *, python * _*',
880880
f'*child_script* {CHILD_SCRIPT_RESULT}*',
881881
'*parent_script* 100%*',
882882
]
@@ -904,7 +904,7 @@ def test_central_subprocess_change_cwd_with_pythonpath(pytester, testdir, monkey
904904

905905
result.stdout.fnmatch_lines(
906906
[
907-
'*- coverage: platform *, python * -*',
907+
'*_ coverage: platform *, python * _*',
908908
f'*child_script* {CHILD_SCRIPT_RESULT}*',
909909
]
910910
)
@@ -930,7 +930,7 @@ def test_foo():
930930
result = testdir.runpytest('-v', '--cov-config=coveragerc', f'--cov={script.dirpath()}', '--cov-branch', script)
931931
result.stdout.fnmatch_lines(
932932
[
933-
'*- coverage: platform *, python * -*',
933+
'*_ coverage: platform *, python * _*',
934934
'test_central_subprocess_no_subscript* * 3 * 0 * 100%*',
935935
]
936936
)
@@ -948,7 +948,7 @@ def test_dist_subprocess_collocated(testdir):
948948

949949
result.stdout.fnmatch_lines(
950950
[
951-
'*- coverage: platform *, python * -*',
951+
'*_ coverage: platform *, python * _*',
952952
f'child_script* {CHILD_SCRIPT_RESULT}*',
953953
f'parent_script* {PARENT_SCRIPT_RESULT}*',
954954
]
@@ -988,7 +988,7 @@ def test_dist_subprocess_not_collocated(pytester, testdir, tmpdir):
988988

989989
result.stdout.fnmatch_lines(
990990
[
991-
'*- coverage: platform *, python * -*',
991+
'*_ coverage: platform *, python * _*',
992992
f'child_script* {CHILD_SCRIPT_RESULT}*',
993993
f'parent_script* {PARENT_SCRIPT_RESULT}*',
994994
]
@@ -1061,7 +1061,7 @@ def test_funcarg(testdir):
10611061

10621062
result = testdir.runpytest('-v', f'--cov={script.dirpath()}', '--cov-report=term-missing', script)
10631063

1064-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', 'test_funcarg* 3 * 100%*', '*1 passed*'])
1064+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', 'test_funcarg* 3 * 100%*', '*1 passed*'])
10651065
assert result.ret == 0
10661066

10671067

@@ -1111,7 +1111,7 @@ def test_run():
11111111

11121112
result = testdir.runpytest('-vv', f'--cov={script.dirpath()}', '--cov-report=term-missing', script)
11131113

1114-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', 'test_cleanup_on_sigterm* 26-27', '*1 passed*'])
1114+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', 'test_cleanup_on_sigterm* 26-27', '*1 passed*'])
11151115
assert result.ret == 0
11161116

11171117

@@ -1157,7 +1157,7 @@ def test_run():
11571157

11581158
result = testdir.runpytest('-vv', f'--cov={script.dirpath()}', '--cov-report=term-missing', script)
11591159

1160-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_cleanup_on_sigterm* {setup[1]}', '*1 passed*'])
1160+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_cleanup_on_sigterm* {setup[1]}', '*1 passed*'])
11611161
assert result.ret == 0
11621162

11631163

@@ -1201,7 +1201,7 @@ def test_run():
12011201

12021202
result = testdir.runpytest('-vv', '--assert=plain', f'--cov={script.dirpath()}', '--cov-report=term-missing', script)
12031203

1204-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_cleanup_on_sigterm* {setup[1]}', '*1 passed*'])
1204+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_cleanup_on_sigterm* {setup[1]}', '*1 passed*'])
12051205
assert result.ret == 0
12061206

12071207

@@ -1236,7 +1236,7 @@ def test_run():
12361236

12371237
result = testdir.runpytest('-vv', '--assert=plain', f'--cov={script.dirpath()}', '--cov-report=term-missing', script)
12381238

1239-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', 'test_cleanup_on_sigterm* 88% 19-20', '*1 passed*'])
1239+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', 'test_cleanup_on_sigterm* 88% 19-20', '*1 passed*'])
12401240
assert result.ret == 0
12411241

12421242

@@ -1273,7 +1273,7 @@ def test_run():
12731273

12741274
result = testdir.runpytest('-vv', '--assert=plain', f'--cov={script.dirpath()}', '--cov-report=term-missing', script)
12751275

1276-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', 'test_cleanup_on_sigterm* 89% 22-23', '*1 passed*'])
1276+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', 'test_cleanup_on_sigterm* 89% 22-23', '*1 passed*'])
12771277
assert result.ret == 0
12781278

12791279

@@ -1505,7 +1505,7 @@ def test_dist_boxed(testdir):
15051505

15061506
result = testdir.runpytest('-v', '--assert=plain', f'--cov={script.dirpath()}', '--boxed', script)
15071507

1508-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_dist_boxed* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
1508+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_dist_boxed* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
15091509
assert result.ret == 0
15101510

15111511

@@ -1516,7 +1516,7 @@ def test_dist_bare_cov(testdir):
15161516

15171517
result = testdir.runpytest('-v', '--cov', '-n', '1', script)
15181518

1519-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_dist_bare_cov* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
1519+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_dist_bare_cov* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
15201520
assert result.ret == 0
15211521

15221522

@@ -1747,7 +1747,7 @@ def test_append_coverage_subprocess(testdir):
17471747

17481748
result.stdout.fnmatch_lines(
17491749
[
1750-
'*- coverage: platform *, python * -*',
1750+
'*_ coverage: platform *, python * _*',
17511751
f'child_script* {CHILD_SCRIPT_RESULT}*',
17521752
f'parent_script* {PARENT_SCRIPT_RESULT}*',
17531753
]
@@ -1781,15 +1781,15 @@ def test_double_cov(testdir):
17811781
script = testdir.makepyfile(SCRIPT_SIMPLE)
17821782
result = testdir.runpytest('-v', '--assert=plain', '--cov', f'--cov={script.dirpath()}', script)
17831783

1784-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_double_cov* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
1784+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_double_cov* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
17851785
assert result.ret == 0
17861786

17871787

17881788
def test_double_cov2(testdir):
17891789
script = testdir.makepyfile(SCRIPT_SIMPLE)
17901790
result = testdir.runpytest('-v', '--assert=plain', '--cov', '--cov', script)
17911791

1792-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_double_cov2* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
1792+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_double_cov2* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
17931793
assert result.ret == 0
17941794

17951795

@@ -1804,7 +1804,7 @@ def test_cov_reset_then_set(testdir):
18041804
script = testdir.makepyfile(SCRIPT_SIMPLE)
18051805
result = testdir.runpytest('-v', '--assert=plain', f'--cov={script.dirpath()}', '--cov-reset', f'--cov={script.dirpath()}', script)
18061806

1807-
result.stdout.fnmatch_lines(['*- coverage: platform *, python * -*', f'test_cov_reset_then_set* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
1807+
result.stdout.fnmatch_lines(['*_ coverage: platform *, python * _*', f'test_cov_reset_then_set* {SCRIPT_SIMPLE_RESULT}*', '*1 passed*'])
18081808

18091809

18101810
@pytest.mark.skipif('sys.platform == "win32" and platform.python_implementation() == "PyPy"')

0 commit comments

Comments
 (0)