(pytester: Pytester)
| 681 | |
| 682 | |
| 683 | def test_required_option_help(pytester: Pytester) -> None: |
| 684 | pytester.makeconftest("assert 0") |
| 685 | x = pytester.mkdir("x") |
| 686 | x.joinpath("conftest.py").write_text( |
| 687 | textwrap.dedent( |
| 688 | """\ |
| 689 | def pytest_addoption(parser): |
| 690 | parser.addoption("--xyz", action="store_true", required=True) |
| 691 | """ |
| 692 | ) |
| 693 | ) |
| 694 | result = pytester.runpytest("-h", x) |
| 695 | result.stdout.no_fnmatch_line("*argument --xyz is required*") |
| 696 | assert "general:" in result.stdout.str() |
nothing calls this directly
no test coverage detected