Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
view tests/_tsetup.py @ 160:b4028838e0c8
Implement lexer option "prohibit_raiseonerror_filter".
Sphinx raises by default when an Error token is seen (by means of the
"raiseonerror" filter that is applied by default to lexers in Sphinx).
This option skips this and allows error locations to be seen and highlighted
properly.
While there convert most Generic.Error tokens to Error tokens because now
they can be handled by a lexer with "prohibit_raiseonerror_filter=True".
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 08 May 2026 17:46:28 +0200 |
| parents | 39151225fb84 |
| children | a4317957148b |
line wrap: on
line source
# -*- coding: utf-8 -*- # :- # SPDX-FileCopyrightText: © 2026 Franz Glasner # SPDX-License-Identifier: MIT r"""Automatic unittest context configuration. Side-effects of import configure the test environment! """ __all__ = [ "PROJECTDIR", "ALGLEXERCLASS", "ALGLEXERFILENAME", "FRLEXERCLASS", "FRLEXERFILENAME", "TESTSNIPPETSDIR", ] import logging import os import sys PROJECTDIR = os.path.abspath( os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) sys.path.insert(0, PROJECTDIR) FRLEXERFILENAME = os.path.join(PROJECTDIR, "pygments_lexer_pseudocode2", "fr_pseudocode.py") FRLEXERCLASS = "FrPseudocodeLexer" ALGLEXERFILENAME = os.path.join(PROJECTDIR, "pygments_lexer_pseudocode2", "algpseudocode.py") ALGLEXERCLASS = "AlgPseudocodeLexer" TESTSNIPPETSDIR = os.path.join( os.path.abspath(os.path.dirname(__file__)), "snippets") # Setup logging for the unittests: use a known fixed format w/o time logging.captureWarnings(True) logging.basicConfig( level=logging.DEBUG, style='%', format="[%(name)s][%(filename)s:%(lineno)d:%(funcName)s][%(levelname)s] %(message)s") # noqa: E501 (line too long)
