From 08d9c0ccc4012b6515d749e5dc1204b328b6357f Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Fri, 24 Nov 2023 19:32:59 -0300 Subject: [PATCH] remove benchmark --- cashu/wallet/wallet.py | 1 + tests/conftest.py | 1 + tests/test_mint_operations.py | 17 ----------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index 532df1b0..b3c8baf4 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -94,6 +94,7 @@ async def wrapper(self, *args, **kwargs): proxies=proxies_dict, # type: ignore headers=headers_dict, base_url=self.url, + timeout=None if settings.debug else 5, ) return await func(self, *args, **kwargs) diff --git a/tests/conftest.py b/tests/conftest.py index bb69fb72..dd4cd901 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,6 +20,7 @@ SERVER_PORT = 3337 SERVER_ENDPOINT = f"http://localhost:{SERVER_PORT}" +settings.debug = True settings.cashu_dir = "./test_data/" settings.mint_host = "localhost" settings.mint_port = SERVER_PORT diff --git a/tests/test_mint_operations.py b/tests/test_mint_operations.py index b2944184..e4e9e739 100644 --- a/tests/test_mint_operations.py +++ b/tests/test_mint_operations.py @@ -1,5 +1,3 @@ -import time - import pytest import pytest_asyncio @@ -71,18 +69,3 @@ async def test_check_proof_state(wallet1: Wallet, ledger: Ledger): spendable, pending = await ledger.check_proof_state(proofs=send_proofs) assert sum(spendable) == len(send_proofs) assert sum(pending) == 0 - - -@pytest.mark.asyncio -async def test_benchmark_check_proof_spendable(wallet1: Wallet, ledger: Ledger): - invoice = await wallet1.request_mint(1000) - pay_if_regtest(invoice.bolt11) - await wallet1.mint(1000, split=[1] * 1000, id=invoice.id) - - time_begin = time.time() - spendable = await ledger._check_proofs_spendable(wallet1.proofs) - time_end = time.time() - time_elapsed = time_end - time_begin - print(f"Time elapsed: {time_elapsed}") - assert sum(spendable) == len(wallet1.proofs) - assert time_elapsed < 0.5