Changeset - 7abc01b1ac35
[Not reviewed]
0 3 0
Brett Smith - 3 years ago 2020-12-29 15:53:55
brettcsmith@brettcsmith.org
fund: Bugfix crash when text report has an empty balance.

This mostly happens when a date range includes the opening or closing of a
fund account, because then the reported beginning/ending balance is empty.
3 files changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/fund.py
Show inline comments
...
 
@@ -303,3 +303,3 @@ class TextReport:
 
            bal_iter = iter(bal_seq)
 
            print(line_fmt.format(acct_s, next(bal_iter)), file=self.out_file)
 
            print(line_fmt.format(acct_s, next(bal_iter, "—")), file=self.out_file)
 
            for bal_s in bal_iter:
setup.py
Show inline comments
...
 
@@ -7,3 +7,3 @@ setup(
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.14.1',
 
    version='1.14.2',
 
    author='Software Freedom Conservancy',
tests/test_reports_fund.py
Show inline comments
...
 
@@ -298,2 +298,9 @@ def test_text_report(project, start_date, stop_date):
 

	
 
def test_text_report_empty_balances():
 
    retcode, output, errors = run_main(io.StringIO, [
 
        '-t', 'text', '-b', '2018-01-01',
 
    ])
 
    assert not errors.getvalue()
 
    assert retcode == 0
 

	
 
@pytest.mark.parametrize('start_date,stop_date', [
0 comments (0 inline, 0 general)