--- a/tests/run.py +++ b/tests/run.py @@ -16,18 +16,13 @@ from __future__ import print_function import os import sys +import unittest # only find tests in this directory if os.path.dirname(__file__): os.chdir(os.path.dirname(__file__)) -try: - import nose -except ImportError: - print('nose is required to run the Pygments test suite') - sys.exit(1) - # make sure the current source is first on sys.path sys.path.insert(0, '..') @@ -47,4 +42,4 @@ else: print('Pygments test suite running (Python %s)...' % sys.version.split()[0], file=sys.stderr) -nose.main() +unittest.main() --- a/tests/support.py +++ b/tests/support.py @@ -5,7 +5,7 @@ Support for Pygments tests import os -from nose import SkipTest +from unittest import SkipTest def location(mod_name): --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -143,7 +143,7 @@ class CmdLineTest(unittest.TestCase): def test_h_opt(self): o = self.check_success('-h') - self.assertTrue('Usage:' in o) + self.assertIn('Usage:', o) def test_L_opt(self): o = self.check_success('-L') @@ -157,37 +157,37 @@ class CmdLineTest(unittest.TestCase): filename = TESTFILE o = self.check_success('-Ofull=1,linenos=true,foo=bar', '-fhtml', filename) - self.assertTrue('foo, bar=baz=,' in o) + self.assertIn('foo, bar=baz=,', o) def test_F_opt(self): filename = TESTFILE o = self.check_success('-Fhighlight:tokentype=Name.Blubb,' 'names=TESTFILE filename', '-fhtml', filename) - self.assertTrue('