Skip to content

Commit

Permalink
tests: allow configuring smb port via env var (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- authored Nov 21, 2024
1 parent db185f3 commit 9faa452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions upath/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def smb_container():
container = "fsspec_smb"
stop_docker(container)
cfg = "-p -u 'testuser;testpass' -s 'home;/share;no;no;no;testuser'"
port = 445
port = int(os.environ.get("UPATH_TESTS_SMB_PORT", "445"))
img = f"docker run --name {container} --detach -p 139:139 -p {port}:445 dperson/samba" # noqa: E231 E501
cmd = f"{img} {cfg}"
try:
Expand All @@ -448,7 +448,7 @@ def smb_container():

@pytest.fixture
def smb_url(smb_container):
smb_url = "smb://{username}:{password}@{host}/home/"
smb_url = "smb://{username}:{password}@{host}:{port}/home/"
smb_url = smb_url.format(**smb_container)
return smb_url

Expand Down

0 comments on commit 9faa452

Please sign in to comment.