diff --git a/stubs/pytest.pyi b/stubs/pytest.pyi new file mode 100644 index 00000000..d5fec82c --- /dev/null +++ b/stubs/pytest.pyi @@ -0,0 +1,15 @@ +""" +Type stubs for pytest. + +Note that stubs are only written for the parts that we use. +""" + +from typing import ContextManager, Type + + +# This function actually has more arguments than are specified here, and the +# context manager actually yields a _pytest._code.ExceptionInfo instead of None. +# We don't use either of these features, so I don't think its worth including +# them in our type stub. We can always change it later. +def raises(exc_type: Type[Exception]) -> ContextManager[None]: + ...