Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions testing/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ def test_mainargv(request):


def test_remote_usage_prog(pytester: pytest.Pytester) -> None:
if pytest.version_tuple[:2] >= (9, 0):
get_optparser_expr = "get_config_parser.optparser"
else:
get_optparser_expr = "get_config_parser._getparser()"

pytester.makeconftest(
"""
import pytest
Expand All @@ -394,12 +399,12 @@ def pytest_configure(config):
"""
)
pytester.makepyfile(
"""
f"""
import sys

def test(get_config_parser, request):
get_config_parser._getparser().error("my_usage_error")
"""
{get_optparser_expr}.error("my_usage_error")
"""
)

result = pytester.runpytest_subprocess("-n1")
Expand Down