Skip to content

Commit 56b64d9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 82e049f commit 56b64d9

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

repo2docker/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
RBuildPack,
3838
)
3939
from .engine import BuildError, ContainerEngineException, ImageLoadError
40-
from .utils import ByteSpecification, R2dState, chdir, get_platform, get_free_port
40+
from .utils import ByteSpecification, R2dState, chdir, get_free_port, get_platform
4141

4242

4343
class Repo2Docker(Application):
@@ -744,7 +744,6 @@ def wait_for_container(self, container):
744744
if exit_code:
745745
sys.exit(exit_code)
746746

747-
748747
def find_image(self):
749748
# if this is a dry run it is Ok for dockerd to be unreachable so we
750749
# always return False for dry runs.

repo2docker/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
2-
import socket
32
import platform
43
import re
4+
import socket
55
import subprocess
66
import warnings
77
from contextlib import contextmanager
@@ -556,4 +556,4 @@ def get_free_port():
556556
s.bind(("", 0))
557557
port = s.getsockname()[1]
558558
s.close()
559-
return port
559+
return port

tests/registry/test_registry.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
from pathlib import Path
1+
import secrets
22
import subprocess
3+
import time
4+
from pathlib import Path
5+
36
import pytest
7+
import requests
8+
49
from repo2docker.__main__ import make_r2d
510
from repo2docker.utils import get_free_port
6-
import time
7-
import requests
8-
import secrets
911

1012
HERE = Path(__file__).parent
1113

14+
1215
@pytest.fixture
1316
def registry():
1417
port = get_free_port()
15-
cmd = [
16-
"docker", "run", "-it", "-p", f"{port}:5000", "registry:3.0.0-rc.3"
17-
]
18+
cmd = ["docker", "run", "-it", "-p", f"{port}:5000", "registry:3.0.0-rc.3"]
1819
proc = subprocess.Popen(cmd)
19-
health_url = f'http://localhost:{port}/v2'
20+
health_url = f"http://localhost:{port}/v2"
2021
# Wait for the registry to actually come up
2122
for i in range(10):
2223
try:
@@ -39,10 +40,7 @@ def registry():
3940

4041
def test_registry(registry):
4142
image_name = f"{registry}/{secrets.token_hex(8)}:latest"
42-
r2d = make_r2d([
43-
"--image", image_name,
44-
"--push", "--no-run", str(HERE)
45-
])
43+
r2d = make_r2d(["--image", image_name, "--push", "--no-run", str(HERE)])
4644

4745
r2d.start()
4846

0 commit comments

Comments
 (0)