From 529b985ad90a305ae93aae62770c7e1ac74ea4de Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sat, 30 Mar 2024 19:18:31 +0100 Subject: [PATCH] tests: add typesafety tests --- pyproject.toml | 4 ++-- setup.cfg | 3 ++- typesafety/test_upath_interface.yml | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 typesafety/test_upath_interface.yml diff --git a/pyproject.toml b/pyproject.toml index efd59939..56c4c0c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ force_single_line = true line_length = 88 [tool.pytest.ini_options] -addopts = "-ra -m 'not hdfs'" +addopts = "-ra -m 'not hdfs' -p no:pytest-mypy-plugins" markers = [ "hdfs: mark test as hdfs", "pathlib: mark cpython pathlib tests", @@ -61,7 +61,7 @@ exclude_lines = [ [tool.mypy] # Error output -show_column_numbers = true +show_column_numbers = false show_error_codes = true show_error_context = true show_traceback = true diff --git a/setup.cfg b/setup.cfg index bf310953..2c0b1a9b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,8 @@ tests = pytest-cov==4.1.0 pytest-mock==3.12.0 pylint==2.17.4 - mypy==1.8.0 + mypy==1.9.0 + pytest-mypy-plugins==3.1.2 packaging dev = %(tests)s diff --git a/typesafety/test_upath_interface.yml b/typesafety/test_upath_interface.yml new file mode 100644 index 00000000..39dd79d4 --- /dev/null +++ b/typesafety/test_upath_interface.yml @@ -0,0 +1,6 @@ +- case: upath_interface + disable_cache: true + main: | + from upath import UPath + + reveal_type(UPath("abc")) # N: Revealed type is "upath.core.UPath"