diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-02 16:32:11 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-02 16:32:11 +0100 |
commit | d6dc9c23e0459fa3512bf5485bece8ea9a0003cd (patch) | |
tree | 205f2d0d2de4df02416a83668e4b43ebd6a914c1 /test/test_func.py | |
parent | ae9463857ca21dc977b811e5b47014bc6b0e4fec (diff) | |
download | pylint-git-d6dc9c23e0459fa3512bf5485bece8ea9a0003cd.tar.gz |
py3k: remove deprecate "new" usage
Diffstat (limited to 'test/test_func.py')
-rw-r--r-- | test/test_func.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/test_func.py b/test/test_func.py index a97c5492d..be2517419 100644 --- a/test/test_func.py +++ b/test/test_func.py @@ -18,7 +18,6 @@ import unittest import sys import re -import new from os import linesep from os.path import exists @@ -51,7 +50,7 @@ else: INFO_TEST_RGX = re.compile('^func_i\d\d\d\d$') -def exception_str(ex): +def exception_str(self, ex): """function used to replace default __str__ method of exception instances""" return 'in %s\n:: %s' % (ex.file, ', '.join(ex.args)) @@ -94,7 +93,8 @@ class LintTestUsingModule(testlib.TestCase): # need finalization to restore a correct state self.linter.reporter.finalize() ex.file = tocheck - ex.__str__ = new.instancemethod(exception_str, ex, None) + print ex + ex.__str__ = exception_str raise if self.module.startswith('func_noerror_'): expected = '' @@ -106,9 +106,6 @@ class LintTestUsingModule(testlib.TestCase): try: self.assertMultiLineEqual(got, expected) except Exception, ex: - # doesn't work with py 2.5 - #ex.file = tocheck - #ex.__str__ = new.instancemethod(exception_str, ex, None) raise AssertionError('%s: %s' % (self.module, ex)), None, sys.exc_info()[-1] class LintTestUsingFile(LintTestUsingModule): |