Skip to content

Commit 0b0711e

Browse files
lint
1 parent 88c0c27 commit 0b0711e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Diff for: modules/scylla/testcontainers/scylla/__init__.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,28 @@ class ScyllaContainer(DockerContainer):
2020
... "CREATE KEYSPACE keyspace1 WITH replication "
2121
... "= {'class': 'SimpleStrategy', 'replication_factor': '1'};")
2222
"""
23-
def __init__(self, image="scylladb/scylla:latest", ports_to_expose=[9042]):
24-
super(ScyllaContainer, self).__init__(image)
23+
24+
def __init__(self, image="scylladb/scylla:latest", ports_to_expose=(9042,)):
25+
super().__init__(image)
2526
self.ports_to_expose = ports_to_expose
2627
self.with_exposed_ports(*self.ports_to_expose)
2728
self.with_command("--skip-wait-for-gossip-to-settle=0")
2829

2930
@wait_container_is_ready()
3031
def _connect(self):
31-
wait_for_logs(
32-
self,
33-
predicate="Starting listening for CQL clients",
34-
timeout=MAX_TRIES)
32+
wait_for_logs(self, predicate="Starting listening for CQL clients", timeout=MAX_TRIES)
3533
cluster = self.get_cluster()
3634
cluster.connect()
3735

3836
def start(self):
39-
super(ScyllaContainer, self).start()
37+
super().start()
4038
self._connect()
4139
return self
4240

4341
def get_cluster(self, **kwargs):
4442
from cassandra.cluster import Cluster
43+
4544
container = self.get_wrapped_container()
4645
container.reload()
47-
hostname = container.attrs['NetworkSettings']['IPAddress']
46+
hostname = container.attrs["NetworkSettings"]["IPAddress"]
4847
return Cluster(contact_points=[hostname], **kwargs)

Diff for: modules/scylla/tests/test_scylla.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def test_docker_run_scylla():
77
with cluster.connect() as session:
88
session.execute(
99
"CREATE KEYSPACE keyspace1 WITH replication = "
10-
"{'class': 'SimpleStrategy', 'replication_factor': '1'};")
11-
session.execute(
12-
"CREATE TABLE keyspace1.table1 (key1 int, key2 int, PRIMARY KEY (key1));")
10+
"{'class': 'SimpleStrategy', 'replication_factor': '1'};"
11+
)
12+
session.execute("CREATE TABLE keyspace1.table1 (key1 int, key2 int, PRIMARY KEY (key1));")
1313
session.execute("INSERT INTO keyspace1.table1 (key1,key2) values (1,2);")
1414

1515
response = session.execute("SELECT * FROM keyspace1.table1")

0 commit comments

Comments
 (0)