diff options
author | Georg Brandl <g.brandl@fz-juelich.de> | 2019-12-09 12:16:28 +0100 |
---|---|---|
committer | Georg Brandl <g.brandl@fz-juelich.de> | 2019-12-09 12:16:41 +0100 |
commit | da310ba1bf547202dcc8224a9f2ce102aa926abf (patch) | |
tree | 067413d67192ff0482b8bb4a4ec1305cff387cef | |
parent | 7f4b554d03dcd48675cb618bac0715b9d0e146f8 (diff) | |
download | pygments-git-da310ba1bf547202dcc8224a9f2ce102aa926abf.tar.gz |
tests: split out "random input" test and make github tests verbose
-rw-r--r-- | .github/workflows/build.yaml | 2 | ||||
-rw-r--r-- | tests/test_basic_api.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 491ef47a..a4c90115 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,4 +23,4 @@ jobs: pip install -r requirements.txt pip install . - name: Test package - run: make test + run: make test TEST=-v diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index 056f106a..99d56bb5 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -49,8 +49,8 @@ def test_lexer_classes(cls): assert all(al.lower() == al for al in cls.aliases) - inst = cls(opt1="val1", opt2="val2") if issubclass(cls, RegexLexer): + inst = cls(opt1="val1", opt2="val2") if not hasattr(cls, '_tokens'): # if there's no "_tokens", the lexer has to be one with # multiple tokendef variants @@ -61,9 +61,13 @@ def test_lexer_classes(cls): assert 'root' in cls._tokens, \ '%s has no root state' % cls - if cls.name in ['XQuery', 'Opa']: # XXX temporary + +@pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False)) +def test_random_input(cls): + if cls.name in ['XQuery', 'Opa', 'Zephir']: # XXX temporary return + inst = cls() try: tokens = list(inst.get_tokens(test_content)) except KeyboardInterrupt: |