diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6ef22322..05567c93 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: os: [ubuntu-latest] python-version: ["3.10.4"] poetry-version: ["1.5.1"] - db-url: ["", "postgres://cashu:cashu@localhost:5432/cashu"] + db-url: ["", "postgres://cashu:cashu@localhost:5432/test"] steps: - name: Checkout repository and submodules uses: actions/checkout@v2 diff --git a/tests/conftest.py b/tests/conftest.py index 02751323..56edac4f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -57,11 +57,14 @@ async def start_mint_init(ledger: Ledger): await ledger.load_used_proofs() await ledger.init_keysets() - db_file = "test_data/mint/test.sqlite3" - if os.path.exists(db_file): - os.remove(db_file) + # clear sqlite database + if not settings.mint_database.startswith("postgres"): + db_file = os.path.join(settings.mint_database, "test.sqlite3") + if os.path.exists(db_file): + os.remove(db_file) + ledger = Ledger( - db=Database("test", "test_data/mint"), + db=Database("test", settings.mint_database), seed=settings.mint_private_key, derivation_path=settings.mint_derivation_path, lightning=FakeWallet(),