Skip to content

Commit dd75dcc

Browse files
[E721] mix
1 parent 33fce95 commit dd75dcc

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

tests/test_testgres_common.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_double_start(self, node_svc: PostgresNodeService):
222222
node.start()
223223

224224
assert x is not None
225-
assert type(x.value) == StartNodeException # noqa: E721
225+
assert type(x.value) is StartNodeException
226226
assert type(x.value.description) is str
227227
assert type(x.value.message) is str
228228

@@ -301,7 +301,7 @@ def test_start2(self, node_svc: PostgresNodeService):
301301
node.start2()
302302

303303
assert x is not None
304-
assert type(x.value) == StartNodeException # noqa: E721
304+
assert type(x.value) is StartNodeException
305305
assert type(x.value.description) is str
306306
assert type(x.value.message) is str
307307

@@ -705,7 +705,7 @@ def test_child_processes__ok(
705705
logging.info("")
706706

707707
def LOCAL__safe_call_cmdline(p: ProcessProxy) -> str:
708-
assert type(p) == ProcessProxy # noqa: E721
708+
assert type(p) is ProcessProxy
709709
try:
710710
return p.cmdline()
711711
except Exception as e:
@@ -720,7 +720,7 @@ def LOCAL__safe_call_cmdline(p: ProcessProxy) -> str:
720720

721721
try:
722722
assert child is not None
723-
assert type(child) == ProcessProxy # noqa: E721
723+
assert type(child) is ProcessProxy
724724
assert hasattr(child, "process")
725725
assert hasattr(child, "ptype")
726726
assert hasattr(child, "pid")
@@ -730,7 +730,7 @@ def LOCAL__safe_call_cmdline(p: ProcessProxy) -> str:
730730
assert child.pid is not None
731731
assert type(child.ptype) is ProcessType
732732
assert type(child.pid) is int
733-
assert type(child.cmdline) == types.MethodType # noqa: E721
733+
assert type(child.cmdline) is types.MethodType
734734

735735
logging.info("ptype is {}".format(child.ptype))
736736
logging.info("pid is {}".format(child.pid))
@@ -1698,20 +1698,20 @@ def test_promotion(self, node_svc: PostgresNodeService):
16981698
assert (__class__.helper__rm_carriage_returns(res) == b'1\n')
16991699

17001700
@pytest.fixture(
1701-
params=[
1702-
enums.DumpFormat.Plain,
1703-
enums.DumpFormat.Custom,
1704-
enums.DumpFormat.Directory,
1705-
enums.DumpFormat.Tar
1706-
]
1701+
params=[
1702+
enums.DumpFormat.Plain,
1703+
enums.DumpFormat.Custom,
1704+
enums.DumpFormat.Directory,
1705+
enums.DumpFormat.Tar
1706+
]
17071707
)
17081708
def dump_fmt(self, request: pytest.FixtureRequest) -> enums.DumpFormat:
1709-
assert type(request.param) == enums.DumpFormat # noqa: E721
1709+
assert type(request.param) is enums.DumpFormat
17101710
return request.param
17111711

17121712
def test_dump(self, node_svc: PostgresNodeService, dump_fmt: enums.DumpFormat):
17131713
assert isinstance(node_svc, PostgresNodeService)
1714-
assert type(dump_fmt) == enums.DumpFormat # noqa: E721
1714+
assert type(dump_fmt) is enums.DumpFormat
17151715
query_create = 'create table test as select generate_series(1, 2) as val'
17161716
query_select = 'select * from test order by val asc'
17171717

@@ -1799,13 +1799,13 @@ def test_the_same_port(self, node_svc: PostgresNodeService):
17991799
with __class__.helper__get_node(node_svc) as node:
18001800
node.init().start()
18011801
assert (node._should_free_port)
1802-
assert (type(node.port) == int) # noqa: E721
1802+
assert (type(node.port) is int)
18031803
node_port_copy = node.port
18041804
r = node.safe_psql("SELECT 1;")
18051805
assert (__class__.helper__rm_carriage_returns(r) == b'1\n')
18061806

18071807
with __class__.helper__get_node(node_svc, port=node.port) as node2:
1808-
assert (type(node2.port) == int) # noqa: E721
1808+
assert (type(node2.port) is int)
18091809
assert (node2.port == node.port)
18101810
assert (not node2._should_free_port)
18111811
assert (node2.status() == NodeStatus.Uninitialized)
@@ -2130,7 +2130,7 @@ def __init__(
21302130
record_count: int,
21312131
):
21322132
assert type(record_count) is int
2133-
self.record_count = record_count # noqa: E721
2133+
self.record_count = record_count
21342134
return
21352135

21362136
sm_TableCheckSumTestDatas = [
@@ -2166,7 +2166,7 @@ def test_node__table_checksum(
21662166
table_checksum_test_data: tagTableChecksumTestData,
21672167
):
21682168
assert type(node_svc) is PostgresNodeService
2169-
assert type(table_checksum_test_data) == __class__.tagTableChecksumTestData # noqa: E721
2169+
assert type(table_checksum_test_data) is __class__.tagTableChecksumTestData
21702170
assert node_svc.port_manager is not None
21712171
assert isinstance(node_svc.port_manager, PortManager)
21722172

@@ -2205,7 +2205,7 @@ def test_node__table_checksum(
22052205
row = cursor.fetchone()
22062206
if row is None:
22072207
break
2208-
assert type(row) in [list, tuple] # noqa: E721
2208+
assert type(row) in [list, tuple]
22092209
assert len(row) == 1
22102210
record_count += 1
22112211
checksum1 += int(row[0])
@@ -2226,7 +2226,7 @@ def test_node__pgbench_table_checksums__one_table(
22262226
table_checksum_test_data: tagTableChecksumTestData,
22272227
):
22282228
assert type(node_svc) is PostgresNodeService
2229-
assert type(table_checksum_test_data) == __class__.tagTableChecksumTestData # noqa: E721
2229+
assert type(table_checksum_test_data) is __class__.tagTableChecksumTestData
22302230
assert node_svc.port_manager is not None
22312231
assert isinstance(node_svc.port_manager, PortManager)
22322232

@@ -2265,7 +2265,7 @@ def test_node__pgbench_table_checksums__one_table(
22652265
row = cursor.fetchone()
22662266
if row is None:
22672267
break
2268-
assert type(row) in [list, tuple] # noqa: E721
2268+
assert type(row) in [list, tuple]
22692269
assert len(row) == 1
22702270
record_count += 1
22712271
checksum1 += int(row[0])
@@ -2451,10 +2451,10 @@ def test_node_app__make_empty__base_dir_is_None(self, node_svc: PostgresNodeServ
24512451
with pytest.raises(expected_exception=BaseException) as x:
24522452
node_app.make_empty(base_dir=None)
24532453

2454-
if type(x.value) == AssertionError: # noqa: E721
2454+
if type(x.value) is AssertionError:
24552455
pass
24562456
else:
2457-
assert type(x.value) == ValueError # noqa: E721
2457+
assert type(x.value) is ValueError
24582458
assert str(x.value) == "Argument 'base_dir' is not defined."
24592459

24602460
# -----------

0 commit comments

Comments
 (0)