summaryrefslogtreecommitdiff
path: root/tests/test_javascript.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_javascript.py')
-rw-r--r--tests/test_javascript.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test_javascript.py b/tests/test_javascript.py
index a2dfb7e1..0e279d93 100644
--- a/tests/test_javascript.py
+++ b/tests/test_javascript.py
@@ -9,6 +9,8 @@
import unittest
+import pytest
+
from pygments.lexers import CoffeeScriptLexer
from pygments.token import Token
@@ -36,11 +38,10 @@ COFFEE_SLASH_GOLDEN = [
('a = 1 + /d/.test(a)', True),
]
-def test_coffee_slashes():
- for input_str, slashes_are_regex_here in COFFEE_SLASH_GOLDEN:
- yield coffee_runner, input_str, slashes_are_regex_here
-def coffee_runner(input_str, slashes_are_regex_here):
+@pytest.mark.parametrize('golden', COFFEE_SLASH_GOLDEN)
+def test_coffee_slashes(golden):
+ input_str, slashes_are_regex_here = golden
lex = CoffeeScriptLexer()
output = list(lex.get_tokens(input_str))
print(output)
@@ -49,6 +50,7 @@ def coffee_runner(input_str, slashes_are_regex_here):
is_regex = t is Token.String.Regex
assert is_regex == slashes_are_regex_here, (t, s)
+
class CoffeeTest(unittest.TestCase):
def setUp(self):
self.lexer = CoffeeScriptLexer()