diff options
author | Benji York <benji@benjiyork.com> | 2011-10-03 16:24:26 -0400 |
---|---|---|
committer | Benji York <benji@benjiyork.com> | 2011-10-03 16:24:26 -0400 |
commit | 63fa7b70464b26793ba452b7bb2691fe28861d96 (patch) | |
tree | 7189d78f7416fc1d088fb46ad54ccceafe146676 /tests/test_util.py | |
parent | 409fcfa99e9a82833fd00b65072e4e742716ae7b (diff) | |
download | pygments-63fa7b70464b26793ba452b7bb2691fe28861d96.tar.gz |
fix a couple of errors in the new tests
Diffstat (limited to 'tests/test_util.py')
-rw-r--r-- | tests/test_util.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index d887b3e6..af1f4e44 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -78,7 +78,7 @@ class UtilTest(unittest.TestCase): def analyse(text): raise RuntimeError('something bad happened') analyse = util.make_analysator(analyse) - self.assertEquals(FakeLexer.analyse(''), 0.0) + self.assertEquals(ErrorLexer.analyse(''), 0.0) def test_analysator_value_error(self): # When converting the analysator's return value to a float a @@ -88,11 +88,7 @@ class UtilTest(unittest.TestCase): def test_analysator_type_error(self): # When converting the analysator's return value to a float a # TypeError may occur. If that happens 0.0 is returned instead. - class X(object): - def analyse(text): - return float(text) - analyse = util.make_analysator(analyse) - self.assertEquals(X.analyse(None), 0.0) + self.assertEquals(FakeLexer.analyse(None), 0.0) def test_shebang_matches(self): self.assert_(util.shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?')) |