diff options
Diffstat (limited to 'blessings/tests.py')
-rw-r--r-- | blessings/tests.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/blessings/tests.py b/blessings/tests.py index aff3a2f..c51b36c 100644 --- a/blessings/tests.py +++ b/blessings/tests.py @@ -10,13 +10,14 @@ xterm-256color exists. """ from __future__ import with_statement # Make 2.5-compatible +from __future__ import absolute_import from curses import tigetstr, tparm from functools import partial -from StringIO import StringIO import sys from nose import SkipTest from nose.tools import eq_ +from six import StringIO # This tests that __all__ is correct, since we use below everything that should # be imported: @@ -229,22 +230,22 @@ def test_nice_formatting_errors(): t = TestTerminal() try: t.bold_misspelled('hey') - except TypeError, e: + except TypeError as e: assert 'probably misspelled' in e.args[0] try: t.bold_misspelled(u'hey') # unicode - except TypeError, e: + except TypeError as e: assert 'probably misspelled' in e.args[0] try: t.bold_misspelled(None) # an arbitrary non-string - except TypeError, e: + except TypeError as e: assert 'probably misspelled' not in e.args[0] try: t.bold_misspelled('a', 'b') # >1 string arg - except TypeError, e: + except TypeError as e: assert 'probably misspelled' not in e.args[0] |