From 5f1d3f834e9e2d91b44a83a6363880babc381e1d Mon Sep 17 00:00:00 2001 From: Nicholas Cilfone Date: Mon, 5 Apr 2021 15:46:29 -0400 Subject: [PATCH 1/4] adding tests for coverage --- spock/backend/attr/payload.py | 2 +- tests/attr/test_all_attr.py | 18 ++++++++++++++++++ tests/debug/debug.yaml | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/spock/backend/attr/payload.py b/spock/backend/attr/payload.py index bef0e555..adb8cdd8 100644 --- a/spock/backend/attr/payload.py +++ b/spock/backend/attr/payload.py @@ -67,7 +67,7 @@ def _update_payload(base_payload, input_classes, payload): if isinstance(values, list): # Check for incorrect specific override of global def if keys not in attr_fields: - raise TypeError(f'Referring to a class space {keys} that is undefined') + raise ValueError(f'Referring to a class space {keys} that is undefined') # We are in a repeated class def # Raise if the key set is different from the defined set (i.e. incorrect arguments) key_set = set(list(chain(*[list(val.keys()) for val in values]))) diff --git a/tests/attr/test_all_attr.py b/tests/attr/test_all_attr.py index 33f84032..8107130e 100644 --- a/tests/attr/test_all_attr.py +++ b/tests/attr/test_all_attr.py @@ -438,6 +438,24 @@ def test_type_unknown(self, monkeypatch): ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, desc='Test Builder') +class TestUnknownClassParameterArg: + def test_class_parameter_unknown(self, monkeypatch): + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test_class_incorrect.yaml']) + with pytest.raises(ValueError): + ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, desc='Test Builder') + + +class TestUnknownClassArg: + def test_class_unknown(self, monkeypatch): + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test_missing_class.yaml']) + with pytest.raises(ValueError): + ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, desc='Test Builder') + + class TestConfigCycles: """Checks the raise for cyclical dependencies""" def test_config_cycles(self, monkeypatch): diff --git a/tests/debug/debug.yaml b/tests/debug/debug.yaml index 941d8117..31b80fa7 100644 --- a/tests/debug/debug.yaml +++ b/tests/debug/debug.yaml @@ -44,8 +44,12 @@ Test: # one: 18 # flipper: false nested_list: NestedListStuff +# does_not_exist: 10 # new_choice: pear +Gorf: + funny: 12 + NestedListStuff: - maybe: 10 more: hello From 5777db35493dee346b24c66d53fe9181db0fb212 Mon Sep 17 00:00:00 2001 From: Nicholas Cilfone Date: Mon, 5 Apr 2021 15:46:34 -0400 Subject: [PATCH 2/4] adding tests for coverage --- tests/conf/yaml/test_class_incorrect.yaml | 4 ++++ tests/conf/yaml/test_missing_class.yaml | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 tests/conf/yaml/test_class_incorrect.yaml create mode 100644 tests/conf/yaml/test_missing_class.yaml diff --git a/tests/conf/yaml/test_class_incorrect.yaml b/tests/conf/yaml/test_class_incorrect.yaml new file mode 100644 index 00000000..50819562 --- /dev/null +++ b/tests/conf/yaml/test_class_incorrect.yaml @@ -0,0 +1,4 @@ +# include another file +config: [test.yaml] +TypeConfig: + not_real: 10 \ No newline at end of file diff --git a/tests/conf/yaml/test_missing_class.yaml b/tests/conf/yaml/test_missing_class.yaml new file mode 100644 index 00000000..ed17afe5 --- /dev/null +++ b/tests/conf/yaml/test_missing_class.yaml @@ -0,0 +1,4 @@ +# include another file +config: [test.yaml] +MissingClass: + not_real: 10 \ No newline at end of file From 0093d9be15a2d418c4bcd7d00e2e79a27ac9770c Mon Sep 17 00:00:00 2001 From: Nicholas Cilfone Date: Mon, 5 Apr 2021 17:09:28 -0400 Subject: [PATCH 3/4] adding tests for coverage --- spock/backend/attr/typed.py | 52 +++++-- tests/{attr => attr_tests}/__init__.py | 0 .../{attr => attr_tests}/attr_configs_test.py | 5 + tests/{attr => attr_tests}/test_all_attr.py | 46 ++++++- .../yaml/test_incorrect_repeated_class.yaml | 7 + tests/conf/yaml/test_wrong_class_enum.yaml | 4 + tests/debug/debug.py | 4 +- tests/debug/debug.yaml | 20 ++- tests/debug/params/first.py | 128 +++++++++--------- 9 files changed, 175 insertions(+), 91 deletions(-) rename tests/{attr => attr_tests}/__init__.py (100%) rename tests/{attr => attr_tests}/attr_configs_test.py (99%) rename tests/{attr => attr_tests}/test_all_attr.py (95%) create mode 100644 tests/conf/yaml/test_incorrect_repeated_class.yaml create mode 100644 tests/conf/yaml/test_wrong_class_enum.yaml diff --git a/spock/backend/attr/typed.py b/spock/backend/attr/typed.py index 7c88198a..f201b5e0 100644 --- a/spock/backend/attr/typed.py +++ b/spock/backend/attr/typed.py @@ -28,6 +28,21 @@ def __new__(cls, x): return super().__new__(cls, x) +def _get_name_py_version(typed): + """Gets the name of the type depending on the python version + + *Args*: + + typed: the type of the parameter + + *Returns*: + + name of the type + + """ + return typed._name if hasattr(typed, '_name') else typed.__name__ + + def _extract_base_type(typed): """Extracts the name of the type from a _GenericAlias @@ -43,10 +58,7 @@ def _extract_base_type(typed): name of type """ if hasattr(typed, '__args__'): - if minor < 7: - name = typed.__name__ - else: - name = typed._name + name = _get_name_py_version(typed=typed) bracket_val = f"{name}[{_extract_base_type(typed.__args__[0])}]" return bracket_val else: @@ -229,8 +241,6 @@ def _in_type(instance, attribute, value, options): *Returns*: """ - if type(options) not in [list, tuple, EnumMeta]: - raise TypeError(f'options argument must be of type List, Tuple, or Enum -- given {type(options)}') if type(value) not in options: raise ValueError(f'{attribute.name} must be in {options}') @@ -348,18 +358,32 @@ def _handle_optional_typing(typed): type_args = typed.__args__ # Optional[X] has type_args = (X, None) and is equal to Union[X, None] if (len(type_args) == 2) and (typed == Union[type_args[0], None]): - # Since this is true we need to strip out the OG type - # Grab all the types that are not NoneType and collapse to a list - type_list = [val for val in type_args if val is not type(None)] - if len(type_list) > 1: - raise TypeError(f"Passing multiple subscript types to GenericAlias is not supported: {type_list}") - else: - typed = type_list[0] + typed = type_args[0] # Set the optional flag to true optional = True return typed, optional +def _check_generic_recursive_single_type(typed): + """Checks generics for the single types -- mixed types of generics are not allowed + + *Args*: + + typed: type + + *Returns*: + + """ + # Check if it has __args__ to look for optionality as it is a GenericAlias + if hasattr(typed, '__args__'): + if len(set(typed.__args__)) > 1: + type_list = [str(val) for val in typed.__args__] + raise TypeError(f"Passing multiple different subscript types to GenericAlias is not supported: {type_list}") + else: + for val in typed.__args__: + _check_generic_recursive_single_type(typed=val) + + def katra(typed, default=None): """Public interface to create a katra @@ -380,6 +404,8 @@ def katra(typed, default=None): """ # Handle optionals typed, optional = _handle_optional_typing(typed) + # Check generic types for consistent types + _check_generic_recursive_single_type(typed) # We need to check if the type is a _GenericAlias so that we can handle subscripted general types # If it is subscript typed it will not be T which python uses as a generic type name if isinstance(typed, _GenericAlias) and (not isinstance(typed.__args__[0], TypeVar)): diff --git a/tests/attr/__init__.py b/tests/attr_tests/__init__.py similarity index 100% rename from tests/attr/__init__.py rename to tests/attr_tests/__init__.py diff --git a/tests/attr/attr_configs_test.py b/tests/attr_tests/attr_configs_test.py similarity index 99% rename from tests/attr/attr_configs_test.py rename to tests/attr_tests/attr_configs_test.py index 79493165..82db5889 100644 --- a/tests/attr/attr_configs_test.py +++ b/tests/attr_tests/attr_configs_test.py @@ -16,6 +16,11 @@ class StrChoice(Enum): option_2 = 'option_2' +class FailedEnum(Enum): + str_type = 'hello' + float_type = 10.0 + + class IntChoice(Enum): option_1 = 10 option_2 = 20 diff --git a/tests/attr/test_all_attr.py b/tests/attr_tests/test_all_attr.py similarity index 95% rename from tests/attr/test_all_attr.py rename to tests/attr_tests/test_all_attr.py index 8107130e..de8ef7c8 100644 --- a/tests/attr/test_all_attr.py +++ b/tests/attr_tests/test_all_attr.py @@ -8,7 +8,7 @@ import pytest from spock.builder import ConfigArgBuilder from spock.config import isinstance_spock -from tests.attr.attr_configs_test import * +from tests.attr_tests.attr_configs_test import * import sys @@ -456,6 +456,50 @@ def test_class_unknown(self, monkeypatch): ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, desc='Test Builder') +class TestWrongRepeatedClass: + def test_class_unknown(self, monkeypatch): + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test_incorrect_repeated_class.yaml']) + with pytest.raises(ValueError): + ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, desc='Test Builder') + + +class TestEnumMixedFail: + def test_enum_mixed_fail(self, monkeypatch): + with monkeypatch.context() as m: + with pytest.raises(TypeError): + @spock + class EnumFail: + choice_mixed: FailedEnum + + +class TestIncorrectType: + def test_incorrect_type(self, monkeypatch): + with monkeypatch.context() as m: + with pytest.raises(TypeError): + @spock + class TypeFail: + weird_type: lambda x: x + + +class TestEnumClassMissing: + def test_enum_class_missing(self, monkeypatch): + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test_wrong_class_enum.yaml']) + with pytest.raises(ValueError): + ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, desc='Test Builder') + + +class TestMixedGeneric: + def test_mixed_generic(self, monkeypatch): + with monkeypatch.context() as m: + with pytest.raises(TypeError): + @spock + class GenericFail: + generic_fail: Tuple[List[int], List[int], int] + class TestConfigCycles: """Checks the raise for cyclical dependencies""" def test_config_cycles(self, monkeypatch): diff --git a/tests/conf/yaml/test_incorrect_repeated_class.yaml b/tests/conf/yaml/test_incorrect_repeated_class.yaml new file mode 100644 index 00000000..0ebda37c --- /dev/null +++ b/tests/conf/yaml/test_incorrect_repeated_class.yaml @@ -0,0 +1,7 @@ +# include another file +config: [test.yaml] +NestedListStuff: + - foo: 10 + two: hello + - foo: 20 + two: bye \ No newline at end of file diff --git a/tests/conf/yaml/test_wrong_class_enum.yaml b/tests/conf/yaml/test_wrong_class_enum.yaml new file mode 100644 index 00000000..5256acbd --- /dev/null +++ b/tests/conf/yaml/test_wrong_class_enum.yaml @@ -0,0 +1,4 @@ +# include another file +config: [test.yaml] +# Class Enum +class_enum: WhoAmI \ No newline at end of file diff --git a/tests/debug/debug.py b/tests/debug/debug.py index 70fa5fad..69dab87e 100644 --- a/tests/debug/debug.py +++ b/tests/debug/debug.py @@ -7,7 +7,7 @@ from spock.builder import ConfigArgBuilder from spock.config import isinstance_spock from params.first import Test -from params.first import NestedListStuff, Stuff, OtherStuff +# from params.first import NestedListStuff, Stuff, OtherStuff from spock.backend.attr.typed import SavePath import pickle from argparse import Namespace @@ -102,7 +102,7 @@ def main(): attrs_class = ConfigArgBuilder( - Test, NestedListStuff, + Test, desc='I am a description' ).save(user_specified_path='/tmp').generate() # with open('/tmp/debug.pickle', 'wb') as fid: diff --git a/tests/debug/debug.yaml b/tests/debug/debug.yaml index 31b80fa7..09fe8186 100644 --- a/tests/debug/debug.yaml +++ b/tests/debug/debug.yaml @@ -35,26 +35,24 @@ #fail: [[1, 2], [3, 4]] #flipper: True #nested_list: NestedListStuff -test: [ 1, 2 ] +#test: [ 1, 2 ] Test: # test: [ 1, 2 ] -# fail: [ [ 1, 2 ], [ 3, 4 ] ] + fail: [ [ 1, 2 ], [ 3, 4 ], 10] # most_broken: Stuff # one: 18 # flipper: false - nested_list: NestedListStuff +# nested_list: NestedListStuff +# ummm: 10 # does_not_exist: 10 # new_choice: pear -Gorf: - funny: 12 - -NestedListStuff: - - maybe: 10 - more: hello - - maybe: 20 - more: bye +#NestedListStuff: +# - maybe: 10 +# more: hello +# - maybe: 20 +# more: bye # borken: RepeatStuff ##ccccombo_breaker: 10 diff --git a/tests/debug/params/first.py b/tests/debug/params/first.py index 76f63100..78895b6d 100644 --- a/tests/debug/params/first.py +++ b/tests/debug/params/first.py @@ -7,67 +7,67 @@ from .second import Choice # -class Choice(Enum): - """Blah - - Attributes: - pear: help pears - banana: help bananas - - """ - pear = 'pear' - banana = 'banana' - - -@spock -class OtherStuff: - """Other stuff class - - Attributes: - three: heahadsf - four: asdfjhasdlkf - - """ - three: int - four: str - - -@spock -class Stuff: - """Stuff class - - Attributes: - one: help - two: teadsfa - - """ - one: int - two: str - - -class ClassStuff(Enum): - """Class enum - - Attributes: - other_stuff: OtherStuff class - stuff: Stuff class - - """ - other_stuff = OtherStuff - stuff = Stuff - - -@spock -class NestedListStuff: - """Class enum - - Attributes: - maybe: some val - more: some other value - - """ - maybe: int - more: str +# class Choice(Enum): +# """Blah +# +# Attributes: +# pear: help pears +# banana: help bananas +# +# """ +# pear = 'pear' +# banana = 'banana' +# +# +# @spock +# class OtherStuff: +# """Other stuff class +# +# Attributes: +# three: heahadsf +# four: asdfjhasdlkf +# +# """ +# three: int +# four: str +# +# +# @spock +# class Stuff: +# """Stuff class +# +# Attributes: +# one: help +# two: teadsfa +# +# """ +# one: int +# two: str +# +# +# class ClassStuff(Enum): +# """Class enum +# +# Attributes: +# other_stuff: OtherStuff class +# stuff: Stuff class +# +# """ +# other_stuff = OtherStuff +# stuff = Stuff +# +# +# @spock +# class NestedListStuff: +# """Class enum +# +# Attributes: +# maybe: some val +# more: some other value +# +# """ +# maybe: int +# more: str @spock @@ -86,11 +86,11 @@ class Test: nested_list: Repeated list of a class type """ # new_choice: Choice - # fail: Tuple[Tuple[int, int], Tuple[int, int]] - test: List[int] + # fail: Tuple[List[int], List[str]] + test: Optional[List[int]] # fail: List[List[int]] # flipper: bool # most_broken: ClassStuff # one: int - nested_list: List[NestedListStuff] + # nested_list: List[NestedListStuff] From c6fe7f313878ba650bcd86839b1f77cc82d7f075 Mon Sep 17 00:00:00 2001 From: Nicholas Cilfone Date: Tue, 6 Apr 2021 11:58:56 -0400 Subject: [PATCH 4/4] more tests. removed some vestigial code --- spock/backend/attr/typed.py | 5 +-- spock/builder.py | 20 +++++------ tests/attr_tests/test_all_attr.py | 55 ++++++++++++++++++++++++++++- tests/conf/yaml/test_save_path.yaml | 3 ++ tests/debug/debug.py | 10 ++++-- tests/debug/debug.yaml | 18 +++++----- tests/debug/params/first.py | 30 ++++++++-------- 7 files changed, 98 insertions(+), 43 deletions(-) create mode 100644 tests/conf/yaml/test_save_path.yaml diff --git a/spock/backend/attr/typed.py b/spock/backend/attr/typed.py index f201b5e0..fbc14b66 100644 --- a/spock/backend/attr/typed.py +++ b/spock/backend/attr/typed.py @@ -304,10 +304,7 @@ def _type_katra(typed, default=None, optional=False): if isinstance(typed, type): name = typed.__name__ elif isinstance(typed, _GenericAlias): - if minor < 7: - name = typed.__name__ - else: - name = typed._name + name = _get_name_py_version(typed=typed) else: raise TypeError('Encountered an uxpected type in _type_katra') special_key = None diff --git a/spock/builder.py b/spock/builder.py index a7cd9de8..f53ac857 100644 --- a/spock/builder.py +++ b/spock/builder.py @@ -10,7 +10,6 @@ from spock.backend.attr.builder import AttrBuilder from spock.backend.attr.payload import AttrPayload from spock.backend.attr.saver import AttrSaver -from spock.backend.base import Spockspace from spock.utils import check_payload_overwrite from spock.utils import deep_payload_update @@ -61,22 +60,17 @@ def __call__(self, *args, **kwargs): """ return ConfigArgBuilder(*args, **kwargs) - def generate(self, unclass=False): + def generate(self): """Generate method that returns the actual argument namespace *Args*: - unclass: swaps the backend attr class type for dictionaries *Returns*: argument namespace consisting of all config classes """ - if unclass: - self._arg_namespace = Spockspace(**{k: Spockspace(**{ - val.name: getattr(v, val.name) for val in v.__attrs_attrs__}) - for k, v in self._arg_namespace.__dict__.items()}) return self._arg_namespace @staticmethod @@ -95,11 +89,15 @@ def _set_backend(args): # Gather if all attr backend type_attrs = all([attr.has(arg) for arg in args]) if not type_attrs: - raise TypeError("*args must be of all attrs backend") - elif type_attrs: - backend = {'builder': AttrBuilder, 'payload': AttrPayload, 'saver': AttrSaver} + which_idx = [attr.has(arg) for arg in args].index(False) + if hasattr(args[which_idx], '__name__'): + raise TypeError(f"*args must be of all attrs backend -- missing a @spock decorator on class " + f"{args[which_idx].__name__}") + else: + raise TypeError(f"*args must be of all attrs backend -- invalid type " + f"{type(args[which_idx])}") else: - raise TypeError("*args must be of all attrs backend") + backend = {'builder': AttrBuilder, 'payload': AttrPayload, 'saver': AttrSaver} return backend def _get_config_paths(self): diff --git a/tests/attr_tests/test_all_attr.py b/tests/attr_tests/test_all_attr.py index de8ef7c8..bfac9853 100644 --- a/tests/attr_tests/test_all_attr.py +++ b/tests/attr_tests/test_all_attr.py @@ -5,6 +5,7 @@ from attr.exceptions import FrozenInstanceError import glob +import os import pytest from spock.builder import ConfigArgBuilder from spock.config import isinstance_spock @@ -190,6 +191,16 @@ def arg_builder(monkeypatch): return config.generate() +class TestHelp: + def test_help(self, monkeypatch): + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test.yaml', '--help']) + with pytest.raises(SystemExit): + config = ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, TypeOptConfig, desc='Test Builder') + return config.generate() + + class TestFrozen: """Testing the frozen state of the spock config object""" @staticmethod @@ -389,6 +400,17 @@ def arg_builder(monkeypatch): return config.generate() +class TestNonAttrs: + def test_non_attrs_fail(self, monkeypatch): + with monkeypatch.context() as m: + with pytest.raises(TypeError): + class AttrFail: + failed_attr: int + config = ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, TypeOptConfig, AttrFail, + configs=['./tests/conf/yaml/test.yaml']) + return config.generate() + + class TestChoiceRaises: """Check all inherited types work as expected """ def test_choice_raise(self, monkeypatch): @@ -548,9 +570,40 @@ def test_yaml_file_writer(self, monkeypatch, tmp_path): assert len(list(tmp_path.iterdir())) == 1 +class TestYAMLWriterSavePath: + def test_yaml_file_writer_save_path(self, monkeypatch): + """Test the YAML writer works correctly""" + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test_save_path.yaml']) + config = ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, TypeOptConfig, desc='Test Builder') + # Test the chained version + config_values = config.save(file_extension='.yaml', file_name='pytest').generate() + check_path = str(config_values.TypeConfig.save_path) + '/pytest.spock.cfg.yaml' + fname = glob.glob(check_path)[0] + with open(fname, 'r') as fin: + print(fin.read()) + assert os.path.exists(check_path) + # Clean up if assert is good + if os.path.exists(check_path): + os.remove(check_path) + + +class TestYAMLWriterNoPath: + def test_yaml_file_writer_no_path(self, monkeypatch): + """Test the YAML writer works correctly""" + with monkeypatch.context() as m: + m.setattr(sys, 'argv', ['', '--config', + './tests/conf/yaml/test.yaml']) + with pytest.raises(ValueError): + config = ConfigArgBuilder(TypeConfig, NestedStuff, NestedListStuff, TypeOptConfig, desc='Test Builder') + # Test the chained version + config.save(file_extension='.yaml', file_name='pytest').generate() + + class TestWritePathRaise: def test_yaml_file_writer(self, monkeypatch, tmp_path): - """Test the YAML writer works correctly""" + """Test the YAML writer fails correctly when create path isn't set""" with monkeypatch.context() as m: m.setattr(sys, 'argv', ['', '--config', './tests/conf/yaml/test.yaml']) diff --git a/tests/conf/yaml/test_save_path.yaml b/tests/conf/yaml/test_save_path.yaml new file mode 100644 index 00000000..13e8f86f --- /dev/null +++ b/tests/conf/yaml/test_save_path.yaml @@ -0,0 +1,3 @@ +# include another file +config: [test.yaml] +save_path: /tmp \ No newline at end of file diff --git a/tests/debug/debug.py b/tests/debug/debug.py index 69dab87e..5b50be03 100644 --- a/tests/debug/debug.py +++ b/tests/debug/debug.py @@ -7,7 +7,7 @@ from spock.builder import ConfigArgBuilder from spock.config import isinstance_spock from params.first import Test -# from params.first import NestedListStuff, Stuff, OtherStuff +from params.first import NestedListStuff from spock.backend.attr.typed import SavePath import pickle from argparse import Namespace @@ -100,11 +100,15 @@ # ccccombo_breaker: int +class Hello: + new: int + + def main(): attrs_class = ConfigArgBuilder( - Test, + Test, NestedListStuff, ["names"], desc='I am a description' - ).save(user_specified_path='/tmp').generate() + ).save(user_specified_path='/tmp').generate(unclass=True) # with open('/tmp/debug.pickle', 'wb') as fid: # pickle.dump(attrs_class, file=fid) diff --git a/tests/debug/debug.yaml b/tests/debug/debug.yaml index 09fe8186..a44854ad 100644 --- a/tests/debug/debug.yaml +++ b/tests/debug/debug.yaml @@ -38,21 +38,21 @@ #test: [ 1, 2 ] Test: -# test: [ 1, 2 ] - fail: [ [ 1, 2 ], [ 3, 4 ], 10] + test: [ 1, 2 ] + fail: [ [ 1, 2 ], [ 3, 4 ] ] # most_broken: Stuff -# one: 18 + one: 18 # flipper: false -# nested_list: NestedListStuff + nested_list: NestedListStuff # ummm: 10 # does_not_exist: 10 # new_choice: pear -#NestedListStuff: -# - maybe: 10 -# more: hello -# - maybe: 20 -# more: bye +NestedListStuff: + - maybe: 10 + more: hello + - maybe: 20 + more: bye # borken: RepeatStuff ##ccccombo_breaker: 10 diff --git a/tests/debug/params/first.py b/tests/debug/params/first.py index 78895b6d..8d46546c 100644 --- a/tests/debug/params/first.py +++ b/tests/debug/params/first.py @@ -57,17 +57,17 @@ # stuff = Stuff # # -# @spock -# class NestedListStuff: -# """Class enum -# -# Attributes: -# maybe: some val -# more: some other value -# -# """ -# maybe: int -# more: str +@spock +class NestedListStuff: + """Class enum + + Attributes: + maybe: some val + more: some other value + + """ + maybe: int + more: str @spock @@ -86,11 +86,11 @@ class Test: nested_list: Repeated list of a class type """ # new_choice: Choice - # fail: Tuple[List[int], List[str]] + # fail: Tuple[List[int], List[int]] test: Optional[List[int]] - # fail: List[List[int]] + fail: List[List[int]] # flipper: bool # most_broken: ClassStuff - # one: int - # nested_list: List[NestedListStuff] + one: int + nested_list: List[NestedListStuff]