mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Fix test
This commit is contained in:
@@ -593,8 +593,9 @@ def _random_choice(sequences):
|
||||
def _dataclass(value, arguments, callback):
|
||||
"""
|
||||
dataclass decorator can be called 2 times with different arguments. One to
|
||||
customize it dataclass(eq=True) and another one with the class to
|
||||
transform.
|
||||
customize it dataclass(eq=True) and another one with the class to transform.
|
||||
|
||||
It supports dataclass, dataclass_transform and attrs.
|
||||
"""
|
||||
for c in _follow_param(value.inference_state, arguments, 0):
|
||||
if c.is_class():
|
||||
|
||||
@@ -509,6 +509,10 @@ ids = [
|
||||
def test_extensions_dataclass_transform_signature(
|
||||
Script, skip_pre_python37, start, start_params, include_params
|
||||
):
|
||||
has_typing_ext = bool(Script('import typing_extensions').infer())
|
||||
if not has_typing_ext:
|
||||
raise pytest.skip("typing_extensions needed in target environment to run this test")
|
||||
|
||||
code = dedent(
|
||||
"""
|
||||
name: str
|
||||
@@ -596,7 +600,8 @@ def test_dataclass_transform_signature(
|
||||
z = 5
|
||||
@define
|
||||
class X(Y):'''), ['y']],
|
||||
]
|
||||
],
|
||||
ids=["define", "frozen", "define_customized", "define_subclass", "define_both"]
|
||||
)
|
||||
def test_attrs_signature(Script, skip_pre_python37, start, start_params):
|
||||
has_attrs = bool(Script('import attrs').infer())
|
||||
|
||||
Reference in New Issue
Block a user