Skip to content

Commit

Permalink
Adjust docker port resolution to be more tolerant (podman-compose)
Browse files Browse the repository at this point in the history
  • Loading branch information
grant-zietsman authored and augi committed Sep 1, 2023
1 parent 052e08b commit 508b82d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pytest-docker
version = 2.0.0
version = 2.0.1
description = Simple pytest fixtures for Docker and Docker Compose based tests
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_docker/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def port_for(self, service, container_port):
endpoint = endpoint.split("\n")[-1]

# Usually, the IP address here is 0.0.0.0, so we don't use it.
match = int(endpoint.split(":", 1)[1])
match = int(endpoint.split(":", 1)[-1])

# Store it in cache in case we request it multiple times.
self._services.setdefault(service, {})[container_port] = match
Expand Down

0 comments on commit 508b82d

Please sign in to comment.