@@ -357,7 +357,7 @@ def id_netbox_service(fixture_value):
357
357
358
358
359
359
@pytest .fixture (scope = "session" )
360
- def netbox_service (
360
+ def docker_netbox_service (
361
361
pytestconfig , docker_ip , docker_services , request ,
362
362
):
363
363
"""Get the netbox service to test against.
@@ -411,23 +411,23 @@ def netbox_service(
411
411
docker_services .wait_until_responsive (
412
412
timeout = 300.0 , pause = 1 , check = lambda : netbox_is_responsive (url )
413
413
)
414
- nb_api = pynetbox .api (url , token = "0123456789abcdef0123456789abcdef01234567" )
415
414
416
415
return {
417
416
"url" : url ,
418
417
"netbox_version" : netbox_integration_version ,
419
- "api" : nb_api ,
420
418
}
421
419
422
420
423
- @pytest .fixture (scope = "session" , autouse = True )
424
- def api (netbox_service ):
425
- return netbox_service ["api" ]
421
+ @pytest .fixture (scope = "session" )
422
+ def api (docker_netbox_service ):
423
+ return pynetbox .api (
424
+ docker_netbox_service ["url" ], token = "0123456789abcdef0123456789abcdef01234567"
425
+ )
426
426
427
427
428
428
@pytest .fixture (scope = "session" )
429
- def nb_version (netbox_service ):
430
- return netbox_service ["netbox_version" ]
429
+ def nb_version (docker_netbox_service ):
430
+ return docker_netbox_service ["netbox_version" ]
431
431
432
432
433
433
@pytest .fixture (scope = "session" )
@@ -469,12 +469,12 @@ def device_role(api):
469
469
470
470
def pytest_generate_tests (metafunc ):
471
471
"""Dynamically parametrize some functions based on args from the cli parser."""
472
- if "netbox_service " in metafunc .fixturenames :
473
- # parametrize the requested versions of netbox to the netbox_services fixture
472
+ if "docker_netbox_service " in metafunc .fixturenames :
473
+ # parametrize the requested versions of netbox to the docker_netbox_services fixture
474
474
# so that it will return a fixture for each of the versions requested
475
475
# individually rather than one fixture with multiple versions within it
476
476
metafunc .parametrize (
477
- "netbox_service " ,
477
+ "docker_netbox_service " ,
478
478
metafunc .config .getoption ("netbox_versions" ),
479
479
ids = id_netbox_service ,
480
480
indirect = True ,
0 commit comments