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

@@ -7,6 +7,10 @@ from typing import List
from deltas import Delete, Equal, Insert, wikitext_split
from mwpersistence import Token
from wikiq.wiki_diff_matcher import WikiDiffMatcher
from wikiq_test_utils import requires_pywikidiff2
# every test here drives wikidiff2 directly
pytestmark = requires_pywikidiff2
def _replace_whitespace(match):
if match.group(1): # If spaces matched (e.g., ' ')