Skip to content

Commit 85d2aa3

Browse files
committedDec 12, 2024
TestgresTests::test_the_same_port is corrected
1 parent e4c2e07 commit 85d2aa3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

‎tests/test_simple.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,10 +1051,18 @@ def test_parse_pg_version(self):
10511051
def test_the_same_port(self):
10521052
with get_new_node() as node:
10531053
node.init().start()
1054+
self.assertTrue(node._should_free_port)
1055+
self.assertEqual(type(node.port), int)
10541056

1055-
with get_new_node() as node2:
1056-
node2.port = node.port
1057-
node2.init().start()
1057+
with get_new_node(port=node.port) as node2:
1058+
self.assertEqual(type(node2.port), int)
1059+
self.assertEqual(node2.port, node.port)
1060+
self.assertFalse(node2._should_free_port)
1061+
1062+
with self.assertRaises(StartNodeException) as ctx:
1063+
node2.init().start()
1064+
1065+
self.assertIn("Cannot start node", str(ctx.exception))
10581066

10591067
def test_simple_with_bin_dir(self):
10601068
with get_new_node() as node:

0 commit comments

Comments
 (0)
Please sign in to comment.