mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-09-19 01:33:17 +08:00
openpyxl: type tagname, namespace and __doc__ ClassVar and params (#10308)
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
# These tests are essentially a mirror of check_base_descriptors
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Union, cast
|
||||
from typing import Union, cast
|
||||
from typing_extensions import Literal, assert_type
|
||||
|
||||
from openpyxl.descriptors import Strict
|
||||
from openpyxl.descriptors.nested import ( # EmptyTag,
|
||||
from openpyxl.descriptors.nested import (
|
||||
EmptyTag,
|
||||
Nested,
|
||||
NestedBool,
|
||||
@@ -32,7 +32,7 @@ element: _HasTagAndGet[str] = Element("")
|
||||
|
||||
|
||||
class WithDescriptors(Serialisable):
|
||||
descriptor = Nested[str]()
|
||||
descriptor = Nested(expected_type=str)
|
||||
|
||||
set_tuple = NestedSet(values=("a", 1, 0.0))
|
||||
set_list = NestedSet(values=["a", 1, 0.0])
|
||||
@@ -130,7 +130,7 @@ with_descriptors = WithDescriptors()
|
||||
|
||||
# Test with missing subclass
|
||||
class NotSerialisable:
|
||||
descriptor = Nested[Any]()
|
||||
descriptor = Nested(expected_type=object)
|
||||
|
||||
|
||||
NotSerialisable().descriptor = None # type: ignore
|
||||
@@ -138,7 +138,7 @@ NotSerialisable().descriptor = None # type: ignore
|
||||
|
||||
# Test with Strict subclass
|
||||
class WithDescriptorsStrict(Strict):
|
||||
descriptor = Nested[Any]()
|
||||
descriptor = Nested(expected_type=object)
|
||||
|
||||
|
||||
WithDescriptorsStrict().descriptor = None
|
||||
|
||||
Reference in New Issue
Block a user