Skip to content

Commit bbb8e1f

Browse files
author
Jeff Schroeder
committed
Move solana_client fixture to a global fixture
So multiple test files can use it.
1 parent 416ae1f commit bbb8e1f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

tests/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import pytest
2+
from pythclient.solana import SolanaClient
3+
4+
5+
@pytest.fixture
6+
def solana_client():
7+
return SolanaClient(
8+
endpoint="https://example.com",
9+
ws_endpoint="wss://example.com",
10+
)

tests/test_product_account.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@
33

44
import pythclient.pythaccounts
55
from pythclient.exceptions import NotLoadedException
6-
from pythclient.solana import SolanaPublicKey, SolanaClient
6+
from pythclient.solana import SolanaPublicKey
77
from pythclient.pythaccounts import (
88
_VERSION_2,
9-
PythPriceAccount,
109
PythProductAccount,
1110
_read_attribute_string,
1211
)
1312

1413

15-
@pytest.fixture
16-
def solana_client():
17-
return SolanaClient(
18-
endpoint="https://example.com",
19-
ws_endpoint="wss://example.com",
20-
)
21-
22-
2314
@pytest.fixture
2415
def product_account_bytes():
2516
return bytes(

0 commit comments

Comments
 (0)