skip tests whose optional dependency is not installed

With pywikidiff2 and mediawiki-utilities no longer installed by default,
the tests covering --diff, -p wikidiff2, and -p legacy cannot run on a
base install. Mark them so a base install reports skips rather than
failures, and keep the markers in wikiq_test_utils.py so all three test
modules share one definition of what each feature needs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 59d5a9d46a04320bad5d81e0edf5ecd11f9c2a9b)
This commit is contained in:
2026-08-13 11:58:30 -07:00
parent 70b0ebcf0c
commit b10a7d0130
4 changed files with 36 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ from wikiq_test_utils import (
TWINPEAKS,
WIKIQ,
WikiqTester,
requires_mediawiki_utilities,
requires_pywikidiff2,
)
@@ -205,6 +207,7 @@ def test_collapse_user():
baseline = pd.read_table(tester.baseline_file)
assert_frame_equal(test, baseline, check_like=True)
@requires_pywikidiff2
def test_pwr_wikidiff2():
tester = WikiqTester(SAILORMOON, "persistence_wikidiff2", in_compression="7z")
@@ -229,6 +232,7 @@ def test_pwr_segment():
baseline = pd.read_table(tester.baseline_file)
assert_frame_equal(test, baseline, check_like=True)
@requires_mediawiki_utilities
def test_pwr_legacy():
tester = WikiqTester(SAILORMOON, "persistence_legacy", in_compression="7z")
@@ -255,6 +259,7 @@ def test_pwr():
test = test.reindex(columns=sorted(test.columns))
assert_frame_equal(test, baseline, check_like=True)
@requires_pywikidiff2
def test_diff():
tester = WikiqTester(SAILORMOON, "diff", in_compression="7z", out_format='jsonl')
@@ -268,6 +273,7 @@ def test_diff():
assert "diff_timeout" in test.columns, "diff_timeout column should exist"
assert len(test) > 0, "Should have output rows"
@requires_pywikidiff2
def test_diff_plus_pwr():
tester = WikiqTester(SAILORMOON, "diff_pwr", in_compression="7z", out_format='jsonl')
@@ -281,6 +287,7 @@ def test_diff_plus_pwr():
assert "token_revs" in test.columns, "token_revs column should exist"
assert len(test) > 0, "Should have output rows"
@requires_pywikidiff2
def test_text():
tester = WikiqTester(SAILORMOON, "text", in_compression="7z", out_format='jsonl')