• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import pytest
2
3from markupsafe import _native
4
5try:
6    from markupsafe import _speedups
7except ImportError:
8    _speedups = None
9
10
11@pytest.fixture(
12    scope="session",
13    params=(
14        _native,
15        pytest.param(
16            _speedups,
17            marks=pytest.mark.skipif(_speedups is None, reason="speedups unavailable"),
18        ),
19    ),
20)
21def _mod(request):
22    return request.param
23
24
25@pytest.fixture(scope="session")
26def escape(_mod):
27    return _mod.escape
28
29
30@pytest.fixture(scope="session")
31def escape_silent(_mod):
32    return _mod.escape_silent
33
34
35@pytest.fixture(scope="session")
36def soft_str(_mod):
37    return _mod.soft_str
38
39
40@pytest.fixture(scope="session")
41def soft_unicode(_mod):
42    return _mod.soft_unicode
43