Skip to content

Commit b515c5d

Browse files
author
Romamo
committed
Removed held argument as non-functional in price
1 parent ba922b4 commit b515c5d

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ jobs:
1313
matrix:
1414
python-version:
1515
- "3.10"
16-
- "3.11"
17-
- "3.12"
18-
- "3.13"
19-
- "3.14"
2016
fail-fast: false
2117
steps:
2218
- name: Checkout

src/beancount_cli/commands/price.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ def price_fetch(
7575
False, "--inactive", "-i", help="Include commodities with no balance"
7676
),
7777
fill_gaps: bool = typer.Option(False, "--fill-gaps", help="Fill gaps in price history"),
78-
held: bool = typer.Option(
79-
False, "--held", help="Include commodities with non-zero balance in any account"
80-
),
8178
dry_run: bool = False,
8279
):
8380
"""Fetch and update prices using bean-price library.
@@ -128,12 +125,11 @@ def price_fetch(
128125
jobs = bp_price.get_price_jobs_up_to_date(
129126
entries,
130127
date_last=datetime.now().date(),
131-
inactive=inactive,
132-
held=held,
128+
inactive=inactive
133129
)
134130
else:
135131
jobs = bp_price.get_price_jobs_at_date(
136-
entries, date=None, inactive=inactive, held=held
132+
entries, date=None, inactive=inactive
137133
)
138134

139135
if not jobs:

tests/test_cli.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,3 @@ def test_report_audit_help_shows_audit_only_flags():
219219
assert "--limit" in (out + err)
220220
assert "--all" in (out + err)
221221

222-
def test_price_fetch_held(temp_beancount_file):
223-
with patch("beancount_cli.commands.price.bp_price.get_price_jobs_at_date") as mock_get_jobs:
224-
mock_get_jobs.return_value = []
225-
code, out, err = run_cli("price", "fetch", "--held", str(temp_beancount_file))
226-
assert code in (0, None)
227-
mock_get_jobs.assert_called_once()
228-
assert mock_get_jobs.call_args[1].get("held") is True
229-
230-
def test_price_fetch_update(temp_beancount_file):
231-
with patch("beancount_cli.commands.price.bp_price.get_price_jobs_up_to_date") as mock_get_jobs:
232-
mock_get_jobs.return_value = []
233-
code, out, err = run_cli("price", "fetch", "--update", str(temp_beancount_file))
234-
assert code in (0, None)
235-
mock_get_jobs.assert_called_once()
236-
# Verify that held is passed as False by default
237-
assert mock_get_jobs.call_args[1].get("held") is False
238-

0 commit comments

Comments
 (0)