From 695666550d9b074396b5e443bacece7da66da116 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Sun, 25 Jun 2023 23:57:15 -0500 Subject: [PATCH] fix(tests): resolves issue with `mypy` (read: me) being stupid --- tests/__init__.py | 0 tests/unit/test_utils.py | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index b0a672f..8051504 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -9,12 +9,12 @@ from niapi.utils import camel_case, case_insensitive_string_compare, check_email, dataclass_as_dict_shallow, slugify -@given(st.emails()) # type: ignore[misc] +@given(st.emails()) def test_check_email(email: str) -> None: assert check_email(email) == email.lower() -@given(st.text(alphabet=string.ascii_letters + string.digits + string.whitespace + "-")) # type: ignore[misc] +@given(st.text(alphabet=string.ascii_letters + string.digits + string.whitespace + "-")) def test_slugify(value: str) -> None: if all(c in string.whitespace or c == "-" for c in value): assert slugify(value) == re.sub(r"[-\s]+", "-", value.lower()).strip("-_") @@ -22,19 +22,19 @@ def test_slugify(value: str) -> None: assert slugify(value) -@given(st.text(st.characters(blacklist_characters="_"))) # type: ignore[misc] +@given(st.text(st.characters(blacklist_characters="_"))) def test_camel_case(string: str) -> None: assert camel_case(string) == "".join( word if index == 0 else word.capitalize() for index, word in enumerate(string.split("_")) ) -@given(st.text(), st.text()) # type: ignore[misc] +@given(st.text(), st.text()) def test_case_insensitive_string_compare(a: str, b: str) -> None: assert case_insensitive_string_compare(a, b) == (a.strip().lower() == b.strip().lower()) -@given(st.text(min_size=1), st.integers()) # type: ignore[misc] +@given(st.text(min_size=1), st.integers()) def test_dataclass_as_dict_shallow(name: str, value: int) -> None: @dataclass class TestClass: