mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-10-31 00:59:20 +00:00 
			
		
		
		
	tests: do not remove containers on host
This commit is contained in:
		| @@ -296,14 +296,6 @@ def restore_urllib_dns_resolver(getaddrinfo_func): | |||||||
|     socket.getaddrinfo = getaddrinfo_func |     socket.getaddrinfo = getaddrinfo_func | ||||||
|  |  | ||||||
|  |  | ||||||
| def remove_all_containers(): |  | ||||||
|     for container in docker_client.containers.list(all=True): |  | ||||||
|         if PYTEST_RUNNING_IN_CONTAINER and container.name == test_container: |  | ||||||
|             continue  # pytest is running within a Docker container, so we do not want to remove that particular container |  | ||||||
|         logging.info(f"removing container {container.name}") |  | ||||||
|         container.remove(v=True, force=True) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def get_nginx_conf_from_container(container): | def get_nginx_conf_from_container(container): | ||||||
|     """ |     """ | ||||||
|     return the nginx /etc/nginx/conf.d/default.conf file content from a container |     return the nginx /etc/nginx/conf.d/default.conf file content from a container | ||||||
| @@ -465,7 +457,6 @@ class DockerComposer(contextlib.AbstractContextManager): | |||||||
|         self._down() |         self._down() | ||||||
|         if docker_compose_file is None: |         if docker_compose_file is None: | ||||||
|             return |             return | ||||||
|         remove_all_containers() |  | ||||||
|         docker_compose_up(docker_compose_file) |         docker_compose_up(docker_compose_file) | ||||||
|         self._networks = connect_to_all_networks() |         self._networks = connect_to_all_networks() | ||||||
|         wait_for_nginxproxy_to_be_ready() |         wait_for_nginxproxy_to_be_ready() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user