8000 Using pytest [assertIsNotNone] · postgrespro/testgres@12d702a · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 12d702a

Browse files
Using pytest [assertIsNotNone]
1 parent 53e468e commit 12d702a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/test_simple.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class TestgresTests(unittest.TestCase):
111111
def test_node_repr(self):
112112
with get_new_node() as node:
113113
pattern = r"PostgresNode\(name='.+', port=.+, base_dir='.+'\)"
114-
self.assertIsNotNone(re.match(pattern, str(node)))
114+
assert re.match(pattern, str(node)) is not None
115115

116116
def test_custom_init(self):
117117
with get_new_node() as node:
@@ -370,7 +370,7 @@ def test_control_data(self):
370370
data = node.get_control_data()
371371

372372
# check returned dict
373-
self.assertIsNotNone(data)
373+
assert data is not None
374374
self.assertTrue(any('pg_control' in s for s in data.keys()))
375375

376376
def test_backup_simple(self):

tests/test_simple_remote.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TestgresRemoteTests(unittest.TestCase):
9999
def test_node_repr(self):
100100
with get_remote_node(conn_params=conn_params) as node:
101101
pattern = r"PostgresNode\(name='.+', port=.+, base_dir='.+'\)"
102-
self.assertIsNotNone(re.match(pattern, str(node)))
102+
assert re.match(pattern, str(node)) is not None
103103

104104
def test_custom_init(self):
105105
with get_remote_node(conn_params=conn_params) as node:
@@ -424,7 +424,7 @@ def test_control_data(self):
424424
data = node.get_control_data()
425425

426426
# check returned dict
427-
self.assertIsNotNone(data)
427+
assert data is not None
428428
self.assertTrue(any('pg_control' in s for s in data.keys()))
429429

430430
def test_backup_simple(self):
@@ -1084,6 +1084,7 @@ def test_child_process_dies(self):
10841084
# try to handle children list -- missing processes will have ptype "ProcessType.Unknown"
10851085
[ProcessProxy(p) for p in children]
10861086

1087+
@staticmethod
10871088
def helper__restore_envvar(name, prev_value):
10881089
if prev_value is None:
10891090
os.environ.pop(name, None)

0 commit comments

Comments
 (0)
0