1212sys .path .append ("." )
1313sys .path .append ("tests" )
1414
15- # 3rd partys
15+ # 3rd party
1616import discover_demo_module
1717
1818
@@ -28,18 +28,22 @@ def test_discover():
2828
2929def test_discover_function_only ():
3030 # Alphabetical order regardless of order in the module.
31- assert discover (discover_demo_module , match_func = inspect .isfunction ) == [
32- discover_demo_module .submodule_a .bar ,
33- discover_demo_module .submodule_a .foo ,
34- ]
31+ assert discover (
32+ discover_demo_module , match_func = inspect .isfunction
33+ ) == [
34+ discover_demo_module .submodule_a .bar ,
35+ discover_demo_module .submodule_a .foo ,
36+ ]
3537
3638
3739def test_discover_class_only ():
3840 # Alphabetical order regardless of order in the module.
39- assert discover (discover_demo_module , match_func = inspect .isclass ) == [
40- discover_demo_module .submodule_b .Alice ,
41- discover_demo_module .submodule_b .Bob ,
42- ]
41+ assert discover (
42+ discover_demo_module , match_func = inspect .isclass
43+ ) == [
44+ discover_demo_module .submodule_b .Alice ,
45+ discover_demo_module .submodule_b .Bob ,
46+ ]
4347
4448
4549def test_discover_hasattr ():
@@ -74,16 +78,19 @@ def raises_attribute_error(obj, **kwargs):
7478 )
7579
7680
77- @pytest .mark .parametrize ("obj, expects" , [
78- raises_attribute_error ("abc" , id = "string" ),
79- raises_attribute_error (123 , id = "int" ),
80- raises_attribute_error (12.34 , id = "float" ),
81- raises_attribute_error ([1 , 2 , 3 ], id = "list" ),
82- raises_attribute_error ((1 , 2 , 3 ), id = "tuple" ),
83- raises_attribute_error ({1 , 2 , 3 }, id = "set" ),
84- raises_attribute_error ({"a" : 1 , "b" : 2 , "c" : 3 }, id = "dictionary" ),
85- pytest .param (HasPath , haspath_error , id = "HasPath" ),
86- ])
81+ @pytest .mark .parametrize (
82+ "obj, expects" ,
83+ [
84+ raises_attribute_error ("abc" , id = "string" ),
85+ raises_attribute_error (123 , id = "int" ),
86+ raises_attribute_error (12.34 , id = "float" ),
87+ raises_attribute_error ([1 , 2 , 3 ], id = "list" ),
88+ raises_attribute_error ((1 , 2 , 3 ), id = "tuple" ),
89+ raises_attribute_error ({1 , 2 , 3 }, id = "set" ),
90+ raises_attribute_error ({"a" : 1 , "b" : 2 , "c" : 3 }, id = "dictionary" ),
91+ pytest .param (HasPath , haspath_error , id = "HasPath" ),
92+ ]
93+ )
8794def test_discover_errors (obj , expects ):
8895 with expects :
8996 discover (obj )
0 commit comments