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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user