Skip to content

Commit f78d0d6

Browse files
committed
Skip testing example import configuration for old beangulp version
1 parent c55ab01 commit f78d0d6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/test_import_documentation_example.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
from __future__ import annotations
22

3+
import importlib.metadata
34
from runpy import run_path
45
from typing import TYPE_CHECKING
56

67
import beangulp
78
import beangulp.extract # type: ignore[import-untyped]
9+
import pytest
810

911
import fava
1012
from fava.core import FavaLedger
1113

1214
if 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+
)
1624
def 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+
)
3749
def test_example_import(test_data_dir: Path) -> None:
3850
ledger = FavaLedger(str(test_data_dir / "import_for_docs.beancount"))
3951

0 commit comments

Comments
 (0)