summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJean Abou-Samra <jean@abou-samra.fr>2023-02-01 23:26:15 +0100
committerGitHub <noreply@github.com>2023-02-01 23:26:15 +0100
commit54c68421de5037e7e0e5e3168b90543966933b19 (patch)
tree5cf832f2fed4d89b1719671a81c21315765dcb9b /tests
parent9d561d47ad32e5290708d7a290bac45d54ab9688 (diff)
downloadpygments-git-54c68421de5037e7e0e5e3168b90543966933b19.tar.gz
Fix some pyflakes lints in tests/ and scripts/ (#2333)
Diffstat (limited to 'tests')
-rw-r--r--tests/contrast/test_contrasts.py1
-rw-r--r--tests/test_basic_api.py2
-rw-r--r--tests/test_crystal.py2
-rw-r--r--tests/test_html_formatter.py2
-rwxr-xr-xtests/test_usd.py1
-rw-r--r--tests/test_words.py1
6 files changed, 3 insertions, 6 deletions
diff --git a/tests/contrast/test_contrasts.py b/tests/contrast/test_contrasts.py
index cfc9b414..f43d2c0f 100644
--- a/tests/contrast/test_contrasts.py
+++ b/tests/contrast/test_contrasts.py
@@ -11,7 +11,6 @@
import json
import os
-import sys
import pygments.styles
import pygments.token
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py
index 62ea4895..e12be25e 100644
--- a/tests/test_basic_api.py
+++ b/tests/test_basic_api.py
@@ -49,7 +49,7 @@ def test_lexer_classes(cls):
assert all(al.lower() == al for al in cls.aliases)
if issubclass(cls, RegexLexer):
- inst = cls(opt1="val1", opt2="val2")
+ cls(opt1="val1", opt2="val2") # should not raise
if not hasattr(cls, '_tokens'):
# if there's no "_tokens", the lexer has to be one with
# multiple tokendef variants
diff --git a/tests/test_crystal.py b/tests/test_crystal.py
index 962d9e5f..9bc2f11a 100644
--- a/tests/test_crystal.py
+++ b/tests/test_crystal.py
@@ -8,7 +8,7 @@
import pytest
-from pygments.token import Text, String, Number, Punctuation, Error, Whitespace
+from pygments.token import String, Number, Punctuation, Error, Whitespace
from pygments.lexers import CrystalLexer
diff --git a/tests/test_html_formatter.py b/tests/test_html_formatter.py
index e1a02b24..7b9b8015 100644
--- a/tests/test_html_formatter.py
+++ b/tests/test_html_formatter.py
@@ -231,7 +231,7 @@ def test_unicode_options():
def test_ctags():
try:
- import ctags
+ import ctags # noqa: F401
except ImportError:
# we can't check without the ctags module, but at least check the exception
assert pytest.raises(
diff --git a/tests/test_usd.py b/tests/test_usd.py
index 54389832..779e3d3d 100755
--- a/tests/test_usd.py
+++ b/tests/test_usd.py
@@ -2,7 +2,6 @@
"""Test that syntax highlighting for USD files works correctly."""
-import textwrap
import unittest
from pygments.lexers import UsdLexer
diff --git a/tests/test_words.py b/tests/test_words.py
index 9a8730ae..3b31e9b4 100644
--- a/tests/test_words.py
+++ b/tests/test_words.py
@@ -358,7 +358,6 @@ class MySecondLexer(RegexLexer):
def test_bracket_escape():
- s = "whatever"
# This used to emit a FutureWarning.
assert list(MySecondLexer().get_tokens("x")) == [
(Token.Name, "x"),