File: test_main.py

package info (click to toggle)
pytest-bdd 7.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 540 kB
  • sloc: python: 3,535; makefile: 134
file content (18 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Main command."""

import os
import sys

from pytest_bdd.scripts import main

PATH = os.path.dirname(__file__)


def test_main(monkeypatch, capsys):
    """Test if main command shows help when called without the subcommand."""
    monkeypatch.setattr(sys, "argv", ["pytest-bdd"])
    monkeypatch.setattr(sys, "exit", lambda x: x)
    main()
    out, err = capsys.readouterr()
    assert "usage: pytest-bdd [-h]" in err
    assert "pytest-bdd: error:" in err