Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
exclusions.py81 linesDownload Raw Back to testing
1import pytest2 3from mako.ext.beaker_cache import has_beaker4from mako.util import update_wrapper5 6 7try:8    import babel.messages.extract as babel9except ImportError:10    babel = None11 12 13try:14    import lingua15except ImportError:16    lingua = None17 18 19try:20    import dogpile.cache  # noqa21except ImportError:22    has_dogpile_cache = False23else:24    has_dogpile_cache = True25 26 27requires_beaker = pytest.mark.skipif(28    not has_beaker, reason="Beaker is required for these tests."29)30 31 32requires_babel = pytest.mark.skipif(33    babel is None, reason="babel not installed: skipping babelplugin test"34)35 36 37requires_lingua = pytest.mark.skipif(38    lingua is None, reason="lingua not installed: skipping linguaplugin test"39)40 41 42requires_dogpile_cache = pytest.mark.skipif(43    not has_dogpile_cache,44    reason="dogpile.cache is required to run these tests",45)46 47 48def _pygments_version():49    try:50        import pygments51 52        version = pygments.__version__53    except:54        version = "0"55    return version56 57 58requires_pygments_14 = pytest.mark.skipif(59    _pygments_version() < "1.4", reason="Requires pygments 1.4 or greater"60)61 62 63# def requires_pygments_14(fn):64 65#     return skip_if(66#         lambda: version < "1.4", "Requires pygments 1.4 or greater"67#     )(fn)68 69 70def requires_no_pygments_exceptions(fn):71    def go(*arg, **kw):72        from mako import exceptions73 74        exceptions._install_fallback()75        try:76            return fn(*arg, **kw)77        finally:78            exceptions._install_highlighting()79 80    return update_wrapper(go, fn)81 
codekingpro/portable-devtools · Team Ai