From 81926a42f9ccedeb09b7430ef13da012a8c24944 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 27 Jun 2020 22:31:49 -0400 Subject: [PATCH] fix postgres db connection --- tests/integration/blockchain/test_blockchain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/blockchain/test_blockchain.py b/tests/integration/blockchain/test_blockchain.py index 307310d76..b2800895a 100644 --- a/tests/integration/blockchain/test_blockchain.py +++ b/tests/integration/blockchain/test_blockchain.py @@ -42,10 +42,11 @@ class BasicBlockchainTestCase(AsyncioTestCase): db = Database.temp_sqlite_regtest(chain.ledger.conf.lbrycrd_dir) elif db_driver.startswith('postgres') or db_driver.startswith('psycopg'): db_name = f'lbry_test_chain' - meta_db = Database.from_url(f'postgresql:///postgres') + db_connection = 'postgres:postgres@localhost:5432' + meta_db = Database.from_url(f'postgresql://{db_connection}/postgres') await meta_db.drop(db_name) await meta_db.create(db_name) - db = Database.temp_from_url_regtest(f'postgresql:///{db_name}', chain.ledger.conf.lbrycrd_dir) + db = Database.temp_from_url_regtest(f'postgresql://{db_connection}/{db_name}', chain.ledger.conf.lbrycrd_dir) else: raise RuntimeError(f"Unsupported database driver: {db_driver}") self.addCleanup(remove_tree, db.ledger.conf.data_dir)