From 69761f0f04626681d198b60c9e1083d9ffedc9eb Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 19 Oct 2024 17:28:31 +0200 Subject: [PATCH] Update openpyxl tests --- .../test_cases/check_base_descriptors.py | 14 ++++----- .../test_cases/check_nested_descriptors.py | 30 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py b/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py index ecf8ec25ebe4..3dcbdc337228 100644 --- a/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py +++ b/stubs/openpyxl/@tests/test_cases/check_base_descriptors.py @@ -159,7 +159,7 @@ class WithDescriptorsStrict(Strict): # Test getters assert_type(with_descriptors.descriptor, str) -assert_type(with_descriptors.typed_not_none, str) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.typed_not_none, str) assert_type(with_descriptors.typed_none, Union[str, None]) assert_type(with_descriptors.set_tuple, Union[Literal["a", 1], float]) # type: ignore[assert-type] # False-positive in mypy @@ -172,9 +172,9 @@ class WithDescriptorsStrict(Strict): assert_type(with_descriptors.length_tuple, Tuple[str, str]) assert_type(with_descriptors.length_list, List[str]) -assert_type(with_descriptors.match_pattern_str, str) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.match_pattern_str, str) assert_type(with_descriptors.match_pattern_str_none, Union[str, None]) -assert_type(with_descriptors.match_pattern_bytes, ReadableBuffer) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.match_pattern_bytes, ReadableBuffer) assert_type(with_descriptors.match_pattern_bytes_none, Union[ReadableBuffer, None]) assert_type(with_descriptors.convertible_not_none, int) # type: ignore[assert-type] # False-positive in mypy @@ -208,7 +208,7 @@ class WithDescriptorsStrict(Strict): with_descriptors.typed_not_none = "" -with_descriptors.typed_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.typed_not_none = None # type: ignore with_descriptors.typed_not_none = 0 # type: ignore with_descriptors.typed_none = "" @@ -267,7 +267,7 @@ class WithDescriptorsStrict(Strict): with_descriptors.match_pattern_str = "" -with_descriptors.match_pattern_str = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.match_pattern_str = None # type: ignore with_descriptors.match_pattern_str = b"" # type: ignore with_descriptors.match_pattern_str = 0 # type: ignore @@ -277,7 +277,7 @@ class WithDescriptorsStrict(Strict): with_descriptors.match_pattern_str_none = 0 # type: ignore with_descriptors.match_pattern_bytes = b"" -with_descriptors.match_pattern_bytes = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.match_pattern_bytes = None # type: ignore with_descriptors.match_pattern_bytes = "" # type: ignore with_descriptors.match_pattern_bytes = 0 # type: ignore @@ -340,7 +340,7 @@ class WithDescriptorsStrict(Strict): with_descriptors.datetime_not_none = datetime(0, 0, 0) with_descriptors.datetime_not_none = "" -with_descriptors.datetime_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.datetime_not_none = None # type: ignore with_descriptors.datetime_not_none = 0 # type: ignore with_descriptors.datetime_not_none = date(0, 0, 0) # type: ignore with_descriptors.datetime_not_none = time() # type: ignore diff --git a/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py b/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py index 6db00a7adf92..301d519f03f1 100644 --- a/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py +++ b/stubs/openpyxl/@tests/test_cases/check_nested_descriptors.py @@ -154,23 +154,23 @@ class WithDescriptorsStrict(Strict): assert_type(with_descriptors.noneset_tuple, Union[Literal["a", 1], float, None]) # type: ignore[assert-type] # False-positive in mypy assert_type(with_descriptors.noneset_list, Union[str, float, None]) # type: ignore[assert-type] # False-positive in mypy # int and float are merged in generic unions -assert_type(with_descriptors.convertible_not_none, int) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.convertible_not_none, int) assert_type(with_descriptors.convertible_none, Union[int, None]) -assert_type(with_descriptors.text_str_not_none, str) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.text_str_not_none, str) assert_type(with_descriptors.text_str_none, Union[str, None]) -assert_type(with_descriptors.text_int_not_none, int) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.text_int_not_none, int) assert_type(with_descriptors.text_int_none, Union[int, None]) -assert_type(with_descriptors.minmax_float, float) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.minmax_float, float) assert_type(with_descriptors.minmax_float_none, Union[float, None]) -assert_type(with_descriptors.minmax_int, int) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.minmax_int, int) assert_type(with_descriptors.minmax_int_none, Union[int, None]) assert_type(with_descriptors.bool_not_none, bool) # type: ignore[assert-type] # False-positive in mypy assert_type(with_descriptors.bool_none, Union[bool, None]) -assert_type(with_descriptors.emptytag_not_none, bool) # type: ignore[assert-type] # False-positive in mypy +assert_type(with_descriptors.emptytag_not_none, bool) assert_type(with_descriptors.emptytag_none, Union[bool, None]) assert_type(with_descriptors.string_not_none, str) # type: ignore[assert-type] # False-positive in mypy @@ -301,16 +301,16 @@ class WithDescriptorsStrict(Strict): with_descriptors.text_int_not_none = 0 with_descriptors.text_int_not_none = "0" -with_descriptors.text_int_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy -with_descriptors.text_int_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.text_int_not_none = None # type: ignore +with_descriptors.text_int_not_none = object() # type: ignore # If expected type (_T) is not str, it's impossible to use an Element as the value -with_descriptors.text_int_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.text_int_not_none = cast( # type: ignore _HasTagAndGet[int], _ ) -with_descriptors.text_int_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.text_int_not_none = cast( # type: ignore _HasTagAndGet[None], _ ) -with_descriptors.text_int_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.text_int_not_none = cast( # type: ignore _HasTagAndGet[str], _ ) @@ -333,10 +333,10 @@ class WithDescriptorsStrict(Strict): with_descriptors.minmax_float = 0 with_descriptors.minmax_float = "0" with_descriptors.minmax_float = 0.0 -with_descriptors.minmax_float = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.minmax_float = None # type: ignore with_descriptors.minmax_float = object() # type: ignore with_descriptors.minmax_float = cast(_HasTagAndGet[float], _) -with_descriptors.minmax_float = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.minmax_float = cast( # type: ignore _HasTagAndGet[None], _ ) with_descriptors.minmax_float = cast(_HasTagAndGet[object], _) # type: ignore @@ -353,10 +353,10 @@ class WithDescriptorsStrict(Strict): with_descriptors.minmax_int = 0 with_descriptors.minmax_int = "0" with_descriptors.minmax_int = 0.0 -with_descriptors.minmax_int = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.minmax_int = None # type: ignore with_descriptors.minmax_int = object() # type: ignore with_descriptors.minmax_int = cast(_HasTagAndGet[int], _) -with_descriptors.minmax_int = cast(_HasTagAndGet[None], _) # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy +with_descriptors.minmax_int = cast(_HasTagAndGet[None], _) # type: ignore with_descriptors.minmax_int = cast(_HasTagAndGet[object], _) # type: ignore with_descriptors.minmax_int_none = 0