diff options
author | Georg Brandl <georg@python.org> | 2019-05-06 18:02:47 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2019-11-10 10:15:13 +0100 |
commit | 7827966acdb6431636520d20fc3c148ce52de59b (patch) | |
tree | 13a9316eb3eb964c22da0a08f046d44cd81470d0 /tests/test_using_api.py | |
parent | a281ff8367a3a5f4cc17c9956e9273593558d336 (diff) | |
download | pygments-git-7827966acdb6431636520d20fc3c148ce52de59b.tar.gz |
Remove unittest classes from the test suite.
Diffstat (limited to 'tests/test_using_api.py')
-rw-r--r-- | tests/test_using_api.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/test_using_api.py b/tests/test_using_api.py index 3fdee591..b5310aa8 100644 --- a/tests/test_using_api.py +++ b/tests/test_using_api.py @@ -7,7 +7,7 @@ :license: BSD, see LICENSE for details. """ -import unittest +from pytest import raises from pygments.lexer import using, bygroups, this, RegexLexer from pygments.token import String, Text, Keyword @@ -28,14 +28,13 @@ class MyLexer(RegexLexer): } -class UsingStateTest(unittest.TestCase): - def test_basic(self): - expected = [(Text, 'a'), (String, '"'), (Keyword, 'bcd'), - (String, '"'), (Text, 'e\n')] - t = list(MyLexer().get_tokens('a"bcd"e')) - self.assertEqual(t, expected) +def test_basic(): + expected = [(Text, 'a'), (String, '"'), (Keyword, 'bcd'), + (String, '"'), (Text, 'e\n')] + assert list(MyLexer().get_tokens('a"bcd"e')) == expected - def test_error(self): - def gen(): - return list(MyLexer().get_tokens('#a')) - self.assertRaises(KeyError, gen) + +def test_error(): + def gen(): + return list(MyLexer().get_tokens('#a')) + assert raises(KeyError, gen) |