File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import importlib .metadata
34from runpy import run_path
45from typing import TYPE_CHECKING
56
67import beangulp
78import beangulp .extract # type: ignore[import-untyped]
9+ import pytest
810
911import fava
1012from fava .core import FavaLedger
1113
1214if TYPE_CHECKING :
1315 from pathlib import Path
1416
17+ beangulp_version = importlib .metadata .version ("beangulp" )
1518
19+
20+ @pytest .mark .skipif (
21+ beangulp_version < "0.2.0" ,
22+ reason = "Documentation example requires beangulp 0.2.0" ,
23+ )
1624def test_example_import_cli (test_data_dir : Path ) -> None :
1725 """Test that the importer is successful, when run directly on the data"""
1826 ledger = FavaLedger (str (test_data_dir / "import_for_docs.beancount" ))
@@ -34,6 +42,10 @@ def test_example_import_cli(test_data_dir: Path) -> None:
3442 ]
3543
3644
45+ @pytest .mark .skipif (
46+ beangulp_version < "0.2.0" ,
47+ reason = "Documentation example requires beangulp 0.2.0" ,
48+ )
3749def test_example_import (test_data_dir : Path ) -> None :
3850 ledger = FavaLedger (str (test_data_dir / "import_for_docs.beancount" ))
3951
You can’t perform that action at this time.
0 commit comments