resolves error with recent pytest:
==================================== ERRORS ====================================
____________ ERROR collecting s3tests/functional/test_s3_website.py ____________
'yield' keyword is allowed in fixtures, but not in tests (test_routing_generator)
use https://docs.pytest.org/en/7.1.x/example/parametrize.html instead to
generate a test_routing_generator() for each entry in ROUTING_RULES_TESTS
Signed-off-by: Casey Bodley <cbodley@redhat.com>
@pytest.mark.s3website_routing_rules
@pytest.mark.s3website
@pytest.mark.fails_on_dbstore
-def test_routing_generator():
- for t in ROUTING_RULES_TESTS:
- if 'xml' in t and 'RoutingRules' in t['xml'] and len(t['xml']['RoutingRules']) > 0:
- t['xml']['RoutingRules'] = common.trim_xml(t['xml']['RoutingRules'])
- yield routing_check, t
+@pytest.mark.parametrize('t', ROUTING_RULES_TESTS)
+def test_routing_generator(t):
+ if 'xml' in t and 'RoutingRules' in t['xml'] and len(t['xml']['RoutingRules']) > 0:
+ t['xml']['RoutingRules'] = common.trim_xml(t['xml']['RoutingRules'])
+ routing_check(t)