@@ -347,12 +347,12 @@ def test_transactions(self):
347
347
con .begin ()
348
348
con .execute ('insert into test values (2)' )
349
349
res = con .execute ('select * from test order by val asc' )
350
- self . assertListEqual (res , [(1 , ), (2 , )])
350
+ assert (res == [(1 , ), (2 , )])
351
351
con .rollback ()
352
352
353
353
con .begin ()
354
354
res = con .execute ('select * from test' )
355
- self . assertListEqual (res , [(1 , )])
355
+ assert (res == [(1 , )])
356
356
con .rollback ()
357
357
358
358
con .begin ()
@@ -392,7 +392,7 @@ def test_backup_simple(self):
392
392
with master .backup (xlog_method = 'stream' ) as backup :
393
393
with backup .spawn_primary ().start () as slave :
394
394
res = slave .execute ('select * from test order by i asc' )
395
- self . assertListEqual (res , [(1 , ), (2 , ), (3 , ), (4 , )])
395
+ assert (res == [(1 , ), (2 , ), (3 , ), (4 , )])
396
396
397
397
def test_backup_multiple (self ):
398
398
with get_new_node () as node :
@@ -448,14 +448,14 @@ def test_replicate(self):
448
448
449
449
with node .replicate ().start () as replica :
450
450
res = replica .execute ('select 1' )
451
- self . assertListEqual (res , [(1 , )])
451
+ assert (res == [(1 , )])
452
452
453
453
node .execute ('create table test (val int)' , commit = True )
454
454
455
455
replica .catchup ()
456
456
457
457
res = node .execute ('select * from test' )
458
- self . assertListEqual (res , [])
458
+ assert (res == [])
459
459
460
460
# @unittest.skipUnless(pg_version_ge('9.6'), 'requires 9.6+')
461
461
def test_synchronous_replication (self ):
@@ -522,7 +522,7 @@ def test_logical_replication(self):
522
522
# wait until changes apply on subscriber and check them
523
523
sub .catchup ()
524
524
res = node2 .execute ('select * from test' )
525
- self . assertListEqual (res , [(1 , 1 ), (2 , 2 )])
525
+ assert (res == [(1 , 1 ), (2 , 2 )])
526
526
527
527
# disable and put some new data
528
528
sub .disable ()
@@ -532,7 +532,7 @@ def test_logical_replication(self):
532
532
sub .enable ()
533
533
sub .catchup ()
534
534
res = node2 .execute ('select * from test' )
535
- self . assertListEqual (res , [(1 , 1 ), (2 , 2 ), (3 , 3 )])
535
+ assert (res == [(1 , 1 ), (2 , 2 ), (3 , 3 )])
536
536
537
537
# Add new tables. Since we added "all tables" to publication
538
538
# (default behaviour of publish() method) we don't need
@@ -546,7 +546,7 @@ def test_logical_replication(self):
546
546
node1 .safe_psql ('insert into test2 values (\' a\' ), (\' b\' )' )
547
547
sub .catchup ()
548
548
res = node2 .execute ('select * from test2' )
549
- self . assertListEqual (res , [('a' , ), ('b' , )])
549
+ assert (res == [('a' , ), ('b' , )])
550
550
551
551
# drop subscription
552
552
sub .drop ()
@@ -560,7 +560,7 @@ def test_logical_replication(self):
560
560
node1 .safe_psql ('insert into test values (4, 4)' )
561
561
sub .catchup ()
562
562
res = node2 .execute ('select * from test' )
563
- self . assertListEqual (res , [(1 , 1 ), (2 , 2 ), (3 , 3 ), (4 , 4 )])
563
+ assert (res == [(1 , 1 ), (2 , 2 ), (3 , 3 ), (4 , 4 )])
564
564
565
565
# explicitly add table
566
566
with pytest .raises (expected_exception = ValueError ):
@@ -569,7 +569,7 @@ def test_logical_replication(self):
569
569
node1 .safe_psql ('insert into test2 values (\' c\' )' )
570
570
sub .catchup ()
571
571
res = node2 .execute ('select * from test2' )
572
- self . assertListEqual (res , [('a' , ), ('b' , )])
572
+ assert (res == [('a' , ), ('b' , )])
573
573
574
574
# @unittest.skipUnless(pg_version_ge('10'), 'requires 10+')
575
575
def test_logical_catchup (self ):
@@ -593,10 +593,7 @@ def test_logical_catchup(self):
593
593
node1 .execute ('insert into test values ({0}, {0})' .format (i ))
594
594
sub .catchup ()
595
595
res = node2 .execute ('select * from test' )
596
- self .assertListEqual (res , [(
597
- i ,
598
- i ,
599
- )])
596
+ assert (res == [(i ,i ,)])
600
597
node1 .execute ('delete from test' )
601
598
602
599
# @unittest.skipIf(pg_version_ge('10'), 'requires <10')
@@ -657,7 +654,7 @@ def test_dump(self):
657
654
# restore dump
658
655
node3 .restore (filename = dump )
659
656
res = node3 .execute (query_select )
660
- self . assertListEqual (res , [(1 , ), (2 , )])
657
+ assert (res == [(1 , ), (2 , )])
661
658
662
659
def test_users (self ):
663
660
with get_new_node ().init ().start () as node :
0 commit comments