12
12
sys .path .append ("." )
13
13
sys .path .append ("tests" )
14
14
15
- # 3rd partys
15
+ # 3rd party
16
16
import discover_demo_module
17
17
18
18
@@ -28,18 +28,22 @@ def test_discover():
28
28
29
29
def test_discover_function_only ():
30
30
# 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
+ ]
35
37
36
38
37
39
def test_discover_class_only ():
38
40
# 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
+ ]
43
47
44
48
45
49
def test_discover_hasattr ():
@@ -74,16 +78,19 @@ def raises_attribute_error(obj, **kwargs):
74
78
)
75
79
76
80
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
+ )
87
94
def test_discover_errors (obj , expects ):
88
95
with expects :
89
96
discover (obj )
0 commit comments