13
13
({"id" : "1" , "source" : "/" , "type" : "test" }, "specversion" ),
14
14
],
15
15
)
16
- def test_missing_required_attribute (attributes , missing_attribute ):
16
+ def test_missing_required_attribute (attributes , missing_attribute ) -> None :
17
17
with pytest .raises (ValueError ) as e :
18
18
CloudEvent (attributes )
19
19
@@ -27,15 +27,15 @@ def test_missing_required_attribute(attributes, missing_attribute):
27
27
(12 , "Attribute 'id' must be a string" ),
28
28
],
29
29
)
30
- def test_id_validation (id , error ):
30
+ def test_id_validation (id , error ) -> None :
31
31
with pytest .raises ((ValueError , TypeError )) as e :
32
32
CloudEvent ({"id" : id , "source" : "/" , "type" : "test" , "specversion" : "1.0" })
33
33
34
34
assert str (e .value ) == error
35
35
36
36
37
37
@pytest .mark .parametrize ("source,error" , [(123 , "Attribute 'source' must be a string" )])
38
- def test_source_validation (source , error ):
38
+ def test_source_validation (source , error ) -> None :
39
39
with pytest .raises ((ValueError , TypeError )) as e :
40
40
CloudEvent ({"id" : "1" , "source" : source , "type" : "test" , "specversion" : "1.0" })
41
41
@@ -49,7 +49,7 @@ def test_source_validation(source, error):
49
49
("1.4" , "Attribute 'specversion' must be '1.0'" ),
50
50
],
51
51
)
52
- def test_specversion_validation (specversion , error ):
52
+ def test_specversion_validation (specversion , error ) -> None :
53
53
with pytest .raises ((ValueError , TypeError )) as e :
54
54
CloudEvent (
55
55
{"id" : "1" , "source" : "/" , "type" : "test" , "specversion" : specversion }
@@ -68,7 +68,7 @@ def test_specversion_validation(specversion, error):
68
68
),
69
69
],
70
70
)
71
- def test_time_validation (time , error ):
71
+ def test_time_validation (time , error ) -> None :
72
72
with pytest .raises ((ValueError , TypeError )) as e :
73
73
CloudEvent (
74
74
{
@@ -93,7 +93,7 @@ def test_time_validation(time, error):
93
93
),
94
94
],
95
95
)
96
- def test_subject_validation (subject , error ):
96
+ def test_subject_validation (subject , error ) -> None :
97
97
with pytest .raises ((ValueError , TypeError )) as e :
98
98
CloudEvent (
99
99
{
@@ -118,7 +118,7 @@ def test_subject_validation(subject, error):
118
118
),
119
119
],
120
120
)
121
- def test_datacontenttype_validation (datacontenttype , error ):
121
+ def test_datacontenttype_validation (datacontenttype , error ) -> None :
122
122
with pytest .raises ((ValueError , TypeError )) as e :
123
123
CloudEvent (
124
124
{
@@ -143,7 +143,7 @@ def test_datacontenttype_validation(datacontenttype, error):
143
143
),
144
144
],
145
145
)
146
- def test_dataschema_validation (dataschema , error ):
146
+ def test_dataschema_validation (dataschema , error ) -> None :
147
147
with pytest .raises ((ValueError , TypeError )) as e :
148
148
CloudEvent (
149
149
{
0 commit comments