瀏覽代碼

fix: Don't connect pytest container to networks when using host network

This is not compatible or required, since host networking is no longer isolated to container networks only.
polarathene 3 年之前
父節點
當前提交
0e5d97a268
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      test/conftest.py

+ 4 - 0
test/conftest.py

@@ -362,6 +362,10 @@ def connect_to_network(network):
         # figure out our container networks
         my_networks = list(my_container.attrs["NetworkSettings"]["Networks"].keys())
 
+        # If the pytest container is using host networking, it cannot connect to container networks (not required with host network) 
+        if 'host' in my_networks:
+            return None
+
         # make sure our container is connected to the nginx-proxy's network
         if network not in my_networks:
             logging.info(f"Connecting to docker network: {network.name}")