Skip to content

Commit 7b8db06

Browse files
committed
ruff fix for formats
1 parent 0416191 commit 7b8db06

File tree

8 files changed

+14
-21
lines changed

8 files changed

+14
-21
lines changed

core/testcontainers/core/waiting_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def wait_for_logs(
122122
if predicate_result:
123123
return duration
124124
if duration > timeout:
125-
raise TimeoutError(f"Container did not emit logs satisfying predicate in {timeout:.3f} " "seconds")
125+
raise TimeoutError(f"Container did not emit logs satisfying predicate in {timeout:.3f} seconds")
126126
if raise_on_exit:
127127
wrapped.reload()
128128
if wrapped.status not in _NOT_EXITED_STATUSES:

core/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ def _check_for_image(image_short_id: str, cleaned: bool) -> None:
4747
client = DockerClient()
4848
images = client.client.images.list()
4949
found = any(image.short_id.endswith(image_short_id) for image in images)
50-
assert found is not cleaned, f'Image {image_short_id} was {"found" if cleaned else "not found"}'
50+
assert found is not cleaned, f"Image {image_short_id} was {'found' if cleaned else 'not found'}"
5151

5252
return _check_for_image

core/tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def fake_cgroup(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Path:
6666
def test_get_running_container_id_empty_or_missing(fake_cgroup: Path) -> None:
6767
# non existing does not fail but is only none
6868
assert utils.get_running_in_container_id() is None
69-
fake_cgroup.write_text("12:devices:/system.slice/sshd.service\n" "13:cpuset:\n")
69+
fake_cgroup.write_text("12:devices:/system.slice/sshd.service\n13:cpuset:\n")
7070
# missing docker does also not fail
7171
assert utils.get_running_in_container_id() is None
7272

modules/azurite/testcontainers/azurite/__init__.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
self.account_name = account_name or os.environ.get("AZURITE_ACCOUNT_NAME", "devstoreaccount1")
6363
self.account_key = account_key or os.environ.get(
6464
"AZURITE_ACCOUNT_KEY",
65-
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/" "K1SZFPTOtr/KBHBeksoGMGw==",
65+
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==",
6666
)
6767

6868
raise_for_deprecated_parameter(kwargs, "ports_to_expose", "container.with_exposed_ports")
@@ -76,28 +76,22 @@ def __init__(
7676
def get_connection_string(self) -> str:
7777
host_ip = self.get_container_host_ip()
7878
connection_string = (
79-
f"DefaultEndpointsProtocol=http;" f"AccountName={self.account_name};" f"AccountKey={self.account_key};"
79+
f"DefaultEndpointsProtocol=http;AccountName={self.account_name};AccountKey={self.account_key};"
8080
)
8181

8282
if self.blob_service_port in self.ports:
8383
connection_string += (
84-
f"BlobEndpoint=http://{host_ip}:"
85-
f"{self.get_exposed_port(self.blob_service_port)}"
86-
f"/{self.account_name};"
84+
f"BlobEndpoint=http://{host_ip}:{self.get_exposed_port(self.blob_service_port)}/{self.account_name};"
8785
)
8886

8987
if self.queue_service_port in self.ports:
9088
connection_string += (
91-
f"QueueEndpoint=http://{host_ip}:"
92-
f"{self.get_exposed_port(self.queue_service_port)}"
93-
f"/{self.account_name};"
89+
f"QueueEndpoint=http://{host_ip}:{self.get_exposed_port(self.queue_service_port)}/{self.account_name};"
9490
)
9591

9692
if self.table_service_port in self.ports:
9793
connection_string += (
98-
f"TableEndpoint=http://{host_ip}:"
99-
f"{self.get_exposed_port(self.table_service_port)}"
100-
f"/{self.account_name};"
94+
f"TableEndpoint=http://{host_ip}:{self.get_exposed_port(self.table_service_port)}/{self.account_name};"
10195
)
10296

10397
return connection_string

modules/generic/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ def _check_for_image(image_short_id: str, cleaned: bool) -> None:
1717
client = DockerClient()
1818
images = client.client.images.list()
1919
found = any(image.short_id.endswith(image_short_id) for image in images)
20-
assert found is not cleaned, f'Image {image_short_id} was {"found" if cleaned else "not found"}'
20+
assert found is not cleaned, f"Image {image_short_id} was {'found' if cleaned else 'not found'}"
2121

2222
return _check_for_image

modules/google/tests/test_google.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def test_datastore_container_isolation():
6868

6969
# Create a second container and try to fetch the entity to makesure its a different container
7070
with DatastoreContainer() as datastore2:
71-
assert (
72-
datastore.get_datastore_emulator_host() != datastore2.get_datastore_emulator_host()
73-
), "Datastore containers use the same port."
71+
assert datastore.get_datastore_emulator_host() != datastore2.get_datastore_emulator_host(), (
72+
"Datastore containers use the same port."
73+
)
7474
client2 = datastore2.get_datastore_client()
7575
fetched_entity2 = client2.get(key)
7676
assert fetched_entity2 is None, "Entity was found in the datastore."

modules/k3s/testcontainers/k3s/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ def config_yaml(self) -> str:
6565
execution = self.get_wrapped_container().exec_run(["cat", "/etc/rancher/k3s/k3s.yaml"])
6666
config_yaml = execution.output.decode("utf-8").replace(
6767
f"https://127.0.0.1:{self.KUBE_SECURE_PORT}",
68-
f"https://{self.get_container_host_ip()}:" f"{self.get_exposed_port(self.KUBE_SECURE_PORT)}",
68+
f"https://{self.get_container_host_ip()}:{self.get_exposed_port(self.KUBE_SECURE_PORT)}",
6969
)
7070
return config_yaml

modules/scylla/tests/test_scylla.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ def test_docker_run_scylla():
66
cluster = scylla.get_cluster()
77
with cluster.connect() as session:
88
session.execute(
9-
"CREATE KEYSPACE keyspace1 WITH replication = "
10-
"{'class': 'SimpleStrategy', 'replication_factor': '1'};"
9+
"CREATE KEYSPACE keyspace1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};"
1110
)
1211
session.execute("CREATE TABLE keyspace1.table1 (key1 int, key2 int, PRIMARY KEY (key1));")
1312
session.execute("INSERT INTO keyspace1.table1 (key1,key2) values (1,2);")

0 commit comments

Comments
 (0)