diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-10-22 13:49:37 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2022-10-27 08:06:52 -0700 |
commit | 545d6d60673c7686ec873a343b6afd77ec9062ec (patch) | |
tree | 17acaba33ca97439b981b58cabb1ef23a60f62ef | |
parent | 64e8c31e1d35082bc2e52582205157ae1a6c4605 (diff) | |
download | gitlab-545d6d60673c7686ec873a343b6afd77ec9062ec.tar.gz |
chore: add basic type checks to meta tests
-rw-r--r-- | pyproject.toml | 6 | ||||
-rw-r--r-- | tests/meta/test_ensure_type_hints.py | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/pyproject.toml b/pyproject.toml index 64734ba..15b897d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,13 +14,15 @@ module = [ "docs.ext.*", "tests.functional.*", "tests.functional.api.*", - "tests.meta.*", "tests.unit.*", ] ignore_errors = true [[tool.mypy.overrides]] -module = "tests.smoke.*" +module = [ + "tests.meta.*", + "tests.smoke.*", +] disable_error_code = ["no-untyped-def"] [tool.semantic_release] diff --git a/tests/meta/test_ensure_type_hints.py b/tests/meta/test_ensure_type_hints.py index 1fd48d8..b5ec14c 100644 --- a/tests/meta/test_ensure_type_hints.py +++ b/tests/meta/test_ensure_type_hints.py @@ -9,7 +9,7 @@ import functools import inspect from typing import Optional, Type -import _pytest +import pytest import gitlab.mixins import gitlab.v4.objects @@ -19,7 +19,7 @@ import gitlab.v4.objects @dataclasses.dataclass(frozen=True) class ClassInfo: name: str - type: Type + type: Type # type: ignore[type-arg] def __lt__(self, other: object) -> bool: if not isinstance(other, ClassInfo): @@ -32,7 +32,7 @@ class ClassInfo: return (self.type.__module__, self.name) == (other.type.__module__, other.name) -def pytest_generate_tests(metafunc: _pytest.python.Metafunc) -> None: +def pytest_generate_tests(metafunc: pytest.Metafunc) -> None: """Find all of the classes in gitlab.v4.objects and pass them to our test function""" @@ -106,7 +106,7 @@ class TestTypeHints: def get_check_helper( self, *, - base_type: Type, + base_type: Type, # type: ignore[type-arg] class_info: ClassInfo, method_template: str, optional_return: bool, |