mark: export pytest.MarkGenerator for typing purposes

The type cannot be constructed directly, but is exported for use in type
annotations, since it is reachable through existing public API.
This commit is contained in:
Ran Benita
2020-12-20 15:36:24 +02:00
parent 69c302479e
commit 6aa4d1c7ab
6 changed files with 14 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ class TestMark:
assert attr in module.__all__ # type: ignore
def test_pytest_mark_notcallable(self) -> None:
mark = MarkGenerator()
mark = MarkGenerator(_ispytest=True)
with pytest.raises(TypeError):
mark() # type: ignore[operator]
@@ -40,7 +40,7 @@ class TestMark:
assert pytest.mark.foo.with_args(SomeClass) is not SomeClass # type: ignore[comparison-overlap]
def test_pytest_mark_name_starts_with_underscore(self) -> None:
mark = MarkGenerator()
mark = MarkGenerator(_ispytest=True)
with pytest.raises(AttributeError):
mark._some_name