]> git.madduck.net Git - etc/vim.git/blob - tests/conftest.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

exclude tests/data/.* from mypy (#3917)
[etc/vim.git] / tests / conftest.py
1 import pytest
2
3 pytest_plugins = ["tests.optional"]
4
5 PRINT_FULL_TREE: bool = False
6 PRINT_TREE_DIFF: bool = True
7
8
9 def pytest_addoption(parser: pytest.Parser) -> None:
10     parser.addoption(
11         "--print-full-tree",
12         action="store_true",
13         default=False,
14         help="print full syntax trees on failed tests",
15     )
16     parser.addoption(
17         "--print-tree-diff",
18         action="store_true",
19         default=True,
20         help="print diff of syntax trees on failed tests",
21     )
22
23
24 def pytest_configure(config: pytest.Config) -> None:
25     global PRINT_FULL_TREE
26     global PRINT_TREE_DIFF
27     PRINT_FULL_TREE = config.getoption("--print-full-tree")
28     PRINT_TREE_DIFF = config.getoption("--print-tree-diff")