Skip to content

Commit 1418609

Browse files
Pattermeshclaude
andcommitted
Skip Solana keypair test when solders is absent; add CI
test_generate_new_wallet hard-failed when the optional `solders` dependency was not installed: SolanaWallet falls back to a stub pubkey ("STUB_PUBKEY", 11 chars) and the test asserts a base58 pubkey longer than 30 chars. Guard it with pytest.importorskip so it skips gracefully instead of failing. Also add .github/workflows/ci.yml running `pytest -q` on push and PRs to main across Python 3.10-3.12. solders is intentionally not installed in CI, exercising the skip path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9eed0ac commit 1418609

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: pytest (py${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.10", "3.11", "3.12"]
17+
18+
steps:
19+
- name: Check out repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
cache: pip
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
33+
- name: Run tests
34+
# `solders` is an optional dependency and is intentionally not
35+
# installed here; the Solana keypair test skips gracefully when
36+
# it is absent. Everything else must pass.
37+
run: python -m pytest -q

tests/test_solana_connector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
class TestSolanaWallet:
1010
def test_generate_new_wallet(self):
11+
# Generating a real base58 keypair requires the optional `solders`
12+
# dependency. When it's absent, SolanaWallet falls back to a stub
13+
# ("STUB_PUBKEY"), so skip rather than hard-fail.
14+
pytest.importorskip("solders")
1115
wallet = SolanaWallet()
1216
assert wallet.pubkey
1317
assert len(wallet.pubkey) > 30 # base58 pubkey

0 commit comments

Comments
 (0)