We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fe320b commit f1189c8Copy full SHA for f1189c8
conftest.py
@@ -2,13 +2,25 @@
2
3
from doctest import ELLIPSIS
4
5
+import pytest
6
+from beartype import beartype
7
from sybil import Sybil
8
from sybil.parsers.rest import (
9
ClearNamespaceParser,
10
DocTestParser,
11
PythonCodeBlockParser,
12
)
13
14
+
15
+def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
16
+ """
17
+ Apply the beartype decorator to all collected test functions.
18
19
+ for item in items:
20
+ if isinstance(item, pytest.Function):
21
+ item.obj = beartype(obj=item.obj)
22
23
24
pytest_collect_file = Sybil(
25
parsers=[
26
ClearNamespaceParser(),
0 commit comments