Browse Source

tests: Reduce scope of `docker_compose` fixture (and friends)

This makes it possible to bring up different compose files for
different tests in the same test module.

This change does not negatively affect performance because the fixture
is a no-op if the docker compose filename is unchanged between tests.
Richard Hansen 2 years ago
parent
commit
b5a54ac219
1 changed files with 3 additions and 3 deletions
  1. 3 3
      test/conftest.py

+ 3 - 3
test/conftest.py

@@ -323,7 +323,7 @@ def wait_for_nginxproxy_to_be_ready():
             break
             break
 
 
 
 
-@pytest.fixture(scope="module")
+@pytest.fixture
 def docker_compose_file(request):
 def docker_compose_file(request):
     """Fixture naming the docker-compose file to consider.
     """Fixture naming the docker-compose file to consider.
 
 
@@ -463,14 +463,14 @@ def ca_root_certificate():
     return CA_ROOT_CERTIFICATE
     return CA_ROOT_CERTIFICATE
 
 
 
 
-@pytest.fixture(scope="module")
+@pytest.fixture
 def monkey_patched_dns():
 def monkey_patched_dns():
     original_dns_resolver = monkey_patch_urllib_dns_resolver()
     original_dns_resolver = monkey_patch_urllib_dns_resolver()
     yield
     yield
     restore_urllib_dns_resolver(original_dns_resolver)
     restore_urllib_dns_resolver(original_dns_resolver)
 
 
 
 
-@pytest.fixture(scope="module")
+@pytest.fixture
 def docker_compose(monkey_patched_dns, docker_composer, docker_compose_file):
 def docker_compose(monkey_patched_dns, docker_composer, docker_compose_file):
     """Ensures containers described in a docker compose file are started.
     """Ensures containers described in a docker compose file are started.