@@ -22,7 +22,8 @@ def check_function(context: CheckContext) -> CheckResult:
2222
2323 # Test that result gets tags
2424 conf = CheckConfig (raise_exceptions = False )
25- result = check_function (None , conf )
25+ context = CheckContext (client = None , conf = conf )
26+ result = check_function (context )
2627 assert result .tags == {"tag1" , "tag2" }
2728 assert result .title == "check_function"
2829 assert result .description == "Test check function."
@@ -42,7 +43,8 @@ def check_function(context: CheckContext) -> CheckResult:
4243
4344 # Test that result gets empty tags
4445 conf = CheckConfig (raise_exceptions = False )
45- result = check_function (None , conf )
46+ context = CheckContext (client = None , conf = conf )
47+ result = check_function (context )
4648 assert result .tags == set ()
4749
4850
@@ -58,7 +60,8 @@ def check_function(context: CheckContext) -> list[CheckResult]:
5860 ]
5961
6062 conf = CheckConfig (raise_exceptions = False )
61- results = check_function (None , conf )
63+ context = CheckContext (client = None , conf = conf )
64+ results = check_function (context )
6265
6366 # All results should have tags
6467 assert all (r .tags == {"tag1" } for r in results )
@@ -141,10 +144,12 @@ def test_func(context):
141144
142145 # Test include tags matching
143146 conf_include = CheckConfig (include_tags = {"crud" })
144- result = test_func (None , conf_include ) # Call with decorator signature
147+ context_include = CheckContext (client = None , conf = conf_include )
148+ result = test_func (context_include ) # Call with decorator signature
145149 assert result .status .name == "SUCCESS"
146150
147151 # Test exclude tags matching
148152 conf_exclude = CheckConfig (exclude_tags = {"crud" })
149- result = test_func (None , conf_exclude ) # Call with decorator signature
153+ context_exclude = CheckContext (client = None , conf = conf_exclude )
154+ result = test_func (context_exclude ) # Call with decorator signature
150155 assert result .status .name == "SKIPPED"
0 commit comments