You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checked on the following snippet
```
import pytest
from typing import reveal_type
print(pytest.skip)
print(pytest.skip.Exception)
reveal_type(pytest.skip)
reveal_type(pytest.skip.Exception)
reveal_type(pytest.skip(reason="whatever"))
```
before the change
```
$ uv run test_pytest_skip.py
<function skip at 0x71122a118c20>
<class 'Skipped'>
Runtime type is 'function'
Runtime type is 'type'
Traceback (most recent call last):
File "/code/playground_ty/testty/test_pytest_skip.py", line 9, in <module>
reveal_type(pytest.skip(reason="whatever"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/ext/pytest/src/_pytest/outcomes.py", line 172, in skip
raise Skipped(msg=reason, allow_module_level=allow_module_level)
Skipped: whatever
$ uv run -m mypy test_pytest_skip.py
test_pytest_skip.py:7: note: Revealed type is "_pytest.outcomes._WithException[[reason: builtins.str =, *, allow_module_level: builtins.bool =], Never, def (msg: Union[builtins.str, None] =, pytrace: builtins.bool =, allow_module_level: builtins.bool =, *, _use_item_location: builtins.bool =) -> _pytest.outcomes.Skipped]"
test_pytest_skip.py:8: note: Revealed type is "def (msg: Union[builtins.str, None] =, pytrace: builtins.bool =, allow_module_level: builtins.bool =, *, _use_item_location: builtins.bool =) -> _pytest.outcomes.Skipped"
test_pytest_skip.py:9: note: Revealed type is "Never"
Success: no issues found in 1 source file
```
after the change
```
$ uv run test_pytest_skip.py
<_pytest.outcomes._Skip object at 0x71ee4f419dc0>
<class 'Skipped'>
Runtime type is '_Skip'
Runtime type is 'type'
Traceback (most recent call last):
File "/code/playground_ty/testty/test_pytest_skip.py", line 9, in <module>
reveal_type(pytest.skip(reason="whatever"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/ext/pytest/src/_pytest/outcomes.py", line 143, in __call__
raise Skipped(msg=reason, allow_module_level=allow_module_level)
Skipped: whatever
$ uv run -m mypy test_pytest_skip.py
test_pytest_skip.py:7: note: Revealed type is "_pytest.outcomes._Skip"
test_pytest_skip.py:8: note: Revealed type is "def (msg: Union[builtins.str, None] =, pytrace: builtins.bool =, allow_module_level: builtins.bool =, *, _use_item_location: builtins.bool =) -> _pytest.outcomes.Skipped"
test_pytest_skip.py:9: note: Revealed type is "Never"
```
However, this is failing a unit test
```
$ tox -e py39-xdist
def test_skip_simple(self):
with pytest.raises(pytest.skip.Exception) as excinfo:
pytest.skip("xxx")
> assert excinfo.traceback[-1].frame.code.name == "skip"
E AssertionError: assert '__call__' == 'skip'
E
E - skip
E + __call__
testing/python/collect.py:1078: AssertionError
```
0 commit comments