Merge pull request #7496 from bluetech/typing-idfn

Fix typing of params ids callable form
This commit is contained in:
Ran Benita
2020-07-15 10:25:46 +03:00
committed by GitHub
4 changed files with 38 additions and 13 deletions

24
testing/typing_checks.py Normal file
View File

@@ -0,0 +1,24 @@
"""File for checking typing issues.
This file is not executed, it is only checked by mypy to ensure that
none of the code triggers any mypy errors.
"""
import pytest
# Issue #7488.
@pytest.mark.xfail(raises=RuntimeError)
def check_mark_xfail_raises() -> None:
pass
# Issue #7494.
@pytest.fixture(params=[(0, 0), (1, 1)], ids=lambda x: str(x[0]))
def check_fixture_ids_callable() -> None:
pass
# Issue #7494.
@pytest.mark.parametrize("func", [str, int], ids=lambda x: str(x.__name__))
def check_parametrize_ids_callable(func) -> None:
pass