Test if main command shows help when called without the subcommand.
(monkeypatch, capsys)
| 10 | |
| 11 | |
| 12 | def test_main(monkeypatch, capsys): |
| 13 | """Test if main command shows help when called without the subcommand.""" |
| 14 | monkeypatch.setattr(sys, "argv", ["pytest-bdd"]) |
| 15 | monkeypatch.setattr(sys, "exit", lambda x: x) |
| 16 | main() |
| 17 | out, err = capsys.readouterr() |
| 18 | assert "usage: pytest-bdd [-h]" in err |
| 19 | assert "pytest-bdd: error:" in err |
| 20 | |
| 21 | |
| 22 | def test_step_definitions_found_using_main(pytester): |
nothing calls this directly
no test coverage detected
searching dependent graphs…