Skip to content

Commit 431aeeb

Browse files
committed
use testdir.runpytest_subprocess() instead
1 parent a111b89 commit 431aeeb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

plugin_test.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ def test_success():
1212
'''
1313
)
1414
testdir.monkeypatch.setenv('GITHUB_ACTIONS', 'true')
15-
testdir._method = 'subprocess'
16-
result = testdir.runpytest()
15+
result = testdir.runpytest_subprocess()
1716
result.stdout.no_fnmatch_line(
1817
'::error file=test_annotation_succeed_no_output.py*',
1918
)
@@ -29,8 +28,7 @@ def test_fail():
2928
'''
3029
)
3130
testdir.monkeypatch.setenv('GITHUB_ACTIONS', 'true')
32-
testdir._method = 'subprocess'
33-
result = testdir.runpytest()
31+
result = testdir.runpytest_subprocess()
3432
result.stdout.fnmatch_lines([
3533
'::error file=test_annotation_fail.py,line=4::def test_fail():*',
3634
])
@@ -47,8 +45,7 @@ def test_fail():
4745
'''
4846
)
4947
testdir.monkeypatch.setenv('GITHUB_ACTIONS', 'true')
50-
testdir._method = 'subprocess'
51-
result = testdir.runpytest()
48+
result = testdir.runpytest_subprocess()
5249
result.stdout.fnmatch_lines([
5350
'::error file=test_annotation_exception.py,line=4::def test_fail():*',
5451
])
@@ -64,8 +61,7 @@ def test_fail():
6461
'''
6562
)
6663
testdir.monkeypatch.setenv('GITHUB_ACTIONS', '')
67-
testdir._method = 'subprocess'
68-
result = testdir.runpytest()
64+
result = testdir.runpytest_subprocess()
6965
result.stdout.no_fnmatch_line(
7066
'::error file=test_annotation_fail_disabled_outside_workflow.py*',
7167
)

0 commit comments

Comments
 (0)