diff options
Diffstat (limited to 'logilab/common/testlib.py')
-rw-r--r-- | logilab/common/testlib.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/logilab/common/testlib.py b/logilab/common/testlib.py index fa3e36e..dae1ff5 100644 --- a/logilab/common/testlib.py +++ b/logilab/common/testlib.py @@ -56,8 +56,8 @@ from shutil import rmtree from operator import itemgetter from inspect import isgeneratorfunction -from six import PY2, add_metaclass, string_types -from six.moves import builtins, range, configparser, input +import builtins +import configparser from logilab.common.deprecation import class_deprecated, deprecated @@ -90,8 +90,7 @@ is_generator = deprecated('[lgc 0.63] use inspect.isgeneratorfunction')(isgenera __unittest = 1 -@deprecated('with_tempdir is deprecated, use {0}.TemporaryDirectory.'.format( - 'tempfile' if not PY2 else 'backports.tempfile')) +@deprecated('with_tempdir is deprecated, use tempfile.TemporaryDirectory.') def with_tempdir(callable): """A decorator ensuring no temporary file left when the function return Work only for temporary file created with the tempfile module""" @@ -304,7 +303,7 @@ class Tags(set): if kwargs: raise TypeError("%s are an invalid keyword argument for this function" % kwargs.keys()) - if len(tags) == 1 and not isinstance(tags[0], string_types): + if len(tags) == 1 and not isinstance(tags[0], str): tags = tags[0] super(Tags, self).__init__(tags, **kwargs) @@ -550,8 +549,7 @@ class DocTestFinder(doctest.DocTestFinder): globs, source_lines) -@add_metaclass(class_deprecated) -class DocTest(TestCase): +class DocTest(TestCase, metaclass=class_deprecated): """trigger module doctest I don't know how to make unittest.main consider the DocTestSuite instance without this hack |