Coverage for test_plan.py: 88%

1#!/usr/bin/env python3

2"""Pytest launcher for gentrie tests.

3

4 Usage:

5 ./test_plan.py # run all tests under tests/gentrie

6

7 Environment (optional):

8 GENTRIE_FAIL_FAST=1 # enable fail-fast (-x)

9"""

10

11 from __future__ import annotations

12

13 import os

14 import sys

15 import pytest

16

17

18 def build_pytest_args() -> list[str]:

19 args: list[str] = []

20 # Fail fast

21 if os.environ.get("GENTRIE_FAIL_FAST") == "1": 21 ↛ 22line 21 didn't jump to line 22 because the condition on line 21 was never true

22 args.append("-x")

23 # Quiet by default; adjust as needed

24 args.extend(["-q", "--disable-warnings"])

25 # Add test path

26 args.append("tests/gentrie")

27

28 return args

29

30

31 def main() -> int:

32 args = build_pytest_args()

33 return pytest.main(args)

34

35

36 if __name__ == "__main__":

37 sys.exit(main())