Mock Version: 6.7 Mock Version: 6.7 Mock Version: 6.7 Using nspawn with args ['--capability=cap_ipc_lock', '--bind-ro=/data/repos:/data/repos', '--bind=/tmp/mock-resolv.xkkq3zb7:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--bind=/dev/fuse', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '02d0126e738e447dbdb5224c317cf374', '-D', '/var/lib/mock/openstack-epoxy-alma-9-nobootstrap-build-320-35/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--bind-ro=/data/repos:/data/repos', '--bind=/tmp/mock-resolv.xkkq3zb7:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--bind=/dev/fuse', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-nose.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0', 'SYSTEMD_SECCOMP': '0'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1781654400 Wrote: /builddir/build/SRPMS/python-nose-1.3.7-34.el9.src.rpm Child return code was: 0 Using nspawn with args ['--capability=cap_ipc_lock', '--bind-ro=/data/repos:/data/repos', '--bind=/tmp/mock-resolv.xkkq3zb7:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--bind=/dev/fuse', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '3e55f3693f6b4a0ca4aa7d019ba68b07', '-D', '/var/lib/mock/openstack-epoxy-alma-9-nobootstrap-build-320-35/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--bind-ro=/data/repos:/data/repos', '--bind=/tmp/mock-resolv.xkkq3zb7:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--bind=/dev/fuse', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-nose.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0', 'SYSTEMD_SECCOMP': '0'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1781654400 Wrote: /builddir/build/SRPMS/python-nose-1.3.7-34.el9.src.rpm Child return code was: 0 Using nspawn with args ['--capability=cap_ipc_lock', '--bind-ro=/data/repos:/data/repos', '--bind=/tmp/mock-resolv.xkkq3zb7:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--bind=/dev/fuse', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '73c31093818a4fdc92b3059f1d63f325', '-D', '/var/lib/mock/openstack-epoxy-alma-9-nobootstrap-build-320-35/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--bind-ro=/data/repos:/data/repos', '--bind=/tmp/mock-resolv.xkkq3zb7:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--bind=/dev/fuse', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --noclean --target noarch --nodeps /builddir/build/SPECS/python-nose.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0', 'SYSTEMD_SECCOMP': '0'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1781654400 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.UYSgJD + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf nose-1.3.7 + /usr/bin/gzip -dc /builddir/build/SOURCES/nose-1.3.7.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd nose-1.3.7 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/cat /builddir/build/SOURCES/python-nose-coverage4.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + /usr/bin/cat /builddir/build/SOURCES/python-nose-py35.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + /usr/bin/cat /builddir/build/SOURCES/python-nose-unicode.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + /usr/bin/cat /builddir/build/SOURCES/python-nose-readunicode.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + /usr/bin/cat /builddir/build/SOURCES/python-nose-py36.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + /usr/bin/cat /builddir/build/SOURCES/python-nose-py38.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch + dos2unix examples/attrib_plugin.py dos2unix: converting file examples/attrib_plugin.py to Unix format... + /usr/bin/python3 -m lib2to3 -w -n nose bin/nosetests selftest.py unit_tests functional_tests RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: No changes to nose/__init__.py RefactoringTool: No changes to nose/__main__.py RefactoringTool: Refactored nose/case.py RefactoringTool: Refactored nose/commands.py RefactoringTool: Refactored nose/config.py RefactoringTool: Refactored nose/core.py --- nose/case.py (original) +++ nose/case.py (refactored) @@ -341,7 +341,7 @@ self.descriptor = descriptor if isfunction(method): raise ValueError("Unbound methods must be wrapped using pyversion.unbound_method before passing to MethodTestCase") - self.cls = method.im_class + self.cls = method.__self__.__class__ self.inst = self.cls() if self.test is None: method_name = self.method.__name__ --- nose/commands.py (original) +++ nose/commands.py (refactored) @@ -148,7 +148,7 @@ ei_cmd = self.get_finalized_command("egg_info") argv = ['nosetests', '--where', ei_cmd.egg_base] - for (option_name, cmd_name) in self.option_to_cmds.items(): + for (option_name, cmd_name) in list(self.option_to_cmds.items()): if option_name in option_blacklist: continue value = getattr(self, option_name) --- nose/config.py (original) +++ nose/config.py (refactored) @@ -3,7 +3,7 @@ import os import re import sys -import ConfigParser +import configparser from optparse import OptionParser from nose.util import absdir, tolist from nose.plugins.manager import NoPlugins @@ -62,24 +62,24 @@ def _readFromFilenames(self, filenames): config = [] for filename in filenames: - cfg = ConfigParser.RawConfigParser() + cfg = configparser.RawConfigParser() try: cfg.read(filename) - except ConfigParser.Error, exc: + except configparser.Error as exc: raise ConfigError("Error reading config file %r: %s" % (filename, str(exc))) config.extend(self._configTuples(cfg, filename)) return config def _readFromFileObject(self, fh): - cfg = ConfigParser.RawConfigParser() + cfg = configparser.RawConfigParser() try: filename = fh.name except AttributeError: filename = '' try: cfg.readfp(fh) - except ConfigParser.Error, exc: + except configparser.Error as exc: raise ConfigError("Error reading config file %r: %s" % (filename, str(exc))) return self._configTuples(cfg, filename) @@ -89,7 +89,7 @@ config_files.readline except AttributeError: filename_or_filenames = config_files - if isinstance(filename_or_filenames, basestring): + if isinstance(filename_or_filenames, str): filenames = [filename_or_filenames] else: filenames = filename_or_filenames @@ -113,12 +113,12 @@ continue try: self._processConfigValue(name, value, values, parser) - except NoSuchOptionError, exc: + except NoSuchOptionError as exc: self._file_error( "Error reading config file %r: " "no such option %r" % (filename, exc.name), name=name, filename=filename) - except optparse.OptionValueError, exc: + except optparse.OptionValueError as exc: msg = str(exc).replace('--' + name, repr(name), 1) self._file_error("Error reading config file %r: " "%s" % (filename, msg), @@ -128,12 +128,12 @@ values = self._parser.get_default_values() try: config = self._readConfiguration(config_files) - except ConfigError, exc: + except ConfigError as exc: self._error(str(exc)) else: try: self._applyConfigurationToValues(self._parser, config, values) - except ConfigError, exc: + except ConfigError as exc: self._error(str(exc)) return self._parser.parse_args(args, values) @@ -195,7 +195,7 @@ r'^_', r'^setup\.py$', ] - self.ignoreFiles = map(re.compile, self.ignoreFilesDefaultStrings) + self.ignoreFiles = list(map(re.compile, self.ignoreFilesDefaultStrings)) self.include = None self.loggingConfig = None self.logStream = sys.stderr @@ -247,7 +247,7 @@ d = self.__dict__.copy() # don't expose env, could include sensitive info d['env'] = {} - keys = [ k for k in d.keys() + keys = [ k for k in list(d.keys()) if not k.startswith('_') ] keys.sort() return "Config(%s)" % ', '.join([ '%s=%r' % (k, d[k]) @@ -328,17 +328,17 @@ self.testMatch = re.compile(options.testMatch) if options.ignoreFiles: - self.ignoreFiles = map(re.compile, tolist(options.ignoreFiles)) + self.ignoreFiles = list(map(re.compile, tolist(options.ignoreFiles))) log.info("Ignoring files matching %s", options.ignoreFiles) else: log.info("Ignoring files matching %s", self.ignoreFilesDefaultStrings) if options.include: - self.include = map(re.compile, tolist(options.include)) + self.include = list(map(re.compile, tolist(options.include))) log.info("Including tests matching %s", options.include) if options.exclude: - self.exclude = map(re.compile, tolist(options.exclude)) + self.exclude = list(map(re.compile, tolist(options.exclude))) log.info("Excluding tests matching %s", options.exclude) # When listing plugins we don't want to run them @@ -623,15 +623,15 @@ def __getnewargs__(self): return () - def __nonzero__(self): + def __bool__(self): return False def user_config_files(): """Return path to any existing user config files """ - return filter(os.path.exists, - map(os.path.expanduser, config_files)) + return list(filter(os.path.exists, + list(map(os.path.expanduser, config_files)))) def all_config_files(): --- nose/core.py (original) +++ nose/core.py (refactored) @@ -1,6 +1,6 @@ """Implements nose test program and collector. """ -from __future__ import generators + import logging import os @@ -150,7 +150,7 @@ if self.config.options.version: from nose import __version__ sys.stdout = sys.__stdout__ - print "%s version %s" % (os.path.basename(sys.argv[0]), __version__) + print("%s version %s" % (os.path.basename(sys.argv[0]), __version__)) sys.exit(0) if self.config.options.showPlugins: @@ -224,26 +224,26 @@ v = self.config.verbosity self.config.plugins.sort() for p in self.config.plugins: - print "Plugin %s" % p.name + print("Plugin %s" % p.name) if v >= 2: - print " score: %s" % p.score - print '\n'.join(textwrap.wrap(p.help().strip(), + print(" score: %s" % p.score) + print('\n'.join(textwrap.wrap(p.help().strip(), initial_indent=' ', - subsequent_indent=' ')) + subsequent_indent=' '))) if v >= 3: parser = DummyParser() p.addOptions(parser) if len(parser.options): - print - print " Options:" + print() + print(" Options:") for opts, help in parser.options: - print ' %s' % (', '.join(opts)) + print(' %s' % (', '.join(opts))) if help: - print '\n'.join( + print('\n'.join( RefactoringTool: No changes to nose/exc.py RefactoringTool: Refactored nose/failure.py RefactoringTool: No changes to nose/importer.py RefactoringTool: Refactored nose/inspector.py RefactoringTool: Refactored nose/loader.py RefactoringTool: No changes to nose/proxy.py RefactoringTool: Refactored nose/pyversion.py RefactoringTool: Refactored nose/result.py RefactoringTool: Refactored nose/selector.py textwrap.wrap(help.strip(), initial_indent=' ', - subsequent_indent=' ')) - print + subsequent_indent=' '))) + print() def usage(cls): import nose --- nose/failure.py (original) +++ nose/failure.py (refactored) @@ -36,7 +36,7 @@ def runTest(self): if self.tb is not None: if is_base_exception(self.exc_val): - raise self.exc_val, None, self.tb - raise self.exc_class, self.exc_val, self.tb + raise self.exc_val.with_traceback(self.tb) + raise self.exc_class(self.exc_val).with_traceback(self.tb) else: raise self.exc_class(self.exc_val) --- nose/inspector.py (original) +++ nose/inspector.py (refactored) @@ -9,9 +9,9 @@ import tokenize try: - from cStringIO import StringIO + from io import StringIO except ImportError: - from StringIO import StringIO + from io import StringIO log = logging.getLogger(__name__) @@ -38,7 +38,7 @@ try: for tok in tokenize.generate_tokens(src.readline): exp(*tok) - except tokenize.TokenError, e: + except tokenize.TokenError as e: # this can happen if our inspectable region happens to butt up # against the end of a construct like a docstring with the closing # """ on separate line --- nose/loader.py (original) +++ nose/loader.py (refactored) @@ -6,7 +6,7 @@ superclass, unittest.TestLoader, but extends it by more liberal interpretations of what may be a test and how a test may be named. """ -from __future__ import generators + import logging import os @@ -113,7 +113,7 @@ return False return sel.wantMethod(item) - cases = filter(wanted, dir(testCaseClass)) + cases = list(filter(wanted, dir(testCaseClass))) # add runTest if nothing else picked if not cases and hasattr(testCaseClass, 'runTest'): @@ -224,7 +224,7 @@ # Plugins can yield False to indicate that they were # unable to load tests from a file, but it was not an # error -- the file just had no tests to load. - tests = filter(None, tests) + tests = [_f for _f in tests if _f] return self.suiteClass(tests) else: # Nothing was able to even try to load from this file @@ -274,7 +274,7 @@ # convert the unbound generator method # into a bound method so it can be called below if hasattr(generator, 'im_class'): - cls = generator.im_class + cls = generator.__self__.__class__ inst = cls() method = generator.__name__ generator = getattr(inst, method) @@ -329,8 +329,7 @@ test_funcs.append(test) sort_list(test_classes, lambda x: x.__name__) sort_list(test_funcs, func_lineno) - tests = map(lambda t: self.makeTest(t, parent=module), - test_classes + test_funcs) + tests = [self.makeTest(t, parent=module) for t in test_classes + test_funcs] # Now, descend into packages # FIXME can or should this be lazy? --- nose/pyversion.py (original) +++ nose/pyversion.py (refactored) @@ -16,12 +16,12 @@ # In Python 3.x, all strings are unicode (the call to 'unicode()' in the 2.x # source will be replaced with 'str()' when running 2to3, so this test will # then become true) -UNICODE_STRINGS = (type(unicode()) == type(str())) +UNICODE_STRINGS = (type(str()) == type(str())) if sys.version_info[:2] < (3, 0): def force_unicode(s, encoding='UTF-8'): try: - s = unicode(s) + s = str(s) except UnicodeDecodeError: s = str(s).decode(encoding, 'replace') @@ -35,7 +35,7 @@ try: import new def make_instancemethod(function, instance): - return new.instancemethod(function.im_func, instance, + return new.instancemethod(function.__func__, instance, instance.__class__) except ImportError: def make_instancemethod(function, instance): @@ -73,8 +73,8 @@ # thus types.ClassType and types.TypeType don't exist anymore. For # compatibility, we make sure they still work. if hasattr(types, 'ClassType'): - ClassType = types.ClassType - TypeType = types.TypeType + ClassType = type + TypeType = type else: ClassType = type TypeType = type @@ -90,7 +90,7 @@ self._func = func self.__self__ = UnboundSelf(cls) if sys.version_info < (3, 0): - self.im_class = cls + self.__self__.__class__ = cls self.__doc__ = getattr(func, '__doc__', None) def address(self): @@ -161,7 +161,7 @@ def isgenerator(func): try: - return func.func_code.co_flags & CO_GENERATOR != 0 + return func.__code__.co_flags & CO_GENERATOR != 0 except AttributeError: return False @@ -187,8 +187,8 @@ msg = force_unicode(msg, encoding=encoding) clsname = force_unicode(ev.__class__.__name__, encoding=encoding) - ev = u'%s: %s' % (clsname, msg) - elif not isinstance(ev, unicode): + ev = '%s: %s' % (clsname, msg) + elif not isinstance(ev, str): ev = repr(ev) return force_unicode(ev, encoding=encoding) --- nose/result.py (original) +++ nose/result.py (refactored) @@ -62,7 +62,7 @@ except TypeError: # 2.3 compat exc_info = self._exc_info_to_string(err) - for cls, (storage, label, isfail) in self.errorClasses.items(): + for cls, (storage, label, isfail) in list(self.errorClasses.items()): #if 'Skip' in cls.__name__ or 'Skip' in ec.__name__: # from nose.tools import set_trace # set_trace() @@ -101,7 +101,7 @@ """Overrides to print all errorClasses errors as well. """ _TextTestResult.printErrors(self) - for cls in self.errorClasses.keys(): + for cls in list(self.errorClasses.keys()): storage, label, isfail = self.errorClasses[cls] if isfail: self.printErrorList(label, storage) @@ -124,7 +124,7 @@ writeln() summary = {} - eckeys = self.errorClasses.keys() + eckeys = list(self.errorClasses.keys()) for cls in eckeys: storage, label, isfail = self.errorClasses[cls] count = len(storage) @@ -140,7 +140,7 @@ write("FAILED") else: write("OK") - items = summary.items() + items = list(summary.items()) if items: items.sort() write(" (") @@ -157,7 +157,7 @@ """ if self.errors or self.failures: return False - for cls in self.errorClasses.keys(): + for cls in list(self.errorClasses.keys()): storage, label, isfail = self.errorClasses[cls] if not isfail: continue --- nose/selector.py (original) +++ nose/selector.py (refactored) @@ -52,11 +52,9 @@ """ return ((self.match.search(name) or (self.include and - filter(None, - [inc.search(name) for inc in self.include]))) + [_f for _f in [inc.search(name) for inc in self.include] if _f])) and ((not self.exclude) - or not filter(None, - [exc.search(name) for exc in self.exclude]) + or not [_f for _f in [exc.search(name) for exc in self.exclude] if _f] )) def wantClass(self, cls): @@ -89,9 +87,7 @@ tail = op_basename(dirname) if ispackage(dirname): RefactoringTool: Refactored nose/suite.py RefactoringTool: Refactored nose/twistedtools.py RefactoringTool: Refactored nose/util.py RefactoringTool: No changes to nose/ext/__init__.py RefactoringTool: Refactored nose/ext/dtcompat.py wanted = (not self.exclude - or not filter(None, - [exc.search(tail) for exc in self.exclude] - )) + or not [_f for _f in [exc.search(tail) for exc in self.exclude] if _f]) else: wanted = (self.matches(tail) or (self.config.srcDirs --- nose/suite.py (original) +++ nose/suite.py (refactored) @@ -7,7 +7,7 @@ functions or methods) for the context that contains its tests. """ -from __future__ import generators + import logging import sys @@ -75,14 +75,14 @@ test(result) return result - def __nonzero__(self): + def __bool__(self): log.debug("tests in %s?", id(self)) if self._precache: return True if self.test_generator is None: return False try: - test = self.test_generator.next() + test = next(self.test_generator) if test is not None: self._precache.append(test) return True @@ -439,7 +439,7 @@ # don't want that, instead want the module the class is in now # (classes are re-ancestored elsewhere). if hasattr(context, 'im_class'): - context = context.im_class + context = context.__self__.__class__ elif hasattr(context, '__self__'): context = context.__self__.__class__ if hasattr(context, '__module__'): --- nose/twistedtools.py (original) +++ nose/twistedtools.py (refactored) @@ -29,7 +29,7 @@ """ import sys -from Queue import Queue, Empty +from queue import Queue, Empty from nose.tools import make_decorator, TimeExpired __all__ = [ @@ -166,7 +166,7 @@ # Re-raise all exceptions if error is not None: exc_type, exc_value, tb = error - raise exc_type, exc_value, tb + raise exc_type(exc_value).with_traceback(tb) wrapper = make_decorator(func)(wrapper) return wrapper return decorate --- nose/util.py (original) +++ nose/util.py (refactored) @@ -151,7 +151,7 @@ return func.compat_co_firstlineno except AttributeError: try: - return func.func_code.co_firstlineno + return func.__code__.co_firstlineno except AttributeError: return -1 @@ -400,7 +400,7 @@ file = getattr(test, '__file__', None) module = getattr(test, '__name__', None) return (src(file), module, call) - if t == types.FunctionType or issubclass(t, type) or t == types.ClassType: + if t == types.FunctionType or issubclass(t, type) or t == type: module = getattr(test, '__module__', None) if module is not None: m = sys.modules[module] @@ -410,7 +410,7 @@ call = getattr(test, '__name__', None) return (src(file), module, call) if t == types.MethodType: - cls_adr = test_address(test.im_class) + cls_adr = test_address(test.__self__.__class__) return (src(cls_adr[0]), cls_adr[1], "%s.%s" % (cls_adr[2], test.__name__)) # handle unittest.TestCase instances @@ -552,7 +552,7 @@ self._keys.append(key) def __str__(self): - return "{%s}" % ', '.join(["%r: %r" % (k, v) for k, v in self.items()]) + return "{%s}" % ', '.join(["%r: %r" % (k, v) for k, v in list(self.items())]) def clear(self): super(odict, self).clear() @@ -564,7 +564,7 @@ return d def items(self): - return zip(self._keys, self.values()) + return list(zip(self._keys, list(self.values()))) def keys(self): return self._keys[:] @@ -577,12 +577,12 @@ def update(self, dict): super(odict, self).update(dict) - for key in dict.keys(): + for key in list(dict.keys()): if key not in self._keys: self._keys.append(key) def values(self): - return map(self.get, self._keys) + return list(map(self.get, self._keys)) def transplant_func(func, module): @@ -654,7 +654,7 @@ if isinstance(val, Exception): return ' '.join([safe_str(arg, encoding) for arg in val]) - return unicode(val).encode(encoding) + return str(val).encode(encoding) def is_executable(file): --- nose/ext/dtcompat.py (original) +++ nose/ext/dtcompat.py (refactored) @@ -104,7 +104,7 @@ import sys, traceback, inspect, linecache, os, re import unittest, difflib, pdb, tempfile import warnings -from StringIO import StringIO +from io import StringIO # Don't whine about the deprecated is_private function in this # module's tests. @@ -219,7 +219,7 @@ """ if inspect.ismodule(module): return module - elif isinstance(module, (str, unicode)): + elif isinstance(module, str): return __import__(module, globals(), locals(), ["*"]) elif module is None: return sys.modules[sys._getframe(depth).f_globals['__name__']] @@ -341,9 +341,9 @@ # [XX] Normalize with respect to os.path.pardir? def _module_relative_path(module, path): if not inspect.ismodule(module): - raise TypeError, 'Expected a module: %r' % module + raise TypeError('Expected a module: %r' % module) if path.startswith('/'): - raise ValueError, 'Module-relative files may not have absolute paths' + raise ValueError('Module-relative files may not have absolute paths') # Find the base directory for the path. if hasattr(module, '__file__'): @@ -457,7 +457,7 @@ Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`. """ - assert not isinstance(examples, basestring), \ + assert not isinstance(examples, str), \ "DocTest no longer accepts str; use DocTestParser instead" self.examples = examples self.docstring = docstring @@ -856,7 +856,7 @@ if module is None: return True elif inspect.isfunction(object): - return module.__dict__ is object.func_globals + return module.__dict__ is object.__globals__ elif inspect.isclass(object): # Some jython classes don't set __module__ return module.__name__ == getattr(object, '__module__', None) @@ -875,7 +875,7 @@ add them to `tests`. """ if self._verbose: - print 'Finding tests in %s' % name + print('Finding tests in %s' % name) # If we've already processed this object, then ignore it. if id(obj) in seen: @@ -889,7 +889,7 @@ # Look for tests in a module's contained objects. if inspect.ismodule(obj) and self._recurse: - for valname, val in obj.__dict__.items(): + for valname, val in list(obj.__dict__.items()): # Check if this contained object should be ignored. if self._filter(val, name, valname): continue @@ -902,14 +902,14 @@ # Look for tests in a module's __test__ dictionary. if inspect.ismodule(obj) and self._recurse: - for valname, val in getattr(obj, '__test__', {}).items(): - if not isinstance(valname, basestring): + for valname, val in list(getattr(obj, '__test__', {}).items()): + if not isinstance(valname, str): raise ValueError("DocTestFinder.find: __test__ keys " "must be strings: %r" % (type(valname),)) if not (inspect.isfunction(val) or inspect.isclass(val) or inspect.ismethod(val) or inspect.ismodule(val) or - isinstance(val, basestring)): + isinstance(val, str)): raise ValueError("DocTestFinder.find: __test__ values " "must be strings, functions, methods, " RefactoringTool: No changes to nose/plugins/__init__.py RefactoringTool: No changes to nose/plugins/allmodules.py RefactoringTool: Refactored nose/plugins/attrib.py RefactoringTool: Refactored nose/plugins/base.py RefactoringTool: No changes to nose/plugins/builtin.py RefactoringTool: Refactored nose/plugins/capture.py "classes, or modules: %r" % @@ -920,7 +920,7 @@ # Look for tests in a class's contained objects. if inspect.isclass(obj) and self._recurse: - for valname, val in obj.__dict__.items(): + for valname, val in list(obj.__dict__.items()): # Check if this contained object should be ignored. if self._filter(val, name, valname): continue @@ -928,7 +928,7 @@ if isinstance(val, staticmethod): val = getattr(obj, valname) if isinstance(val, classmethod): - val = getattr(obj, valname).im_func + val = getattr(obj, valname).__func__ # Recurse to methods, properties, and nested classes. if ((inspect.isfunction(val) or inspect.isclass(val) or @@ -945,7 +945,7 @@ """ # Extract the object's docstring. If it doesn't have one, # then return None (no test for this object). - if isinstance(obj, basestring): + if isinstance(obj, str): docstring = obj else: try: @@ -953,7 +953,7 @@ docstring = '' else: docstring = obj.__doc__ - if not isinstance(docstring, basestring): + if not isinstance(docstring, str): docstring = str(docstring) except (TypeError, AttributeError): docstring = '' @@ -1003,8 +1003,8 @@ break # Find the line number for functions & methods. - if inspect.ismethod(obj): obj = obj.im_func - if inspect.isfunction(obj): obj = obj.func_code + if inspect.ismethod(obj): obj = obj.__func__ + if inspect.isfunction(obj): obj = obj.__code__ if inspect.istraceback(obj): obj = obj.tb_frame if inspect.isframe(obj): obj = obj.f_code if inspect.iscode(obj): @@ -1143,7 +1143,7 @@ # to modify them). original_optionflags = self.optionflags - SUCCESS, FAILURE, BOOM = range(3) # `outcome` state + SUCCESS, FAILURE, BOOM = list(range(3)) # `outcome` state check = self._checker.check_output @@ -1158,7 +1158,7 @@ # Merge in the example's options. self.optionflags = original_optionflags if example.options: - for (optionflag, val) in example.options.items(): + for (optionflag, val) in list(example.options.items()): if val: self.optionflags |= optionflag else: @@ -1179,8 +1179,8 @@ # keyboard interrupts.) try: # Don't blink! This is where the user's code gets run. - exec compile(example.source, filename, "single", - compileflags, 1) in test.globs + exec(compile(example.source, filename, "single", + compileflags, 1), test.globs) self.debugger.set_continue() # ==== Example Finished ==== exception = None except KeyboardInterrupt: @@ -1341,7 +1341,7 @@ passed = [] failed = [] totalt = totalf = 0 - for x in self._name2ft.items(): + for x in list(self._name2ft.items()): name, (f, t) = x assert f <= t totalt += t @@ -1354,28 +1354,28 @@ failed.append(x) if verbose: if notests: - print len(notests), "items had no tests:" + print(len(notests), "items had no tests:") notests.sort() for thing in notests: - print " ", thing + print(" ", thing) if passed: - print len(passed), "items passed all tests:" + print(len(passed), "items passed all tests:") passed.sort() for thing, count in passed: - print " %3d tests in %s" % (count, thing) + print(" %3d tests in %s" % (count, thing)) if failed: - print self.DIVIDER - print len(failed), "items had failures:" + print(self.DIVIDER) + print(len(failed), "items had failures:") failed.sort() for thing, (f, t) in failed: - print " %3d of %3d in %s" % (f, t, thing) + print(" %3d of %3d in %s" % (f, t, thing)) if verbose: - print totalt, "tests in", len(self._name2ft), "items." - print totalt - totalf, "passed and", totalf, "failed." + print(totalt, "tests in", len(self._name2ft), "items.") + print(totalt - totalf, "passed and", totalf, "failed.") if totalf: - print "***Test Failed***", totalf, "failures." + print("***Test Failed***", totalf, "failures.") elif verbose: - print "Test passed." + print("Test passed.") return totalf, totalt #///////////////////////////////////////////////////////////////// @@ -1383,10 +1383,10 @@ #///////////////////////////////////////////////////////////////// def merge(self, other): d = self._name2ft - for name, (f, t) in other._name2ft.items(): + for name, (f, t) in list(other._name2ft.items()): if name in d: - print "*** DocTestRunner.merge: '" + name + "' in both" \ - " testers; summing outcomes." + print("*** DocTestRunner.merge: '" + name + "' in both" \ + " testers; summing outcomes.") f2, t2 = d[name] f = f + f2 t = t + t2 @@ -1875,10 +1875,10 @@ def runstring(self, s, name): test = DocTestParser().get_doctest(s, self.globs, name, None, None) if self.verbose: - print "Running string", name + print("Running string", name) (f,t) = self.testrunner.run(test) if self.verbose: - print f, "of", t, "examples failed in string", name + print(f, "of", t, "examples failed in string", name) return (f,t) def rundoc(self, object, name=None, module=None): @@ -2245,9 +2245,9 @@ if pm: try: - execfile(srcfilename, globs, globs) + exec(compile(open(srcfilename, "rb").read(), srcfilename, 'exec'), globs, globs) except: - print sys.exc_info()[1] + print(sys.exc_info()[1]) pdb.post_mortem(sys.exc_info()[2]) else: # Note that %r is vital here. '%s' instead can, e.g., cause --- nose/plugins/attrib.py (original) +++ nose/plugins/attrib.py (refactored) @@ -118,7 +118,7 @@ def wrap_ob(ob): for name in args: setattr(ob, name, True) - for name, value in kwargs.iteritems(): + for name, value in kwargs.items(): setattr(ob, name, value) return ob return wrap_ob @@ -280,7 +280,7 @@ """Accept the method if its attributes match. """ try: - cls = method.im_class + cls = method.__self__.__class__ except AttributeError: return False return self.validateAttrib(method, cls) --- nose/plugins/base.py (original) +++ nose/plugins/base.py (refactored) @@ -67,7 +67,7 @@ try: self.options(parser, env) self.can_configure = True - except OptionConflictError, e: + except OptionConflictError as e: warn("Plugin %s has conflicting option string: %s and will " "be disabled" % (self, e), RuntimeWarning) self.enabled = False --- nose/plugins/capture.py (original) +++ nose/plugins/capture.py (refactored) @@ -16,7 +16,7 @@ from nose.plugins.base import Plugin from nose.pyversion import exc_to_unicode, force_unicode from nose.util import ln RefactoringTool: No changes to nose/plugins/collect.py RefactoringTool: Refactored nose/plugins/cover.py RefactoringTool: No changes to nose/plugins/debug.py RefactoringTool: No changes to nose/plugins/deprecated.py RefactoringTool: Refactored nose/plugins/doctests.py RefactoringTool: Refactored nose/plugins/errorclass.py RefactoringTool: No changes to nose/plugins/failuredetail.py RefactoringTool: Refactored nose/plugins/isolate.py -from StringIO import StringIO +from io import StringIO log = logging.getLogger(__name__) @@ -111,17 +111,17 @@ # from an exception raised while trying to get the captured output. ev = exc_to_unicode(ev) output = force_unicode(output) - error_text = [ev, ln(u'>> begin captured stdout <<'), - output, ln(u'>> end captured stdout <<')] + error_text = [ev, ln('>> begin captured stdout <<'), + output, ln('>> end captured stdout <<')] if output_exc_info: - error_text.extend([u'OUTPUT ERROR: Could not get captured output.', + error_text.extend(['OUTPUT ERROR: Could not get captured output.', # # - u"The test might've printed both 'unicode' strings and non-ASCII 8-bit 'str' strings.", - ln(u'>> begin captured stdout exception traceback <<'), - u''.join(traceback.format_exception(*output_exc_info)), - ln(u'>> end captured stdout exception traceback <<')]) - return u'\n'.join(error_text) + "The test might've printed both 'unicode' strings and non-ASCII 8-bit 'str' strings.", + ln('>> begin captured stdout exception traceback <<'), + ''.join(traceback.format_exception(*output_exc_info)), + ln('>> end captured stdout exception traceback <<')]) + return '\n'.join(error_text) def start(self): self.stdout.append(sys.stdout) --- nose/plugins/cover.py (original) +++ nose/plugins/cover.py (refactored) @@ -13,7 +13,7 @@ import logging import re import sys -import StringIO +import io from nose.plugins.base import Plugin from nose.util import src, tolist @@ -145,7 +145,7 @@ self.coverInstance.exclude('#pragma[: ]+[nN][oO] [cC][oO][vV][eE][rR]') log.debug("Coverage begin") - self.skipModules = sys.modules.keys()[:] + self.skipModules = list(sys.modules.keys())[:] if self.coverErase: log.debug("Clearing previously collected coverage statistics") self.coverInstance.combine() @@ -184,7 +184,7 @@ self.coverInstance.combine() self.coverInstance.save() modules = [module - for name, module in sys.modules.items() + for name, module in list(sys.modules.items()) if self.wantModuleCoverage(name, module)] log.debug("Coverage report will cover modules: %s", modules) self.coverInstance.report(modules, file=stream, show_missing=True) @@ -194,19 +194,19 @@ log.debug("Generating HTML coverage report") try: self.coverInstance.html_report(modules, self.coverHtmlDir) - except coverage.misc.CoverageException, e: + except coverage.misc.CoverageException as e: log.warning("Failed to generate HTML report: %s" % str(e)) if self.coverXmlFile: log.debug("Generating XML coverage report") try: self.coverInstance.xml_report(modules, self.coverXmlFile) - except coverage.misc.CoverageException, e: + except coverage.misc.CoverageException as e: log.warning("Failed to generate XML report: %s" % str(e)) # make sure we have minimum required coverage if self.coverMinPercentage: - f = StringIO.StringIO() + f = io.StringIO() self.coverInstance.report(modules, file=f, show_missing=True) multiPackageRe = (r'-------\s\w+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?' --- nose/plugins/doctests.py (original) +++ nose/plugins/doctests.py (refactored) @@ -47,7 +47,7 @@ additional documentation and examples. """ -from __future__ import generators + import codecs import logging @@ -60,11 +60,11 @@ from nose.util import anyp, getpackage, test_address, resolve_name, \ src, tolist, isproperty try: - from cStringIO import StringIO + from io import StringIO except ImportError: - from StringIO import StringIO + from io import StringIO import sys -import __builtin__ as builtin_mod +import builtins as builtin_mod log = logging.getLogger(__name__) @@ -276,7 +276,7 @@ try: fixture_context = __import__( fixt_mod, globals(), locals(), ["nop"]) - except ImportError, e: + except ImportError as e: log.debug( "Could not import %s: %s (%s)", fixt_mod, e, sys.path) log.debug("Fixture module %s resolved to %s", @@ -322,13 +322,11 @@ # FIXME don't think we need include/exclude checks here? return ((self.doctest_tests or not self.conf.testMatch.search(name) or (self.conf.include - and filter(None, - [inc.search(name) - for inc in self.conf.include]))) + and [_f for _f in [inc.search(name) + for inc in self.conf.include] if _f])) and (not self.conf.exclude - or not filter(None, - [exc.search(name) - for exc in self.conf.exclude]))) + or not [_f for _f in [exc.search(name) + for exc in self.conf.exclude] if _f])) def wantFile(self, file): """Override to select all modules and any file ending with @@ -341,9 +339,8 @@ if (self.extension and anyp(file.endswith, self.extension) and (not self.conf.exclude - or not filter(None, - [exc.search(file) - for exc in self.conf.exclude]))): + or not [_f for _f in [exc.search(file) + for exc in self.conf.exclude] if _f])): return True return None @@ -414,7 +411,7 @@ if value is None: return setattr(builtin_mod, self._result_var, value) - print repr(value) + print(repr(value)) def tearDown(self): super(DocTestCase, self).tearDown() @@ -447,7 +444,7 @@ if value is None: return setattr(builtin_mod, self._result_var, value) - print repr(value) + print(repr(value)) def tearDown(self): super(DocFileCase, self).tearDown() --- nose/plugins/errorclass.py (original) +++ nose/plugins/errorclass.py (refactored) @@ -103,7 +103,7 @@ """ def __init__(self, name, bases, attr): errorClasses = [] - for name, detail in attr.items(): + for name, detail in list(attr.items()): if isinstance(detail, ErrorClass): attr.pop(name) for cls in detail: @@ -127,12 +127,11 @@ return iter(self.errorClasses) -class ErrorClassPlugin(Plugin): +class ErrorClassPlugin(Plugin, metaclass=MetaErrorClass): """ Base class for ErrorClass plugins. Subclass this class and declare the exceptions that you wish to handle as attributes of the subclass. """ - __metaclass__ = MetaErrorClass score = 1000 errorClasses = () @@ -141,7 +140,7 @@ if not isclass(err_cls): return classes = [e[0] for e in self.errorClasses] - if filter(lambda c: issubclass(err_cls, c), classes): + if [c for c in classes if issubclass(err_cls, c)]: return True def prepareTestResult(self, result): --- nose/plugins/isolate.py (original) +++ nose/plugins/isolate.py (refactored) @@ -72,7 +72,7 @@ it was in when mod stack was pushed. """ RefactoringTool: Refactored nose/plugins/logcapture.py RefactoringTool: Refactored nose/plugins/manager.py RefactoringTool: Refactored nose/plugins/multiprocess.py RefactoringTool: Refactored nose/plugins/plugintest.py RefactoringTool: No changes to nose/plugins/prof.py RefactoringTool: No changes to nose/plugins/skip.py RefactoringTool: Refactored nose/plugins/testid.py RefactoringTool: Refactored nose/plugins/xunit.py mods = self._mod_stack.pop() - to_del = [ m for m in sys.modules.keys() if m not in mods ] + to_del = [ m for m in list(sys.modules.keys()) if m not in mods ] if to_del: log.debug('removing sys modules entries: %s', to_del) for mod in to_del: --- nose/plugins/logcapture.py (original) +++ nose/plugins/logcapture.py (refactored) @@ -23,9 +23,9 @@ from nose.util import anyp, ln, safe_str try: - from cStringIO import StringIO + from io import StringIO except ImportError: - from StringIO import StringIO + from io import StringIO log = logging.getLogger(__name__) @@ -57,7 +57,7 @@ any item in `matchers`""" def record_matches_key(key): return record == key or record.startswith(key + '.') - return anyp(bool, map(record_matches_key, matchers)) + return anyp(bool, list(map(record_matches_key, matchers))) _any_match = staticmethod(_any_match) def _allow(self, record): @@ -180,7 +180,7 @@ if hasattr(root_logger, "handlers"): for handler in root_logger.handlers: root_logger.removeHandler(handler) - for logger in logging.Logger.manager.loggerDict.values(): + for logger in list(logging.Logger.manager.loggerDict.values()): if hasattr(logger, "handlers"): for handler in logger.handlers: logger.removeHandler(handler) @@ -237,7 +237,7 @@ return (ec, self.addCaptureToErr(ev, records), tb) def formatLogRecords(self): - return map(safe_str, self.handler.buffer) + return list(map(safe_str, self.handler.buffer)) def addCaptureToErr(self, ev, records): return '\n'.join([safe_str(ev), ln('>> begin captured logging <<')] + \ --- nose/plugins/manager.py (original) +++ nose/plugins/manager.py (refactored) @@ -60,13 +60,13 @@ from nose.pyversion import sort_list try: - import cPickle as pickle + import pickle as pickle except: import pickle try: - from cStringIO import StringIO + from io import StringIO except: - from StringIO import StringIO + from io import StringIO __all__ = ['DefaultPluginManager', 'PluginManager', 'EntryPointPluginManager', @@ -387,7 +387,7 @@ plugcls = ep.load() except KeyboardInterrupt: raise - except Exception, e: + except Exception as e: # never want a plugin load to kill the test run # but we can't log here because the logger is not yet # configured --- nose/plugins/multiprocess.py (original) +++ nose/plugins/multiprocess.py (refactored) @@ -115,12 +115,12 @@ from unittest.runner import _WritelnDecorator except ImportError: from unittest import _WritelnDecorator -from Queue import Empty +from queue import Empty from warnings import warn try: - from cStringIO import StringIO + from io import StringIO except ImportError: - import StringIO + import io # this is a list of plugin classes that will be checked for and created inside # each worker process @@ -478,7 +478,7 @@ self.config.multiprocess_timeout-timeprocessing) log.debug("Completed %s tasks (%s remain)", len(completed), len(tasks)) - except (KeyboardInterrupt, SystemExit), e: + except (KeyboardInterrupt, SystemExit) as e: log.info('parent received ctrl-c when waiting for test results') thrownError = e #resultQueue.get(False) @@ -633,7 +633,7 @@ result.testsRun += testsRun result.failures.extend(failures) result.errors.extend(errors) - for key, (storage, label, isfail) in errorClasses.items(): + for key, (storage, label, isfail) in list(errorClasses.items()): if key not in result.errorClasses: # Ordinarily storage is result attribute # but it's only processed through the errorClasses @@ -688,7 +688,7 @@ failures = [(TestLet(c), err) for c, err in result.failures] errors = [(TestLet(c), err) for c, err in result.errors] errorClasses = {} - for key, (storage, label, isfail) in result.errorClasses.items(): + for key, (storage, label, isfail) in list(result.errorClasses.items()): errorClasses[key] = ([(TestLet(c), err) for c, err in storage], label, isfail) return ( @@ -715,7 +715,7 @@ test(result) currentaddr.value = bytes_('') resultQueue.put((ix, test_addr, test.tasks, batch(result))) - except KeyboardInterrupt, e: #TimedOutException: + except KeyboardInterrupt as e: #TimedOutException: timeout = isinstance(e, TimedOutException) if timeout: keyboardCaught.set() @@ -810,7 +810,7 @@ #log.debug('running test %s in suite %s', test, self); try: test(orig) - except KeyboardInterrupt, e: + except KeyboardInterrupt as e: timeout = isinstance(e, TimedOutException) if timeout: msg = 'Timeout when running test %s in suite %s' --- nose/plugins/plugintest.py (original) +++ nose/plugins/plugintest.py (refactored) @@ -100,9 +100,9 @@ from warnings import warn try: - from cStringIO import StringIO + from io import StringIO except ImportError: - from StringIO import StringIO + from io import StringIO __all__ = ['PluginTester', 'run'] @@ -135,7 +135,7 @@ if getpid() != self.__master: return - from Queue import Empty + from queue import Empty from collections import defaultdict cache = defaultdict(str) while True: @@ -404,7 +404,7 @@ sys.stderr = stderr sys.stdout = stdout out = buffer.getvalue() - print munge_nose_output_for_doctest(out) + print(munge_nose_output_for_doctest(out)) def run_buffered(*arg, **kw): --- nose/plugins/testid.py (original) +++ nose/plugins/testid.py (refactored) @@ -100,7 +100,7 @@ from nose.util import src, set try: - from cPickle import dump, load + from pickle import dump, load except ImportError: from pickle import dump, load @@ -198,7 +198,7 @@ self.ids, self.tests, self.failed, self.source_names, self.idfile) fh.close() - except ValueError, e: + except ValueError as e: # load() may throw a ValueError when reading the ids file, if it # was generated with a newer version of Python than we are currently # running. --- nose/plugins/xunit.py (original) +++ nose/plugins/xunit.py (refactored) @@ -46,7 +46,7 @@ import traceback import re import inspect -from StringIO import StringIO +from io import StringIO from time import time from xml.sax import saxutils @@ -110,7 +110,7 @@ result = str(exc) except UnicodeEncodeError: try: - result = unicode(exc) + result = str(exc) except UnicodeError: # Fallback to args as neither str nor # unicode(Exception(u'\xe6')) work in Python < 2.6 @@ -213,13 +213,13 @@ self.stats['total'] = (self.stats['errors'] + self.stats['failures'] + self.stats['passes'] + self.stats['skipped']) self.error_report_file.write( - u'' - u'' % self.stats) - self.error_report_file.write(u''.join([force_unicode(e, self.encoding) + '' + '' % self.stats) + self.error_report_file.write(''.join([force_unicode(e, self.encoding) for e in self.errorlist])) - self.error_report_file.write(u'') + self.error_report_file.write('') self.error_report_file.close() if self.config.verbosity > 1: stream.writeln("-" * 70) @@ -288,9 +288,9 @@ id = test.id() self.errorlist.append( - u'' - u'<%(type)s type=%(errtype)s message=%(message)s>' - u'%(systemout)s%(systemerr)s' % + '' + '<%(type)s type=%(errtype)s message=%(message)s>' + '%(systemout)s%(systemerr)s' % {'cls': self._quoteattr(id_split(id)[0]), 'name': self._quoteattr(id_split(id)[-1]), 'taken': taken, @@ -311,9 +311,9 @@ id = test.id() self.errorlist.append( - u'' - u'' - u'%(systemout)s%(systemerr)s' % + '' + '' + '%(systemout)s%(systemerr)s' % {'cls': self._quoteattr(id_split(id)[0]), 'name': self._quoteattr(id_split(id)[-1]), 'taken': taken, --- nose/tools/nontrivial.py (original) +++ nose/tools/nontrivial.py (refactored) @@ -26,7 +26,7 @@ newfunc.__doc__ = func.__doc__ newfunc.__module__ = func.__module__ if not hasattr(newfunc, 'compat_co_firstlineno'): - newfunc.compat_co_firstlineno = func.func_code.co_firstlineno + newfunc.compat_co_firstlineno = func.__code__.co_firstlineno try: newfunc.__name__ = name except TypeError: --- unit_tests/mock.py (original) +++ unit_tests/mock.py (refactored) @@ -28,27 +28,27 @@ self.assertMyTest(test) self.called.append(('beforeTest', test)) def startTest(self, test): - print "proxy startTest" + print("proxy startTest") self.assertMyTest(test) self.called.append(('startTest', test)) def stopTest(self, test): - print "proxy stopTest" + print("proxy stopTest") self.assertMyTest(test) self.called.append(('stopTest', test)) def addDeprecated(self, test, err): - print "proxy addDeprecated" + print("proxy addDeprecated") self.assertMyTest(test) self.called.append(('addDeprecated', test, err)) def addError(self, test, err): - print "proxy addError" + print("proxy addError") self.assertMyTest(test) self.called.append(('addError', test, err)) def addFailure(self, test, err): - print "proxy addFailure" + print("proxy addFailure") self.assertMyTest(test) self.called.append(('addFailure', test, err)) def addSkip(self, test, err): - print "proxy addSkip" + print("proxy addSkip") self.assertMyTest(test) self.called.append(('addSkip', test, err)) def addSuccess(self, test): @@ -72,7 +72,7 @@ self.called = odict() def calls(self): - return self.called.keys() + return list(self.called.keys()) class RecordingPluginProxy(object): @@ -92,7 +92,7 @@ self.__dict__['d'].update(kw) def __getattr__(self, attr): - if not self.__dict__.has_key('d'): + if 'd' not in self.__dict__: return None return self.__dict__['d'].get(attr) --- unit_tests/test_bug105.py (original) +++ unit_tests/test_bug105.py (refactored) @@ -10,8 +10,8 @@ 'support', 'bug105')) l = TestLoader() - testmod = l.loadTestsFromDir(where).next() - print testmod + testmod = next(l.loadTestsFromDir(where)) + print(testmod) testmod.setUp() def fix(t): @@ -20,8 +20,8 @@ return s[s.index(': ')+2:] return s - tests = map(fix, testmod) - print tests + tests = list(map(fix, testmod)) + print(tests) self.assertEqual(tests, ['tests.test_z', 'tests.test_a', 'tests.test_dz', 'tests.test_mdz', 'tests.test_b']) --- unit_tests/test_capture_plugin.py (original) +++ unit_tests/test_capture_plugin.py (refactored) @@ -57,14 +57,14 @@ def test_captures_stdout(self): c = Capture() c.start() - print "Hello" + print("Hello") c.end() self.assertEqual(c.buffer, "Hello\n") def test_captures_nonascii_stdout(self): c = Capture() c.start() - print "test 日本" + print("test 日本") c.end() self.assertEqual(c.buffer, "test 日本\n") @@ -76,8 +76,8 @@ c.start() printed_nonascii_str = force_unicode("test 日本").encode('utf-8') printed_unicode = force_unicode("Hello") - print printed_nonascii_str - print printed_unicode + print(printed_nonascii_str) + print(printed_unicode) try: raise Exception("boom") except: @@ -104,7 +104,7 @@ c = Capture() c.start() try: - print "Oh my!" + print("Oh my!") raise Exception("boom") except: err = sys.exc_info() @@ -125,8 +125,8 @@ c = Capture() c.start() try: - print "debug 日本" - raise AssertionError(u'response does not contain 名') + print("debug 日本") + raise AssertionError('response does not contain 名') except: err = sys.exc_info() formatted = c.formatError(d, err) --- unit_tests/test_cases.py (original) +++ unit_tests/test_cases.py (refactored) @@ -40,8 +40,7 @@ def __new__(cls, name, bases, dct): return type.__new__(cls, name, bases, dct) a = [] - class TestClass(object): - __metaclass__ = TestType + class TestClass(object, metaclass=TestType): def test_func(self, a=a): a.append(1) @@ -124,13 +123,13 @@ class TC(unittest.TestCase): def setUp(self): - print "TC setUp %s" % self + print("TC setUp %s" % self) called.append('setUp') def runTest(self): - print "TC runTest %s" % self + print("TC runTest %s" % self) called.append('runTest') def tearDown(self): - print "TC tearDown %s" % self + print("TC tearDown %s" % self) called.append('tearDown') case = nose.case.Test(TC()) --- unit_tests/test_core.py (original) +++ unit_tests/test_core.py (refactored) @@ -1,7 +1,7 @@ import os import sys import unittest -from cStringIO import StringIO +from io import StringIO from optparse import OptionParser import nose.core from nose.config import Config, all_config_files @@ -16,16 +16,16 @@ class TestAPI_run(unittest.TestCase): def test_restore_stdout(self): - print "AHOY" + print("AHOY") s = StringIO() - print s + print(s) stdout = sys.stdout conf = Config(stream=s) # set_trace() - print "About to run" + print("About to run") res = nose.core.run( testLoader=NullLoader(), argv=['test_run'], env={}, config=conf) RefactoringTool: No changes to unit_tests/test_cover_plugin.py RefactoringTool: Refactored unit_tests/test_deprecated_plugin.py RefactoringTool: No changes to unit_tests/test_doctest_error_handling.py RefactoringTool: No changes to unit_tests/test_doctest_no_name.py RefactoringTool: Refactored unit_tests/test_id_plugin.py RefactoringTool: No changes to unit_tests/test_importer.py RefactoringTool: Refactored unit_tests/test_inspector.py RefactoringTool: Refactored unit_tests/test_issue135.py RefactoringTool: No changes to unit_tests/test_issue270_fixtures.py RefactoringTool: Refactored unit_tests/test_issue_006.py RefactoringTool: No changes to unit_tests/test_issue_065.py RefactoringTool: No changes to unit_tests/test_issue_101.py RefactoringTool: Refactored unit_tests/test_issue_227.py RefactoringTool: Refactored unit_tests/test_issue_230.py RefactoringTool: No changes to unit_tests/test_lazy_suite.py RefactoringTool: Refactored unit_tests/test_loader.py - print "Done running" + print("Done running") stdout_after = sys.stdout self.assertEqual(stdout, stdout_after) --- unit_tests/test_deprecated_plugin.py (original) +++ unit_tests/test_deprecated_plugin.py (refactored) @@ -2,7 +2,7 @@ from nose.config import Config from nose.plugins.deprecated import Deprecated, DeprecatedTest from nose.result import TextTestResult, _TextTestResult -from StringIO import StringIO +from io import StringIO from optparse import OptionParser try: # 2.7+ @@ -107,7 +107,7 @@ res.printErrors() out = stream.getvalue() - print out + print(out) assert out assert ' ... DEPRECATED' in out --- unit_tests/test_id_plugin.py (original) +++ unit_tests/test_id_plugin.py (refactored) @@ -11,7 +11,7 @@ opt = mock.Bucket() opt.testIdFile = '.noseids' tid.configure(opt, c) - print tid.idfile + print(tid.idfile) assert tid.idfile.startswith(c.workingDir), \ "%s is not under %s" % (tid.idfile, c.workingDir) --- unit_tests/test_inspector.py (original) +++ unit_tests/test_inspector.py (refactored) @@ -6,9 +6,9 @@ import unittest try: - from cStringIO import StringIO + from io import StringIO except ImportError: - from StringIO import StringIO + from io import StringIO from nose.inspector import inspect_traceback, Expander, tbsource @@ -52,7 +52,7 @@ def test_get_tb_source_func(self): # func frame def check_even(n): - print n + print(n) assert n % 2 == 0 try: check_even(1) @@ -108,14 +108,14 @@ S = {'setup':1} def check_even(n, nn): assert S['setup'] - print n, nn + print(n, nn) assert n % 2 == 0 or nn % 2 == 0 try: check_even(1, 3) except AssertionError: et, ev, tb = sys.exc_info() out = inspect_traceback(tb) - print "'%s'" % out.strip() + print("'%s'" % out.strip()) if sys.version_info < (3,): print_line = " print 1, 3\n" else: @@ -136,7 +136,7 @@ except AssertionError: et, ev, tb = sys.exc_info() out = inspect_traceback(tb) - print "'%s'" % out.strip() + print("'%s'" % out.strip()) self.assertEqual(out.strip(), "2 = 2\n" ">> assert 2 == 4") --- unit_tests/test_issue135.py (original) +++ unit_tests/test_issue135.py (refactored) @@ -4,7 +4,7 @@ import sys import re try: - from StringIO import StringIO + from io import StringIO except ImportError: from io import BytesIO as StringIO --- unit_tests/test_issue_006.py (original) +++ unit_tests/test_issue_006.py (refactored) @@ -9,11 +9,11 @@ where = os.path.abspath(os.path.join(os.path.dirname(__file__), 'support', 'issue006')) l = TestLoader() - testmod = iter(l.loadTestsFromName(where)).next() - print testmod + testmod = next(iter(l.loadTestsFromName(where))) + print(testmod) testmod.setUp() - testcase = iter(testmod).next() + testcase = next(iter(testmod)) expect = [ ['tests.Test1.test_nested_generator'], ['tests.Test1.test_nested_generator_mult(1,)', @@ -23,8 +23,8 @@ 'tests.Test1.test_normal_generator(2,)'] ] for test in testcase: - tests = map(str, test) - print tests + tests = list(map(str, test)) + print(tests) self.assertEqual(tests, expect.pop(0)) if __name__ == '__main__': --- unit_tests/test_issue_227.py (original) +++ unit_tests/test_issue_227.py (refactored) @@ -9,4 +9,4 @@ def test_unicode(): - print u'b\u00f6y' + print('b\u00f6y') --- unit_tests/test_issue_230.py (original) +++ unit_tests/test_issue_230.py (refactored) @@ -13,7 +13,7 @@ loader = TestLoader() suite = loader.loadTestsFromGenerator(gen, module=None) - testcase = iter(suite).next() + testcase = next(iter(suite)) self.assertEqual(testcase.test.test, test) --- unit_tests/test_loader.py (original) +++ unit_tests/test_loader.py (refactored) @@ -51,8 +51,7 @@ class TCType(type): def __new__(cls, name, bases, dct): return type.__new__(cls, name, bases, dct) - class TestMetaclassed(object): - __metaclass__ = TCType + class TestMetaclassed(object, metaclass=TCType): def test_one(self): pass def test_two(self): @@ -182,13 +181,13 @@ def mock_isdir(path): - print "is dir '%s'?" % path - paths = map(safepath, [ + print("is dir '%s'?" % path) + paths = list(map(safepath, [ '/a/dir/path', '/package', '/package/subpackage', '/sort/lib', '/sort/src', '/sort/a_test', - '/sort/test', '/sort']) - paths = paths + map(os.path.abspath, paths) + '/sort/test', '/sort'])) + paths = paths + list(map(os.path.abspath, paths)) if path in paths: return True return False @@ -201,12 +200,12 @@ def mock_exists(path): - print "exists '%s'?" % path - paths = map(safepath, [ + print("exists '%s'?" % path) + paths = list(map(safepath, [ '/package', '/package/__init__.py', '/package/subpackage', '/package/subpackage/__init__.py' - ]) - paths = paths + map(os.path.abspath, paths) + ])) + paths = paths + list(map(os.path.abspath, paths)) return path in paths @@ -270,35 +269,35 @@ l.loadTestsFromNames def test_load_from_name_dir_abs(self): - print "load from name dir" + print("load from name dir") l = self.l suite = l.loadTestsFromName(safepath('/a/dir/path')) tests = [t for t in suite] self.assertEqual(len(tests), 1) def test_load_from_name_module_filename(self): - print "load from name module filename" + print("load from name module filename") l = self.l suite = l.loadTestsFromName('test_module.py') tests = [t for t in suite] assert tests def test_load_from_name_module(self): - print "load from name module" + print("load from name module") l = self.l suite = l.loadTestsFromName('test_module') tests = [t for t in suite] assert tests def test_load_from_name_nontest_module(self): - print "load from name nontest module" + print("load from name nontest module") l = self.l suite = l.loadTestsFromName('module') tests = [t for t in suite] assert tests def test_load_from_name_method(self): - print "load from name method" + print("load from name method") res = unittest.TestResult() l = self.l suite = l.loadTestsFromName(':TC.runTest') @@ -310,11 +309,11 @@ "Expected a ValueError for unresolvable test name, got none" def test_load_from_name_module_class(self): - print "load from name module class" + print("load from name module class") l = self.l suite = l.loadTestsFromName('test_module:TC') tests = [t for t in suite] - print tests + print(tests) assert tests assert len(tests) == 1, \ "Should have loaded 1 test, but got %s" % tests @@ -322,10 +321,10 @@ # the item in tests is a suite, we want to check that all of # the members of the suite are wrapped -- though this is really # a suite test and doesn't belong here.. - assert filter(lambda t: isinstance(t, nose.case.Test), tests[0]) + assert [t for t in tests[0] if isinstance(t, nose.case.Test)] def test_load_from_name_module_func(self): - print "load from name module func" + print("load from name module func") l = self.l suite = l.loadTestsFromName('test_module:test_func') tests = [t for t in suite] @@ -336,7 +335,7 @@ "Expected FunctionTestCase not %s" % tests[0].test def test_load_from_name_module_method(self): - print "load from name module method" + print("load from name module method") l = self.l suite = l.loadTestsFromName('test_module:TC.runTest') tests = [t for t in suite] @@ -345,7 +344,7 @@ "Should have loaded 1 test, but got %s" % tests def test_load_from_name_module_missing_class(self): - print "load from name module missing class" + print("load from name module missing class") res = unittest.TestResult() l = self.l suite = l.loadTestsFromName('test_module:TC2') @@ -356,7 +355,7 @@ assert res.errors, "Expected missing class test to raise exception" def test_load_from_name_module_missing_func(self): - print "load from name module missing func" + print("load from name module missing func") res = unittest.TestResult() l = self.l suite = l.loadTestsFromName('test_module:test_func2') @@ -367,7 +366,7 @@ assert res.errors, "Expected missing func test to raise exception" def test_load_from_name_module_missing_method(self): - print "load from name module missing method" + print("load from name module missing method") res = unittest.TestResult() l = self.l suite = l.loadTestsFromName('test_module:TC.testThat') @@ -378,7 +377,7 @@ assert res.errors, "Expected missing method test to raise exception" def test_load_from_name_module_transplanted_class_missing_method(self): - print "load from name module transplanted class missing method" + print("load from name module transplanted class missing method") res = unittest.TestResult() l = self.l suite = l.loadTestsFromName('test_transplant:Transplant.testThat') @@ -389,7 +388,7 @@ assert res.errors, "Expected missing method test to raise exception" def test_load_from_name_missing_module(self): - print "load from name missing module" + print("load from name missing module") res = unittest.TestResult() l = self.l suite = l.loadTestsFromName('other_test_module') @@ -400,27 +399,27 @@ assert res.errors, "Expected missing module test to raise exception" def test_cases_from_testcase_are_wrapped(self): - print "cases from testcase are wrapped" + print("cases from testcase are wrapped") test_module = M['test_module'] l = self.l suite = l.loadTestsFromTestCase(test_module.TC) - print suite + print(suite) tests = [t for t in suite] for test in tests: assert isinstance(test, nose.case.Test), \ "Test %r is not a test wrapper" % test def test_load_test_func(self): - print "load test func" + print("load test func") l = self.l suite = l.loadTestsFromName('test_module') tests = [t for t in suite] self.assertEqual(len(tests), 2, "Wanted 2 tests, got %s" % tests) - assert filter(lambda t: isinstance(t, nose.case.Test), tests) - print tests + assert [t for t in tests if isinstance(t, nose.case.Test)] + print(tests) class_tests = tests[0] for t in class_tests: - print "class test: ", t + print("class test: ", t) func_tests = tests[1:] assert class_tests, \ "Expected class suite got %s" % class_tests @@ -434,25 +433,25 @@ "Expected FunctionTestCase not %s" % tests[1].test def test_load_from_name_package_root_path(self): - print "load from name package root path" + print("load from name package root path") l = self.l suite = l.loadTestsFromName(safepath('/package')) - print suite + print(suite) tests = [t for t in suite] assert len(tests) == 1, "Expected one test, got %s" % tests tests = list(tests[0]) assert not tests, "The full test list %s was not empty" % tests def test_load_from_name_subpackage_safepath(self): - print "load from name subpackage path" + print("load from name subpackage path") l = self.l suite = l.loadTestsFromName(safepath('/package/subpackage')) - print suite + print(suite) tests = [t for t in suite] assert len(tests) == 0, "Expected no tests, got %s" % tests def test_load_metaclass_customized_classes(self): - print "load metaclass-customized classes" + print("load metaclass-customized classes") test_module_with_generators = M['test_module_with_metaclass_tests'] l = self.l suite = l.loadTestsFromModule(test_module_with_generators) @@ -461,21 +460,21 @@ self.assertEqual(len(tc_methods), 2) def test_load_generators(self): - print "load generators" + print("load generators") test_module_with_generators = M['test_module_with_generators'] l = self.l suite = l.loadTestsFromModule(test_module_with_generators) tests = [t for t in suite] for t in tests: - print "test", t + print("test", t) assert isinstance(t, unittest.TestSuite), \ "Test %s is not a suite" % t # the first item is a class, with both normal and generator methods count = 0 cl_tests = [t for t in tests[0]] - print "class tests", cl_tests + print("class tests", cl_tests) normal, gens = cl_tests[0], cl_tests[1:] assert isinstance(normal, nose.case.Test), \ "Expected a test case but got %s" % normal @@ -484,8 +483,8 @@ "Expected a generator test suite, but got %s" % gen count = 0 for t in gen: - print "generated test %s" % t - print t.shortDescription() + print("generated test %s" % t) + print(t.shortDescription()) assert isinstance(t, nose.case.Test), \ "Test %s is not a test?" % t count += 1 @@ -495,8 +494,8 @@ # 2nd item is generated from test_func_generator count = 0 for t in tests[1]: - print "generated test %s" % t - print t.shortDescription() + print("generated test %s" % t) + print(t.shortDescription()) assert isinstance(t, nose.case.Test), \ "Test %s is not a Test?" % t assert isinstance(t.test, nose.case.FunctionTestCase), \ @@ -513,8 +512,8 @@ count = 0 for t in tests[2]: - print "generated test %s" % t - print t.shortDescription() + print("generated test %s" % t) + print(t.shortDescription()) assert isinstance(t, nose.case.Test), \ "Test %s is not a Test?" % t assert isinstance(t.test, nose.case.FunctionTestCase), \ @@ -530,21 +529,21 @@ "Expected to generate 4 tests, but got %s" % count def test_load_transplanted_generator(self): - print "load transplanted generator (issue 501)" + print("load transplanted generator (issue 501)") test_module_transplant_generator = M['test_module_transplant_generator'] l = self.l suite = l.loadTestsFromModule(test_module_transplant_generator) tests = [t for t in suite] assert len(tests) == 1 - print "test", tests[0] + print("test", tests[0]) assert isinstance(tests[0], unittest.TestSuite), \ "Test is not a suite - probably did not look like a generator" count = 0 for t in tests[0]: - print "generated test %s" % t - print t.shortDescription() RefactoringTool: Refactored unit_tests/test_logcapture_plugin.py RefactoringTool: No changes to unit_tests/test_logging.py RefactoringTool: No changes to unit_tests/test_multiprocess.py RefactoringTool: Refactored unit_tests/test_multiprocess_runner.py RefactoringTool: Refactored unit_tests/test_pdb_plugin.py RefactoringTool: No changes to unit_tests/test_plugin.py RefactoringTool: No changes to unit_tests/test_plugin_interfaces.py RefactoringTool: Refactored unit_tests/test_plugin_manager.py RefactoringTool: Refactored unit_tests/test_plugins.py RefactoringTool: Refactored unit_tests/test_result_proxy.py RefactoringTool: Refactored unit_tests/test_selector.py RefactoringTool: No changes to unit_tests/test_selector_plugins.py RefactoringTool: Refactored unit_tests/test_skip_plugin.py RefactoringTool: Refactored unit_tests/test_suite.py + print("generated test %s" % t) + print(t.shortDescription()) assert isinstance(t, nose.case.Test), \ "Test %s is not a Test?" % t assert isinstance(t.test, nose.case.FunctionTestCase), \ --- unit_tests/test_logcapture_plugin.py (original) +++ unit_tests/test_logcapture_plugin.py (refactored) @@ -181,7 +181,7 @@ parser = OptionParser() c.addOptions(parser, env) options, args = parser.parse_args(['foo']) - print options, args + print(options, args) c.configure(options, Config()) c.start() for name in ['foobar.something', 'foo', 'foo.x', 'abara', 'bar.quux']: @@ -200,7 +200,7 @@ parser = OptionParser() c.addOptions(parser, env) options, args = parser.parse_args(['foo']) - print options, args + print(options, args) c.configure(options, Config()) c.start() for name in ['foobar.something', 'foo', 'foo.x', 'abara', 'bar.quux']: @@ -218,7 +218,7 @@ parser = OptionParser() c.addOptions(parser, env) options, args = parser.parse_args(['foo']) - print options, args + print(options, args) c.configure(options, Config()) c.start() for name in ['foo.yes', 'foo.bar', 'foo.bar.no', 'blah']: @@ -230,7 +230,7 @@ assert records[0].startswith('foo.yes:'), records[0] def test_unicode_messages_handled(self): - msg = u'Ivan Krsti\u0107' + msg = 'Ivan Krsti\u0107' c = LogCapture() parser = OptionParser() c.addOptions(parser, {}) @@ -250,7 +250,7 @@ except: err = sys.exc_info() (ec, ev, tb) = c.formatError(test, err) - print ev + print(ev) if UNICODE_STRINGS: assert msg in ev else: --- unit_tests/test_multiprocess_runner.py (original) +++ unit_tests/test_multiprocess_runner.py (refactored) @@ -30,7 +30,7 @@ l = TestLoader() tests = list(r.nextBatch(ContextSuite( tests=[l.makeTest(T_fixt), l.makeTest(T)]))) - print tests + print(tests) self.assertEqual(len(tests), 3) def test_next_batch_with_module_fixt(self): @@ -50,7 +50,7 @@ r = multiprocess.MultiProcessTestRunner() l = TestLoader() tests = list(r.nextBatch(l.loadTestsFromModule(mod_with_fixt))) - print tests + print(tests) self.assertEqual(len(tests), 1) def test_next_batch_with_module(self): @@ -71,7 +71,7 @@ r = multiprocess.MultiProcessTestRunner() l = TestLoader() tests = list(r.nextBatch(l.loadTestsFromModule(mod_no_fixt))) - print tests + print(tests) self.assertEqual(len(tests), 3) def test_next_batch_with_generator_method(self): @@ -84,8 +84,8 @@ r = multiprocess.MultiProcessTestRunner() l = TestLoader() tests = list(r.nextBatch(l.makeTest(Tg))) - print tests - print [r.address(t) for t in tests] + print(tests) + print([r.address(t) for t in tests]) self.assertEqual(len(tests), 1) def test_next_batch_can_split_set(self): @@ -112,7 +112,7 @@ r = multiprocess.MultiProcessTestRunner() l = TestLoader() tests = list(r.nextBatch(l.loadTestsFromModule(mod_with_fixt2))) - print tests + print(tests) self.assertEqual(len(tests), 3) --- unit_tests/test_pdb_plugin.py (original) +++ unit_tests/test_pdb_plugin.py (refactored) @@ -3,7 +3,7 @@ from nose.config import Config from nose.plugins import debug from optparse import OptionParser -from StringIO import StringIO +from io import StringIO class StubPdb: called = False --- unit_tests/test_plugin_manager.py (original) +++ unit_tests/test_plugin_manager.py (refactored) @@ -44,7 +44,7 @@ # multiple proxy: all plugins that return values get to run all = [] for res in man.loadTestsFromFile('foo'): - print res + print(res) all.append(res) self.assertEqual(len(all), 2) --- unit_tests/test_plugins.py (original) +++ unit_tests/test_plugins.py (refactored) @@ -99,16 +99,16 @@ dtp.add_options(parser, env) options, args = parser.parse_args(argv) - print options - print args + print(options) + print(args) self.assertEqual(options.doctestExtension, ['ext', 'txt']) env = {} parser = OptionParser() dtp.add_options(parser, env) options, args = parser.parse_args(argv) - print options - print args + print(options) + print(args) self.assertEqual(options.doctestExtension, ['txt']) def test_want_file(self): @@ -171,12 +171,12 @@ plug.configure(opt, conf) suite = plug.loadTestsFromModule(foo.bar.buz) for test in suite: - print test.address() + print(test.address()) file, mod, call = test.address() self.assertEqual(mod, 'foo.bar.buz') self.assertEqual(call, None) for case in test: - print case.address() + print(case.address()) file, mod, call = case.address() self.assertEqual(mod, 'foo.bar.buz') self.assertEqual(call, 'afunc') @@ -334,7 +334,7 @@ # OR opt, args = parser.parse_args(['test', '-a', 'tags=a', '-a', 'tags=b']) - print opt + print(opt) plug.configure(opt, cnf) assert plug.wantFunction(f1) is None @@ -344,7 +344,7 @@ # AND opt, args = parser.parse_args(['test', '-a', 'tags=a,tags=b']) - print opt + print(opt) plug.configure(opt, cnf) assert plug.wantFunction(f1) is None --- unit_tests/test_result_proxy.py (original) +++ unit_tests/test_result_proxy.py (refactored) @@ -76,8 +76,8 @@ class TC(unittest.TestCase): def run(self, result): unittest.TestCase.run(self, result) - print "errors", result.errors - print "failures", result.failures + print("errors", result.errors) + print("failures", result.failures) def runTest(self): pass test = TC() @@ -103,10 +103,10 @@ res = unittest.TestResult() class TC(unittest.TestCase): def test_error(self): - print "So long" + print("So long") raise TypeError("oops") def test_fail(self): - print "Hello" + print("Hello") self.fail() def test(self): pass --- unit_tests/test_selector.py (original) +++ unit_tests/test_selector.py (refactored) @@ -74,8 +74,8 @@ class TestType(type): def __new__(cls, name, bases, dct): return type.__new__(cls, name, bases, dct) - class TestClass(object): - __metaclass__ = TestType + class TestClass(object, metaclass=TestType): + pass s = Selector(Config()) assert not s.wantClass(Foo) --- unit_tests/test_skip_plugin.py (original) +++ unit_tests/test_skip_plugin.py (refactored) @@ -2,7 +2,7 @@ from nose.config import Config from nose.plugins.skip import Skip, SkipTest from nose.result import TextTestResult -from StringIO import StringIO +from io import StringIO from nose.result import _TextTestResult from optparse import OptionParser try: @@ -85,7 +85,7 @@ res.printErrors() out = stream.getvalue() - print out + print(out) assert out assert out.strip() == "S" assert res.wasSuccessful() @@ -107,7 +107,7 @@ res.printErrors() out = stream.getvalue() - print out + print(out) assert out assert ' ... SKIP' in out RefactoringTool: Refactored unit_tests/test_tools.py RefactoringTool: Refactored unit_tests/test_twisted.py RefactoringTool: No changes to unit_tests/test_twisted_testcase.py RefactoringTool: Refactored unit_tests/test_utils.py RefactoringTool: Refactored unit_tests/test_xunit.py RefactoringTool: Refactored unit_tests/support/script.py RefactoringTool: No changes to unit_tests/support/test.py RefactoringTool: No changes to unit_tests/support/bug105/tests.py RefactoringTool: No changes to unit_tests/support/doctest/err_doctests.py RefactoringTool: No changes to unit_tests/support/doctest/no_doctests.py RefactoringTool: No changes to unit_tests/support/doctest/noname_wrapper.py RefactoringTool: No changes to unit_tests/support/foo/__init__.py RefactoringTool: No changes to unit_tests/support/foo/bar/buz.py RefactoringTool: No changes to unit_tests/support/issue006/tests.py RefactoringTool: Refactored unit_tests/support/issue135/tests.py RefactoringTool: Refactored functional_tests/test_attribute_plugin.py RefactoringTool: Refactored functional_tests/test_buggy_generators.py --- unit_tests/test_suite.py (original) +++ unit_tests/test_suite.py (refactored) @@ -43,13 +43,13 @@ lazytests = [] nonlazytests = [] for t in lazy: - print "lazy %s" % t + print("lazy %s" % t) lazytests.append(t) for t in nonlazy: - print "nonlazy %s" % t + print("nonlazy %s" % t) nonlazytests.append(t) - slazy = map(str, lazytests) - snonlazy = map(str, nonlazytests) + slazy = list(map(str, lazytests)) + snonlazy = list(map(str, nonlazytests)) assert slazy == snonlazy, \ "Lazy and Nonlazy produced different test lists (%s vs %s)" \ % (slazy, snonlazy) @@ -70,7 +70,7 @@ count = 0 for test in lazy: - print test + print(test) assert test count += 1 self.assertEqual(count, 2, "Expected 2 tests, got %s" % count) @@ -117,7 +117,7 @@ assert isinstance(tests[0], ContextSuite) # suite is full of wrapped tests tests = [t for t in tests[0]] - cases = filter(lambda t: isinstance(t, case.Test), tests) + cases = [t for t in tests if isinstance(t, case.Test)] assert cases assert len(cases) == len(tests) --- unit_tests/test_tools.py (original) +++ unit_tests/test_tools.py (refactored) @@ -11,7 +11,7 @@ ok_(True) try: ok_(False, "message") - except AssertionError, e: + except AssertionError as e: assert str(e) == "message" else: self.fail("ok_(False) did not raise assertion error") @@ -20,13 +20,13 @@ eq_(1, 1) try: eq_(1, 0, "message") - except AssertionError, e: + except AssertionError as e: assert str(e) == "message" else: self.fail("eq_(1, 0) did not raise assertion error") try: eq_(1, 0) - except AssertionError, e: + except AssertionError as e: assert str(e) == "1 != 0" else: self.fail("eq_(1, 0) did not raise assertion error") @@ -37,7 +37,7 @@ This lets tracebacks refrain from descending into the eq_ frame. """ - assert '__unittest' in eq_.func_globals + assert '__unittest' in eq_.__globals__ def test_istest_unittest_flag(self): """Make sure istest() is not in a namespace that has __unittest = 1. @@ -45,7 +45,7 @@ That is, make sure our __unittest labeling didn't get overzealous. """ - assert '__unittest' not in istest.func_globals + assert '__unittest' not in istest.__globals__ def test_raises(self): from nose.case import FunctionTestCase @@ -66,14 +66,14 @@ raise_good() try: raise_other() - except TypeError, e: + except TypeError as e: pass else: self.fail("raises did pass through unwanted exception") try: no_raise() - except AssertionError, e: + except AssertionError as e: pass else: self.fail("raises did not raise assertion error on no exception") @@ -163,7 +163,7 @@ import nose.tools tc_asserts = [ at for at in dir(nose.tools) if at.startswith('assert_') ] - print tc_asserts + print(tc_asserts) # FIXME: not sure which of these are in all supported # versions of python --- unit_tests/test_twisted.py (original) +++ unit_tests/test_twisted.py (refactored) @@ -29,7 +29,7 @@ #@raises(TypeError) #@deferred() def test_raises_bad_return(): - print reactor + print(reactor) reactor.resolve("www.python.org") test_raises_bad_return = raises(TypeError)(deferred()(test_raises_bad_return)) --- unit_tests/test_utils.py (original) +++ unit_tests/test_utils.py (refactored) @@ -78,8 +78,7 @@ class CustomTestType(type): pass - class CustomTC(unittest.TestCase): - __metaclass__ = CustomTestType + class CustomTC(unittest.TestCase, metaclass=CustomTestType): def test_one(self): pass def test_two(self): @@ -128,10 +127,10 @@ # issue153 -- was not detecting custom typed classes... class TCType(type): pass - class TC_custom_type(object): - __metaclass__ = TCType - class TC_unittest_custom_type(unittest.TestCase): - __metaclass__ = TCType + class TC_custom_type(object, metaclass=TCType): + pass + class TC_unittest_custom_type(unittest.TestCase, metaclass=TCType): + pass assert util.isclass(TC), "failed to detect %s as class" % TC assert util.isclass(TC_Classic), "failed to detect %s as class" % TC_Classic --- unit_tests/test_xunit.py (original) +++ unit_tests/test_xunit.py (refactored) @@ -113,7 +113,7 @@ self.x.addFailure(test, some_err) result = self.get_xml_report() - print result + print(result) if self.ET: tree = self.ET.fromstring(result) @@ -156,7 +156,7 @@ self.x.addFailure(test, some_err) result = self.get_xml_report() - print result + print(result) if self.ET: tree = self.ET.fromstring(result) @@ -180,7 +180,7 @@ self.x.addError(test, some_err) result = self.get_xml_report() - print result + print(result) if self.ET: tree = self.ET.fromstring(result) @@ -221,7 +221,7 @@ some_err = sys.exc_info() self.x.addError(test, some_err) result = self.get_xml_report() - print repr(result) + print(repr(result)) if self.ET: tree = self.ET.fromstring(result) tc = tree.find("testcase") @@ -231,7 +231,7 @@ '\x80') else: eq_(err.attrib['message'], - u'\ufffd') + '\ufffd') else: # this is a dumb test for 2.4- assert 'RuntimeError: \xef\xbf\xbd' in result @@ -250,7 +250,7 @@ self.x.addError(test, some_err) result = self.get_xml_report() - print result + print(result) if self.ET: tree = self.ET.fromstring(result) @@ -269,7 +269,7 @@ self.x.addSuccess(test, (None,None,None)) result = self.get_xml_report() - print result + print(result) if self.ET: tree = self.ET.fromstring(result) @@ -298,7 +298,7 @@ self.x.addSuccess(test, (None,None,None)) result = self.get_xml_report() - print result + print(result) if self.ET: tree = self.ET.fromstring(result) --- unit_tests/support/script.py (original) +++ unit_tests/support/script.py (refactored) @@ -1,3 +1,3 @@ #!/usr/bin/env python -print "FAIL" +print("FAIL") --- unit_tests/support/issue135/tests.py (original) +++ unit_tests/support/issue135/tests.py (refactored) @@ -2,5 +2,5 @@ class TestIssue135(unittest.TestCase): def test_issue135(self): - print "something" + print("something") raise KeyError("fake") --- functional_tests/test_attribute_plugin.py (original) +++ functional_tests/test_attribute_plugin.py (refactored) @@ -17,9 +17,9 @@ activate = '-v' def runTest(self): - print '*' * 70 - print str(self.output) - print '*' * 70 + print('*' * 70) + print(str(self.output)) + print('*' * 70) self.verify() def verify(self): --- functional_tests/test_buggy_generators.py (original) +++ functional_tests/test_buggy_generators.py (refactored) @@ -1,6 +1,6 @@ import os import unittest -from cStringIO import StringIO +from io import StringIO from nose.core import TestProgram from nose.config import Config from nose.result import _TextTestResult @@ -27,7 +27,7 @@ config=Config(), RefactoringTool: No changes to functional_tests/test_cases.py RefactoringTool: Refactored functional_tests/test_collector.py RefactoringTool: Refactored functional_tests/test_commands.py RefactoringTool: No changes to functional_tests/test_config_files.py RefactoringTool: Refactored functional_tests/test_coverage_plugin.py RefactoringTool: No changes to functional_tests/test_defaultpluginmanager.py RefactoringTool: Refactored functional_tests/test_doctest_plugin.py RefactoringTool: No changes to functional_tests/test_entrypoints.py RefactoringTool: Refactored functional_tests/test_failure.py RefactoringTool: Refactored functional_tests/test_failuredetail_plugin.py RefactoringTool: Refactored functional_tests/test_generator_fixtures.py RefactoringTool: Refactored functional_tests/test_id_plugin.py exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 12, "Expected to run 12 tests, ran %s" % res.testsRun) assert not res.wasSuccessful() --- functional_tests/test_collector.py (original) +++ functional_tests/test_collector.py (refactored) @@ -2,7 +2,7 @@ import sys import unittest import warnings -from cStringIO import StringIO +from io import StringIO from nose.result import _TextTestResult here = os.path.dirname(__file__) support = os.path.join(here, 'support') --- functional_tests/test_commands.py (original) +++ functional_tests/test_commands.py (refactored) @@ -3,7 +3,7 @@ import unittest from nose.plugins.skip import SkipTest from nose import commands -from StringIO import StringIO +from io import StringIO support = os.path.join( os.path.dirname(__file__), 'support', 'issue191') @@ -32,12 +32,12 @@ 'package_dir': {'issue191': support}})) cmd.finalize_options() ## FIXME why doesn't Config see the chdir above? - print cmd._nosetests__config.workingDir + print(cmd._nosetests__config.workingDir) cmd._nosetests__config.workingDir = support cmd._nosetests__config.stream = buf try: cmd.run() - except SystemExit, e: + except SystemExit as e: self.assertFalse(e.args[0], buf.getvalue()) else: self.fail("cmd.run() did not exit") --- functional_tests/test_coverage_plugin.py (original) +++ functional_tests/test_coverage_plugin.py (refactored) @@ -40,7 +40,7 @@ super(TestCoveragePlugin, self).setUp() def runTest(self): - print(self.output) + print((self.output)) self.assertTrue( # Coverage < 4.0 ("blah 4 3 25% 1" in self.output) or --- functional_tests/test_doctest_plugin.py (original) +++ functional_tests/test_doctest_plugin.py (refactored) @@ -12,7 +12,7 @@ suitepath = os.path.join(support, 'dtt') def runTest(self): - print str(self.output) + print(str(self.output)) assert 'Doctest: some_mod ... ok' in self.output assert 'Doctest: some_mod.foo ... ok' in self.output @@ -27,7 +27,7 @@ suitepath = os.path.join(support, 'dtt', 'docs') def runTest(self): - print str(self.output) + print(str(self.output)) expect = [ 'Doctest: doc.txt ... ok', --- functional_tests/test_failure.py (original) +++ functional_tests/test_failure.py (refactored) @@ -15,11 +15,11 @@ return None def test_correct_exception_raised(self): - print - print '!' * 70 - print str(self.output) - print '!' * 70 - print + print() + print('!' * 70) + print(str(self.output)) + print('!' * 70) + print() # Look for the line in the traceback causing the failure assert "raise '\\xf1'.encode('ASCII')" in str(self.output) --- functional_tests/test_failuredetail_plugin.py (original) +++ functional_tests/test_failuredetail_plugin.py (refactored) @@ -14,9 +14,9 @@ suitepath = os.path.join(support, 'fdp') def runTest(self): - print '*' * 70 - print str(self.output) - print '*' * 70 + print('*' * 70) + print(str(self.output)) + print('*' * 70) expect = \ 'AssertionError: a is not 4\n' @@ -34,9 +34,9 @@ suitepath = os.path.join(support, 'fdp/test_fdp_no_capt.py') def runTest(self): - print '*' * 70 - print str(self.output) - print '*' * 70 + print('*' * 70) + print(str(self.output)) + print('*' * 70) expect = \ 'AssertionError: a is not 4\n' @@ -53,9 +53,9 @@ suitepath = os.path.join(support, 'issue720') def runTest(self): - print '*' * 70 - print str(self.output) - print '*' * 70 + print('*' * 70) + print(str(self.output)) + print('*' * 70) assert 'UnicodeDecodeError' not in self.output assert 'UnicodeEncodeError' not in self.output --- functional_tests/test_generator_fixtures.py (original) +++ functional_tests/test_generator_fixtures.py (refactored) @@ -35,21 +35,21 @@ class TestClass(object): def setup(self): - print "setup called in", self + print("setup called in", self) self.called = ['setup'] def teardown(self): - print "teardown called in", self + print("teardown called in", self) eq_(self.called, ['setup']) self.called.append('teardown') def test(self): - print "test called in", self + print("test called in", self) for i in range(0, 5): yield self.check, i def check(self, i): - print "check called in", self + print("check called in", self) expect = ['setup'] #for x in range(0, i): # expect.append('setup') --- functional_tests/test_id_plugin.py (original) +++ functional_tests/test_id_plugin.py (refactored) @@ -7,7 +7,7 @@ from nose.plugins import PluginTester from nose.plugins.builtin import Doctest from nose.plugins.builtin import TestId -from cPickle import dump, load +from pickle import dump, load support = os.path.join(os.path.dirname(__file__), 'support') idfile = tempfile.mktemp() @@ -49,9 +49,9 @@ ids = load(fh)['ids'] fh.close() assert ids - assert ids.keys() - self.assertEqual(map(int, ids.keys()), ids.keys()) - assert ids.values() + assert list(ids.keys()) + self.assertEqual(list(map(int, list(ids.keys()))), list(ids.keys())) + assert list(ids.values()) class TestLoadNamesMode(PluginTester, unittest.TestCase): @@ -81,10 +81,10 @@ ids = load(fh) fh.close() assert ids - assert ids.keys() + assert list(ids.keys()) ids = ids['ids'] - self.assertEqual(filter(lambda i: int(i), ids.keys()), ids.keys()) - assert len(ids.keys()) > 2 + self.assertEqual([i for i in list(ids.keys()) if int(i)], list(ids.keys())) + assert len(list(ids.keys())) > 2 class TestLoadNamesMode_2(PluginTester, unittest.TestCase): @@ -142,7 +142,7 @@ fh = open(idfile, 'rb') ids = load(fh)['ids'] fh.close() - for key, (file, mod, call) in ids.items(): + for key, (file, mod, call) in list(ids.items()): assert mod != 'doctest', \ "Doctest test was incorrectly identified as being part of "\ "the doctest module itself (#%s)" % key @@ -166,9 +166,9 @@ return None def test_load_ids_doctest(self): - print '*' * 70 - print str(self.output) - print '*' * 70 + print('*' * 70) + print(str(self.output)) + print('*' * 70) assert 'Doctest: exm.add_one ... FAIL' in self.output @@ -188,9 +188,9 @@ suitepath = os.path.join(support, 'dtt', 'docs') def test_docfile_tests_get_ids(self): - print '>' * 70 - print str(self.output) - print '>' * 70 + print('>' * 70) + print(str(self.output)) + print('>' * 70) last = None for line in self.output: @@ -209,7 +209,7 @@ fh = open(idfile, 'rb') ids = load(fh)['ids'] fh.close() - for key, (file, mod, call) in ids.items(): + for key, (file, mod, call) in list(ids.items()): assert mod != 'doctest', \ "Doctest test was incorrectly identified as being part of "\ "the doctest module itself (#%s)" % key @@ -234,9 +234,9 @@ return None def test_load_from_name_id_docfile_test(self): - print '*' * 70 - print str(self.output) - print '*' * 70 + print('*' * 70) + print(str(self.output)) + print('*' * 70) RefactoringTool: Refactored functional_tests/test_importer.py RefactoringTool: Refactored functional_tests/test_isolate_plugin.py RefactoringTool: Refactored functional_tests/test_issue_072.py RefactoringTool: Refactored functional_tests/test_issue_082.py RefactoringTool: No changes to functional_tests/test_issue_408.py RefactoringTool: Refactored functional_tests/test_issue_649.py RefactoringTool: Refactored functional_tests/test_load_tests_from_test_case.py RefactoringTool: Refactored functional_tests/test_loader.py assert 'Doctest: errdoc.txt ... FAIL' in self.output --- functional_tests/test_importer.py (original) +++ functional_tests/test_importer.py (refactored) @@ -27,7 +27,7 @@ self.has_symlinks = True def tearDown(self): - to_del = [ m for m in sys.modules.keys() if + to_del = [ m for m in list(sys.modules.keys()) if m not in self._mods ] if to_del: for mod in to_del: @@ -115,7 +115,7 @@ path = os.path.join(self.dir, 'package2', 'test_pak', 'test_sub', 'test_mod.py') mod = imp.importFromPath(path, 'test_pak.test_sub.test_mod') - print mod, dir(mod) + print(mod, dir(mod)) assert 'test_pak' in sys.modules, 'test_pak was not imported?' test_pak = sys.modules['test_pak'] assert hasattr(test_pak, 'test_sub'), "test_pak.test_sub was not set" --- functional_tests/test_isolate_plugin.py (original) +++ functional_tests/test_isolate_plugin.py (refactored) @@ -13,7 +13,7 @@ suitepath = os.path.join(support, 'ipt') def runTest(self): - print str(self.output) + print(str(self.output)) for line in self.output: if not line.strip(): @@ -43,7 +43,7 @@ return None def runTest(self): - print str(self.output) + print(str(self.output)) for line in self.output: if not line.strip(): --- functional_tests/test_issue_072.py (original) +++ functional_tests/test_issue_072.py (refactored) @@ -15,11 +15,11 @@ suitepath = os.path.join(support, 'issue072') def test_assert_info_in_output(self): - print - print '!' * 70 - print str(self.output) - print '!' * 70 - print + print() + print('!' * 70) + print(str(self.output)) + print('!' * 70) + print() assert '>> assert 4 == 2' in str(self.output) class TestFailureDetailWorksWhenChained(PluginTester, unittest.TestCase): @@ -30,11 +30,11 @@ def test_assert_info_and_capt_stdout_in_output(self): out = str(self.output) - print - print 'x' * 70 - print out - print 'x' * 70 - print + print() + print('x' * 70) + print(out) + print('x' * 70) + print() assert '>> assert 4 == 2' in out, \ "Assert info not found in chained output" --- functional_tests/test_issue_082.py (original) +++ functional_tests/test_issue_082.py (refactored) @@ -1,9 +1,9 @@ import os import re try: - from cStringIO import StringIO + from io import StringIO except ImportError: - from StringIO import StringIO + from io import StringIO import sys import unittest @@ -47,7 +47,7 @@ ) def test_assert_info_in_output(self): - print self.output + print(self.output) # In future, all four test cases will be run. Backwards-compatibility # means that can't be done in nose 0.10. assert '_mypackage._eggs' not in str(self.output) @@ -63,7 +63,7 @@ suitepath = os.path.join(support, 'issue082') def test_assert_info_in_output(self): - print self.output + print(self.output) assert '_mypackage._eggs' not in str(self.output) assert '_mypackage.bacon' not in str(self.output) assert 'mypublicpackage._foo' not in str(self.output) --- functional_tests/test_issue_649.py (original) +++ functional_tests/test_issue_649.py (refactored) @@ -14,5 +14,5 @@ suitepath = os.path.join(support, 'issue649') def runTest(self): - print str(self.output) + print(str(self.output)) assert 'UnicodeDecodeError' not in self.output --- functional_tests/test_load_tests_from_test_case.py (original) +++ functional_tests/test_load_tests_from_test_case.py (refactored) @@ -15,15 +15,15 @@ enabled = True def options(self, parser, env): - print "options" + print("options") pass def configure(self, options, conf): - print "configure" + print("configure") pass def loadTestsFromTestCase(self, testCaseClass): - print "Called!" + print("Called!") class Derived(testCaseClass): def setUp(self): pass @@ -47,7 +47,7 @@ expect = [ 'test_value (%s.Derived) ... ERROR' % __name__, 'test_value (tests.Tests) ... ok'] - print str(self.output) + print(str(self.output)) for line in self.output: if expect: self.assertEqual(line.strip(), expect.pop(0)) --- functional_tests/test_loader.py (original) +++ functional_tests/test_loader.py (refactored) @@ -2,7 +2,7 @@ import sys import unittest from difflib import ndiff -from cStringIO import StringIO +from io import StringIO from nose.config import Config from nose.plugins.manager import PluginManager @@ -25,7 +25,7 @@ suite.ContextSuiteFactory.suiteClass = TreePrintContextSuite def tearDown(self): - to_del = [ m for m in sys.modules.keys() if + to_del = [ m for m in list(sys.modules.keys()) if m not in self._mods ] if to_del: for mod in to_del: @@ -71,7 +71,7 @@ dir_suite(res) m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) assert not res.errors, res.errors assert not res.failures, res.failures @@ -112,7 +112,7 @@ assert 'test_pak' in sys.modules, \ "Context did not load test_pak" m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) expect = ['test_pak.setup', 'test_pak.test_mod.setup', 'test_pak.test_mod.test_add', @@ -133,7 +133,7 @@ assert 'test_pak' in sys.modules, \ "Context did not load test_pak" m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) expect = ['test_pak.setup', 'test_pak.test_mod.setup', 'test_pak.test_mod.test_add', @@ -182,7 +182,7 @@ assert 'test_pak' in sys.modules, \ "Context not load test_pak" m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) expect = ['test_pak.setup', 'test_pak.test_sub.setup', 'test_pak.test_sub.test_mod.setup', @@ -204,14 +204,14 @@ ['test_pak.test_sub.test_mod:TestMaths.test_div', 'test_pak.test_sub.test_mod:TestMaths.test_two_two', 'test_pak.test_mod:test_add']) - print suite + print(suite) suite(res) assert not res.errors, res.errors assert not res.failures, res.failures assert 'test_pak' in sys.modules, \ "Context not load test_pak" m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) expect = ['test_pak.setup', 'test_pak.test_sub.setup', 'test_pak.test_sub.test_mod.setup', @@ -240,16 +240,16 @@ ['test_pak1.test_mod', 'test_pak2:test_two_two', 'test_pak1:test_one_one']) - print suite + print(suite) suite(res) res.printErrors() - print stream.getvalue() + print(stream.getvalue()) assert not res.errors, res.errors assert not res.failures, res.failures assert 'state' in sys.modules, \ "Context not load state module" m = sys.modules['state'] - print "state", m.called + print("state", m.called) expect = ['test_pak1.setup', 'test_pak1.test_mod.setup', @@ -271,16 +271,16 @@ ['test_pak1.test_mod', 'test_pak2:test_two_two', RefactoringTool: Refactored functional_tests/test_namespace_pkg.py RefactoringTool: Refactored functional_tests/test_plugin_api.py RefactoringTool: Refactored functional_tests/test_plugins.py RefactoringTool: Refactored functional_tests/test_plugintest.py RefactoringTool: Refactored functional_tests/test_program.py RefactoringTool: Refactored functional_tests/test_result.py 'test_mod']) - print suite + print(suite) suite(res) res.printErrors() - print stream.getvalue() + print(stream.getvalue()) assert not res.errors, res.errors assert not res.failures, res.failures assert 'state' in sys.modules, \ "Context not load state module" m = sys.modules['state'] - print "state", m.called + print("state", m.called) expect = ['test_pak1.setup', 'test_pak1.test_mod.setup', @@ -348,7 +348,7 @@ descriptions=0, verbosity=1) suite(res) - print res.errors + print(res.errors) res.printErrors() assert res.errors, "Expected errors but got none" assert not res.failures, res.failures @@ -364,7 +364,7 @@ stream=_WritelnDecorator(sys.stdout), descriptions=0, verbosity=1) suite(res) - print res.errors + print(res.errors) res.printErrors() assert res.errors, "Expected errors but got none" assert not res.failures, res.failures @@ -381,7 +381,7 @@ stream=_WritelnDecorator(sys.stdout), descriptions=0, verbosity=1) suite(res) - print res.errors + print(res.errors) assert res.errors, "Expected errors but got none" assert not res.failures, res.failures @@ -412,7 +412,7 @@ stream=_WritelnDecorator(sys.stdout), descriptions=0, verbosity=1) suite(res) - print res.errors + print(res.errors) self.assertEqual(len(res.errors), 1) assert 'raise Exception("pow")' in res.errors[0][1] @@ -426,7 +426,7 @@ assert 'test_pak' in sys.modules, \ "Context did not load test_pak" m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) expect = ['test_pak.setup', 'test_pak.test_sub.setup', 'test_pak.test_sub.test_sub_init', @@ -447,7 +447,7 @@ assert 'test_pak' in sys.modules, \ "Context did not load test_pak" m = sys.modules['test_pak'] - print "test pak state", m.state + print("test pak state", m.state) expect = ['test_pak.setup', 'test_pak.test_sub.setup', 'test_pak.test_sub.test_sub_init', @@ -480,7 +480,7 @@ indent = '' def setUp(self): - print self, 'setup -->' + print(self, 'setup -->') suite.ContextSuite.setUp(self) TreePrintContextSuite.indent += ' ' @@ -489,7 +489,7 @@ try: suite.ContextSuite.tearDown(self) finally: - print self, 'teardown <--' + print(self, 'teardown <--') def __repr__(self): return '%s<%s>' % (self.indent, --- functional_tests/test_namespace_pkg.py (original) +++ functional_tests/test_namespace_pkg.py (refactored) @@ -1,7 +1,7 @@ import os import sys import unittest -from cStringIO import StringIO +from io import StringIO from nose.core import TestProgram from test_program import TestRunner --- functional_tests/test_plugin_api.py (original) +++ functional_tests/test_plugin_api.py (refactored) @@ -31,9 +31,9 @@ suitepath = os.path.join(support, 'package2') def runTest(self): - print "x" * 70 - print str(self.output) - print "x" * 70 + print("x" * 70) + print(str(self.output)) + print("x" * 70) for line in self.output: if line.startswith('test_pak'): assert line.strip().endswith('FAIL'), \ --- functional_tests/test_plugins.py (original) +++ functional_tests/test_plugins.py (refactored) @@ -23,7 +23,7 @@ conf = Config(plugins=man, stream=sys.stdout) t = TestProgram(defaultTest=wdir, config=conf, argv=['test_plugin_calls_package1'], exit=False) - print man.calls() + print(man.calls()) assert man.called self.assertEqual( @@ -47,7 +47,7 @@ conf = Config(plugins=man, stream=sys.stdout) t = TestProgram(defaultTest=wdir, config=conf, argv=['test_plugin_calls_package1', '-v'], exit=False) - print man.calls() + print(man.calls()) assert man.called self.assertEqual( --- functional_tests/test_plugintest.py (original) +++ functional_tests/test_plugintest.py (refactored) @@ -2,7 +2,7 @@ import unittest, os from nose.plugins import PluginTester, Plugin from nose.tools import eq_ -from cStringIO import StringIO +from io import StringIO class StubPlugin(Plugin): def options(self, parser, env=os.environ): --- functional_tests/test_program.py (original) +++ functional_tests/test_program.py (refactored) @@ -1,6 +1,6 @@ import os import unittest -from cStringIO import StringIO +from io import StringIO from nose import SkipTest from nose.core import TestProgram from nose.config import Config @@ -35,7 +35,7 @@ config=Config(), exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 0, "Expected to run 0 tests, ran %s" % res.testsRun) assert res.wasSuccessful() @@ -55,7 +55,7 @@ config=Config(), exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 6, "Expected to run 6 tests, ran %s" % res.testsRun) assert res.wasSuccessful() @@ -84,7 +84,7 @@ config=Config(), exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 2, "Expected to run 2 tests, ran %s" % res.testsRun) assert res.wasSuccessful() @@ -109,9 +109,9 @@ config=Config(stream=stream), exit=False) res = runner.result - print stream.getvalue() - print "-----" - print repr(res) + print(stream.getvalue()) + print("-----") + print(repr(res)) self.assertEqual(res.testsRun, 4, "Expected to run 4 tests, ran %s" % (res.testsRun,)) @@ -147,7 +147,7 @@ plugins=DefaultPluginManager()), exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 0) # error is in setup assert not res.wasSuccessful() assert res.errors @@ -164,7 +164,7 @@ config=Config(), exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 8) def test_illegal_packages_not_selected(self): @@ -178,7 +178,7 @@ plugins=DefaultPluginManager()), exit=False) res = runner.result - print stream.getvalue() + print(stream.getvalue()) self.assertEqual(res.testsRun, 0) assert res.wasSuccessful() assert not res.errors --- functional_tests/test_result.py (original) +++ functional_tests/test_result.py (refactored) @@ -1,7 +1,7 @@ import os import sys import unittest -from cStringIO import StringIO +from io import StringIO from nose.config import Config from nose.core import TestProgram from nose.plugins.manager import PluginManager @@ -23,8 +23,8 @@ TestProgram(argv=['t', '--with-todo', pkpath], config=config, exit=False) out = stream.getvalue() - print out - self.assert_('FAILED (TODO=1)' in out) + print(out) RefactoringTool: No changes to functional_tests/test_selector.py RefactoringTool: No changes to functional_tests/test_skip_pdb_interaction.py RefactoringTool: Refactored functional_tests/test_string_exception.py RefactoringTool: Refactored functional_tests/test_success.py RefactoringTool: Refactored functional_tests/test_suite.py RefactoringTool: Refactored functional_tests/test_xunit.py RefactoringTool: No changes to functional_tests/doc_tests/test_allmodules/support/mod.py RefactoringTool: No changes to functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures_fixtures.py RefactoringTool: Refactored functional_tests/doc_tests/test_issue119/test_zeronine.py RefactoringTool: No changes to functional_tests/doc_tests/test_issue142/support/errorclass_failing_test.py RefactoringTool: No changes to functional_tests/doc_tests/test_issue142/support/errorclass_failure_plugin.py RefactoringTool: No changes to functional_tests/doc_tests/test_issue142/support/errorclass_tests.py RefactoringTool: Refactored functional_tests/doc_tests/test_issue145/support/package1/__init__.py RefactoringTool: Refactored functional_tests/doc_tests/test_issue145/support/package2c/__init__.py RefactoringTool: Refactored functional_tests/doc_tests/test_issue145/support/package2f/__init__.py RefactoringTool: No changes to functional_tests/doc_tests/test_multiprocess/multiprocess_fixtures.py RefactoringTool: Refactored functional_tests/doc_tests/test_multiprocess/support/test_can_split.py RefactoringTool: Refactored functional_tests/doc_tests/test_multiprocess/support/test_not_shared.py RefactoringTool: Refactored functional_tests/doc_tests/test_multiprocess/support/test_shared.py RefactoringTool: No changes to functional_tests/doc_tests/test_selector_plugin/support/mypackage/strings.py RefactoringTool: No changes to functional_tests/doc_tests/test_selector_plugin/support/tests/testlib.py RefactoringTool: No changes to functional_tests/doc_tests/test_selector_plugin/support/tests/math/basic.py RefactoringTool: No changes to functional_tests/doc_tests/test_selector_plugin/support/tests/strings/cat.py RefactoringTool: No changes to functional_tests/doc_tests/test_xunit_plugin/support/test_skip.py RefactoringTool: No changes to functional_tests/support/test_buggy_generators.py RefactoringTool: No changes to functional_tests/support/att/test_attr.py RefactoringTool: Refactored functional_tests/support/coverage/blah.py RefactoringTool: Refactored functional_tests/support/coverage2/blah.py RefactoringTool: Refactored functional_tests/support/coverage2/moo.py RefactoringTool: No changes to functional_tests/support/ctx/mod_import_skip.py RefactoringTool: No changes to functional_tests/support/ctx/mod_setup_fails.py RefactoringTool: No changes to functional_tests/support/ctx/mod_setup_skip.py RefactoringTool: No changes to functional_tests/support/dtt/some_mod.py RefactoringTool: No changes to functional_tests/support/ep/setup.py RefactoringTool: Refactored functional_tests/support/fdp/test_fdp.py + self.assertTrue('FAILED (TODO=1)' in out) if __name__ == '__main__': --- functional_tests/test_string_exception.py (original) +++ functional_tests/test_string_exception.py (refactored) @@ -21,11 +21,11 @@ raise SkipTest("String exceptions are not supported in this " "version of Python") - print - print '!' * 70 - print str(self.output) - print '!' * 70 - print + print() + print('!' * 70) + print(str(self.output)) + print('!' * 70) + print() assert 'raise "string exception"' in str(self.output) assert 'raise "string exception in setup"' in str(self.output) assert 'raise "string exception in teardown"' in str(self.output) --- functional_tests/test_success.py (original) +++ functional_tests/test_success.py (refactored) @@ -15,7 +15,7 @@ # this test fails if the final terminating newline is not present (it # could still be written as a doctest -- PluginTester was just closer # to hand) - print self.output + print(self.output) output = remove_timings(str(self.output)) assert output == """\ test.test ... ok @@ -32,7 +32,7 @@ suitepath = os.path.join(support, 'empty') def test_zero_tests_pass(self): - print self.output + print(self.output) output = remove_timings(str(self.output)) assert output == """\ --- functional_tests/test_suite.py (original) +++ functional_tests/test_suite.py (refactored) @@ -14,7 +14,7 @@ sys.path.insert(0, os.path.join(support, 'package2')) def tearDown(self): - to_del = [ m for m in sys.modules.keys() if + to_del = [ m for m in list(sys.modules.keys()) if m not in self._mods ] if to_del: for mod in to_del: --- functional_tests/test_xunit.py (original) +++ functional_tests/test_xunit.py (refactored) @@ -21,7 +21,7 @@ suitepath = os.path.join(support, 'xunit') def runTest(self): - print str(self.output) + print(str(self.output)) assert "ERROR: test_error" in self.output assert "FAIL: test_fail" in self.output @@ -31,7 +31,7 @@ f = codecs.open(xml_results_filename,'r', encoding='utf8') result = f.read() f.close() - print result.encode('utf8', 'replace') + print(result.encode('utf8', 'replace')) assert '' in result assert '' in result @@ -53,11 +53,11 @@ suitepath = os.path.join(support, 'issue134') def runTest(self): - print str(self.output) + print(str(self.output)) f = open(xml_results_filename,'r') result = f.read() f.close() - print result + print(result) assert 'raise IOError(42, "test")' in result assert 'tests="1" errors="1" failures="0" skip="0"' in result @@ -69,11 +69,11 @@ suitepath = os.path.join(support, 'issue279') def runTest(self): - print str(self.output) + print(str(self.output)) f = open(xml_results_filename,'r') result = f.read() f.close() - print result + print(result) assert 'tests="1" errors="1" failures="0" skip="0"' in result assert "Exception: I would prefer not to" in result @@ -85,11 +85,11 @@ suitepath = os.path.join(support, 'issue680') def runTest(self): - print str(self.output) + print(str(self.output)) f = open(xml_results_filename,'rb') result = f.read().decode('utf-8') f.close() - print result + print(result) assert 'tests="1" errors="0" failures="0" skip="0"' in result @@ -100,11 +100,11 @@ suitepath = os.path.join(support, 'issue700') def runTest(self): - print str(self.output) + print(str(self.output)) f = open(xml_results_filename,'r') result = f.read() f.close() - print result + print(result) assert 'tests="1" errors="0" failures="0" skip="0"' in result assert 'line1\n' in result assert 'line2\n' in result @@ -118,10 +118,10 @@ suitepath = os.path.join(support, 'issue859') def runTest(self): - print str(self.output) + print(str(self.output)) f = open(xml_results_filename, 'r') result = f.read() f.close() - print result + print(result) assert 'tests="1" errors="0" failures="0" skip="0"' in result assert 'testsuite name="TestIssue859"' in result --- functional_tests/doc_tests/test_issue119/test_zeronine.py (original) +++ functional_tests/doc_tests/test_issue119/test_zeronine.py (refactored) @@ -18,7 +18,7 @@ suitepath = os.path.join(here, 'empty_plugin.rst') def test_empty_zero_nine_does_not_crash(self): - print self.output + print(self.output) assert "'EmptyPlugin' object has no attribute 'loadTestsFromPath'" \ not in self.output --- functional_tests/doc_tests/test_issue145/support/package1/__init__.py (original) +++ functional_tests/doc_tests/test_issue145/support/package1/__init__.py (refactored) @@ -1,2 +1,2 @@ def setup(): - print 'package1 setup' + print('package1 setup') --- functional_tests/doc_tests/test_issue145/support/package2c/__init__.py (original) +++ functional_tests/doc_tests/test_issue145/support/package2c/__init__.py (refactored) @@ -1,2 +1,2 @@ def setup(): - print 'package2c setup' + print('package2c setup') --- functional_tests/doc_tests/test_issue145/support/package2f/__init__.py (original) +++ functional_tests/doc_tests/test_issue145/support/package2f/__init__.py (refactored) @@ -1,2 +1,2 @@ def setup(): - print 'package2f setup' + print('package2f setup') --- functional_tests/doc_tests/test_multiprocess/support/test_can_split.py (original) +++ functional_tests/doc_tests/test_multiprocess/support/test_can_split.py (refactored) @@ -4,12 +4,12 @@ _multiprocess_can_split_ = 1 def setup(): - print >> sys.stderr, "setup called" + print("setup called", file=sys.stderr) called.append('setup') def teardown(): - print >> sys.stderr, "teardown called" + print("teardown called", file=sys.stderr) called.append('teardown') --- functional_tests/doc_tests/test_multiprocess/support/test_not_shared.py (original) +++ functional_tests/doc_tests/test_multiprocess/support/test_not_shared.py (refactored) @@ -4,12 +4,12 @@ _multiprocess_ = 1 def setup(): - print >> sys.stderr, "setup called" + print("setup called", file=sys.stderr) called.append('setup') def teardown(): - print >> sys.stderr, "teardown called" + print("teardown called", file=sys.stderr) called.append('teardown') --- functional_tests/doc_tests/test_multiprocess/support/test_shared.py (original) +++ functional_tests/doc_tests/test_multiprocess/support/test_shared.py (refactored) @@ -28,12 +28,12 @@ def setup(): - print >> sys.stderr, "setup called" + print("setup called", file=sys.stderr) _log('setup') def teardown(): - print >> sys.stderr, "teardown called" + print("teardown called", file=sys.stderr) _clear() --- functional_tests/support/coverage/blah.py (original) +++ functional_tests/support/coverage/blah.py (refactored) @@ -1,6 +1,6 @@ def dostuff(): - print 'hi' + print('hi') def notcov(): - print 'not covered' + print('not covered') --- functional_tests/support/coverage2/blah.py (original) +++ functional_tests/support/coverage2/blah.py (refactored) @@ -1,6 +1,6 @@ def dostuff(): - print 'hi' + print('hi') def notcov(): - print 'not covered' + print('not covered') --- functional_tests/support/coverage2/moo.py (original) +++ functional_tests/support/coverage2/moo.py (refactored) @@ -1,2 +1,2 @@ def moo(): - print 'covered' + print('covered') --- functional_tests/support/fdp/test_fdp.py (original) RefactoringTool: No changes to functional_tests/support/fdp/test_fdp_no_capt.py RefactoringTool: Refactored functional_tests/support/gen/test.py RefactoringTool: No changes to functional_tests/support/idp/exm.py RefactoringTool: No changes to functional_tests/support/idp/tests.py RefactoringTool: Refactored functional_tests/support/ipt/test1/ipthelp.py RefactoringTool: Refactored functional_tests/support/ipt/test1/tests.py RefactoringTool: Refactored functional_tests/support/ipt/test2/ipthelp.py RefactoringTool: Refactored functional_tests/support/ipt/test2/tests.py RefactoringTool: No changes to functional_tests/support/issue038/test.py RefactoringTool: Refactored functional_tests/support/issue072/test.py RefactoringTool: No changes to functional_tests/support/issue082/_mypackage/_eggs.py RefactoringTool: No changes to functional_tests/support/issue082/_mypackage/bacon.py RefactoringTool: No changes to functional_tests/support/issue082/mypublicpackage/_foo.py RefactoringTool: No changes to functional_tests/support/issue082/mypublicpackage/bar.py RefactoringTool: No changes to functional_tests/support/issue130/test.py RefactoringTool: Refactored functional_tests/support/issue134/test.py RefactoringTool: No changes to functional_tests/support/issue143/not-a-package/test.py RefactoringTool: No changes to functional_tests/support/issue191/setup.py RefactoringTool: No changes to functional_tests/support/issue269/test_bad_class.py RefactoringTool: No changes to functional_tests/support/issue279/test_mod_setup_fails.py RefactoringTool: No changes to functional_tests/support/issue408/test.py RefactoringTool: No changes to functional_tests/support/issue513/test.py RefactoringTool: Refactored functional_tests/support/issue649/test.py RefactoringTool: Refactored functional_tests/support/issue680/test.py RefactoringTool: No changes to functional_tests/support/issue700/test.py RefactoringTool: Refactored functional_tests/support/issue720/test.py RefactoringTool: No changes to functional_tests/support/issue771/test.py RefactoringTool: No changes to functional_tests/support/ltfn/test_mod.py RefactoringTool: No changes to functional_tests/support/ltfn/test_pak1/__init__.py RefactoringTool: No changes to functional_tests/support/ltfn/test_pak1/test_mod.py RefactoringTool: No changes to functional_tests/support/ltfn/test_pak2/__init__.py RefactoringTool: No changes to functional_tests/support/namespace_pkg/namespace_pkg/example.py RefactoringTool: No changes to functional_tests/support/namespace_pkg/namespace_pkg/test_pkg.py RefactoringTool: No changes to functional_tests/support/namespace_pkg/site-packages/namespace_pkg/example2.py RefactoringTool: No changes to functional_tests/support/namespace_pkg/site-packages/namespace_pkg/test_pkg2.py RefactoringTool: No changes to functional_tests/support/package1/example.py RefactoringTool: Refactored functional_tests/support/package2/test_pak/__init__.py RefactoringTool: Refactored functional_tests/support/package2/test_pak/test_mod.py RefactoringTool: No changes to functional_tests/support/package2/test_pak/test_sub/__init__.py RefactoringTool: No changes to functional_tests/support/package2/test_pak/test_sub/test_mod.py RefactoringTool: No changes to functional_tests/support/string-exception/test.py RefactoringTool: No changes to functional_tests/support/todo/test_with_todo.py RefactoringTool: No changes to functional_tests/support/todo/todoplug.py RefactoringTool: No changes to functional_tests/support/twist/test_twisted.py RefactoringTool: Refactored functional_tests/support/xunit/test_xunit_as_suite.py RefactoringTool: No changes to functional_tests/test_multiprocessing/__init__.py RefactoringTool: No changes to functional_tests/test_multiprocessing/test_class.py RefactoringTool: Refactored functional_tests/test_multiprocessing/test_keyboardinterrupt.py RefactoringTool: Refactored functional_tests/test_multiprocessing/test_nameerror.py RefactoringTool: No changes to functional_tests/test_multiprocessing/test_process_timeout.py RefactoringTool: No changes to functional_tests/test_multiprocessing/support/class.py RefactoringTool: Refactored functional_tests/test_multiprocessing/support/fake_nosetest.py RefactoringTool: No changes to functional_tests/test_multiprocessing/support/keyboardinterrupt.py RefactoringTool: No changes to functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.py RefactoringTool: No changes to functional_tests/test_multiprocessing/support/timeout.py RefactoringTool: No changes to functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py RefactoringTool: Files that were modified: RefactoringTool: nose/__init__.py RefactoringTool: nose/__main__.py RefactoringTool: nose/case.py RefactoringTool: nose/commands.py RefactoringTool: nose/config.py RefactoringTool: nose/core.py RefactoringTool: nose/exc.py RefactoringTool: nose/failure.py RefactoringTool: nose/importer.py RefactoringTool: nose/inspector.py RefactoringTool: nose/loader.py RefactoringTool: nose/proxy.py RefactoringTool: nose/pyversion.py RefactoringTool: nose/result.py RefactoringTool: nose/selector.py RefactoringTool: nose/suite.py RefactoringTool: nose/twistedtools.py RefactoringTool: nose/util.py RefactoringTool: nose/ext/__init__.py RefactoringTool: nose/ext/dtcompat.py RefactoringTool: nose/plugins/__init__.py RefactoringTool: nose/plugins/allmodules.py RefactoringTool: nose/plugins/attrib.py RefactoringTool: nose/plugins/base.py RefactoringTool: nose/plugins/builtin.py RefactoringTool: nose/plugins/capture.py RefactoringTool: nose/plugins/collect.py RefactoringTool: nose/plugins/cover.py RefactoringTool: nose/plugins/debug.py RefactoringTool: nose/plugins/deprecated.py RefactoringTool: nose/plugins/doctests.py RefactoringTool: nose/plugins/errorclass.py RefactoringTool: nose/plugins/failuredetail.py RefactoringTool: nose/plugins/isolate.py RefactoringTool: nose/plugins/logcapture.py RefactoringTool: nose/plugins/manager.py RefactoringTool: nose/plugins/multiprocess.py RefactoringTool: nose/plugins/plugintest.py RefactoringTool: nose/plugins/prof.py RefactoringTool: nose/plugins/skip.py RefactoringTool: nose/plugins/testid.py RefactoringTool: nose/plugins/xunit.py RefactoringTool: nose/sphinx/pluginopts.py RefactoringTool: nose/tools/__init__.py RefactoringTool: nose/tools/nontrivial.py RefactoringTool: nose/tools/trivial.py RefactoringTool: bin/nosetests RefactoringTool: selftest.py RefactoringTool: unit_tests/helpers.py RefactoringTool: unit_tests/mock.py RefactoringTool: unit_tests/test_attribute_plugin.py RefactoringTool: unit_tests/test_bug105.py RefactoringTool: unit_tests/test_capture_plugin.py RefactoringTool: unit_tests/test_cases.py RefactoringTool: unit_tests/test_config.py RefactoringTool: unit_tests/test_core.py RefactoringTool: unit_tests/test_cover_plugin.py RefactoringTool: unit_tests/test_deprecated_plugin.py RefactoringTool: unit_tests/test_doctest_error_handling.py RefactoringTool: unit_tests/test_doctest_no_name.py RefactoringTool: unit_tests/test_id_plugin.py RefactoringTool: unit_tests/test_importer.py RefactoringTool: unit_tests/test_inspector.py RefactoringTool: unit_tests/test_issue135.py RefactoringTool: unit_tests/test_issue270_fixtures.py RefactoringTool: unit_tests/test_issue_006.py RefactoringTool: unit_tests/test_issue_065.py RefactoringTool: unit_tests/test_issue_101.py RefactoringTool: unit_tests/test_issue_227.py RefactoringTool: unit_tests/test_issue_230.py RefactoringTool: unit_tests/test_lazy_suite.py RefactoringTool: unit_tests/test_loader.py RefactoringTool: unit_tests/test_logcapture_plugin.py RefactoringTool: unit_tests/test_logging.py RefactoringTool: unit_tests/test_multiprocess.py RefactoringTool: unit_tests/test_multiprocess_runner.py RefactoringTool: unit_tests/test_pdb_plugin.py RefactoringTool: unit_tests/test_plugin.py RefactoringTool: unit_tests/test_plugin_interfaces.py RefactoringTool: unit_tests/test_plugin_manager.py RefactoringTool: unit_tests/test_plugins.py RefactoringTool: unit_tests/test_result_proxy.py RefactoringTool: unit_tests/test_selector.py RefactoringTool: unit_tests/test_selector_plugins.py RefactoringTool: unit_tests/test_skip_plugin.py RefactoringTool: unit_tests/test_suite.py RefactoringTool: unit_tests/test_tools.py RefactoringTool: unit_tests/test_twisted.py RefactoringTool: unit_tests/test_twisted_testcase.py RefactoringTool: unit_tests/test_utils.py RefactoringTool: unit_tests/test_xunit.py RefactoringTool: unit_tests/support/script.py RefactoringTool: unit_tests/support/test.py RefactoringTool: unit_tests/support/bug105/tests.py RefactoringTool: unit_tests/support/doctest/err_doctests.py RefactoringTool: unit_tests/support/doctest/no_doctests.py RefactoringTool: unit_tests/support/doctest/noname_wrapper.py RefactoringTool: unit_tests/support/foo/__init__.py RefactoringTool: unit_tests/support/foo/bar/buz.py RefactoringTool: unit_tests/support/issue006/tests.py RefactoringTool: unit_tests/support/issue135/tests.py RefactoringTool: functional_tests/test_attribute_plugin.py RefactoringTool: functional_tests/test_buggy_generators.py RefactoringTool: functional_tests/test_cases.py RefactoringTool: functional_tests/test_collector.py RefactoringTool: functional_tests/test_commands.py RefactoringTool: functional_tests/test_config_files.py RefactoringTool: functional_tests/test_coverage_plugin.py RefactoringTool: functional_tests/test_defaultpluginmanager.py RefactoringTool: functional_tests/test_doctest_plugin.py RefactoringTool: functional_tests/test_entrypoints.py RefactoringTool: functional_tests/test_failure.py RefactoringTool: functional_tests/test_failuredetail_plugin.py RefactoringTool: functional_tests/test_generator_fixtures.py RefactoringTool: functional_tests/test_id_plugin.py RefactoringTool: functional_tests/test_importer.py RefactoringTool: functional_tests/test_isolate_plugin.py RefactoringTool: functional_tests/test_issue_072.py RefactoringTool: functional_tests/test_issue_082.py RefactoringTool: functional_tests/test_issue_408.py RefactoringTool: functional_tests/test_issue_649.py RefactoringTool: functional_tests/test_load_tests_from_test_case.py RefactoringTool: functional_tests/test_loader.py RefactoringTool: functional_tests/test_namespace_pkg.py RefactoringTool: functional_tests/test_plugin_api.py RefactoringTool: functional_tests/test_plugins.py RefactoringTool: functional_tests/test_plugintest.py RefactoringTool: functional_tests/test_program.py RefactoringTool: functional_tests/test_result.py RefactoringTool: functional_tests/test_selector.py RefactoringTool: functional_tests/test_skip_pdb_interaction.py RefactoringTool: functional_tests/test_string_exception.py RefactoringTool: functional_tests/test_success.py RefactoringTool: functional_tests/test_suite.py RefactoringTool: functional_tests/test_xunit.py RefactoringTool: functional_tests/doc_tests/test_allmodules/support/mod.py RefactoringTool: functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures_fixtures.py RefactoringTool: functional_tests/doc_tests/test_issue119/test_zeronine.py RefactoringTool: functional_tests/doc_tests/test_issue142/support/errorclass_failing_test.py RefactoringTool: functional_tests/doc_tests/test_issue142/support/errorclass_failure_plugin.py RefactoringTool: functional_tests/doc_tests/test_issue142/support/errorclass_tests.py RefactoringTool: functional_tests/doc_tests/test_issue145/support/package1/__init__.py RefactoringTool: functional_tests/doc_tests/test_issue145/support/package2c/__init__.py RefactoringTool: functional_tests/doc_tests/test_issue145/support/package2f/__init__.py RefactoringTool: functional_tests/doc_tests/test_multiprocess/multiprocess_fixtures.py RefactoringTool: functional_tests/doc_tests/test_multiprocess/support/test_can_split.py RefactoringTool: functional_tests/doc_tests/test_multiprocess/support/test_not_shared.py RefactoringTool: functional_tests/doc_tests/test_multiprocess/support/test_shared.py RefactoringTool: functional_tests/doc_tests/test_selector_plugin/support/mypackage/strings.py RefactoringTool: functional_tests/doc_tests/test_selector_plugin/support/tests/testlib.py RefactoringTool: functional_tests/doc_tests/test_selector_plugin/support/tests/math/basic.py RefactoringTool: functional_tests/doc_tests/test_selector_plugin/support/tests/strings/cat.py RefactoringTool: functional_tests/doc_tests/test_xunit_plugin/support/test_skip.py RefactoringTool: functional_tests/support/test_buggy_generators.py RefactoringTool: functional_tests/support/att/test_attr.py RefactoringTool: functional_tests/support/coverage/blah.py RefactoringTool: functional_tests/support/coverage2/blah.py RefactoringTool: functional_tests/support/coverage2/moo.py RefactoringTool: functional_tests/support/ctx/mod_import_skip.py RefactoringTool: functional_tests/support/ctx/mod_setup_fails.py RefactoringTool: functional_tests/support/ctx/mod_setup_skip.py RefactoringTool: functional_tests/support/dtt/some_mod.py RefactoringTool: functional_tests/support/ep/setup.py RefactoringTool: functional_tests/support/fdp/test_fdp.py RefactoringTool: functional_tests/support/fdp/test_fdp_no_capt.py RefactoringTool: functional_tests/support/gen/test.py RefactoringTool: functional_tests/support/idp/exm.py RefactoringTool: functional_tests/support/idp/tests.py RefactoringTool: functional_tests/support/ipt/test1/ipthelp.py RefactoringTool: functional_tests/support/ipt/test1/tests.py RefactoringTool: functional_tests/support/ipt/test2/ipthelp.py RefactoringTool: functional_tests/support/ipt/test2/tests.py RefactoringTool: functional_tests/support/issue038/test.py RefactoringTool: functional_tests/support/issue072/test.py RefactoringTool: functional_tests/support/issue082/_mypackage/_eggs.py RefactoringTool: functional_tests/support/issue082/_mypackage/bacon.py RefactoringTool: functional_tests/support/issue082/mypublicpackage/_foo.py RefactoringTool: functional_tests/support/issue082/mypublicpackage/bar.py RefactoringTool: functional_tests/support/issue130/test.py RefactoringTool: functional_tests/support/issue134/test.py RefactoringTool: functional_tests/support/issue143/not-a-package/test.py RefactoringTool: functional_tests/support/issue191/setup.py RefactoringTool: functional_tests/support/issue269/test_bad_class.py RefactoringTool: functional_tests/support/issue279/test_mod_setup_fails.py RefactoringTool: functional_tests/support/issue408/test.py RefactoringTool: functional_tests/support/issue513/test.py RefactoringTool: functional_tests/support/issue649/test.py RefactoringTool: functional_tests/support/issue680/test.py RefactoringTool: functional_tests/support/issue700/test.py RefactoringTool: functional_tests/support/issue720/test.py RefactoringTool: functional_tests/support/issue771/test.py RefactoringTool: functional_tests/support/ltfn/test_mod.py RefactoringTool: functional_tests/support/ltfn/test_pak1/__init__.py RefactoringTool: functional_tests/support/ltfn/test_pak1/test_mod.py RefactoringTool: functional_tests/support/ltfn/test_pak2/__init__.py RefactoringTool: functional_tests/support/namespace_pkg/namespace_pkg/example.py RefactoringTool: functional_tests/support/namespace_pkg/namespace_pkg/test_pkg.py RefactoringTool: functional_tests/support/namespace_pkg/site-packages/namespace_pkg/example2.py RefactoringTool: functional_tests/support/namespace_pkg/site-packages/namespace_pkg/test_pkg2.py RefactoringTool: functional_tests/support/package1/example.py RefactoringTool: functional_tests/support/package2/test_pak/__init__.py RefactoringTool: functional_tests/support/package2/test_pak/test_mod.py RefactoringTool: functional_tests/support/package2/test_pak/test_sub/__init__.py RefactoringTool: functional_tests/support/package2/test_pak/test_sub/test_mod.py RefactoringTool: functional_tests/support/string-exception/test.py RefactoringTool: functional_tests/support/todo/test_with_todo.py RefactoringTool: functional_tests/support/todo/todoplug.py RefactoringTool: functional_tests/support/twist/test_twisted.py RefactoringTool: functional_tests/support/xunit/test_xunit_as_suite.py RefactoringTool: functional_tests/test_multiprocessing/__init__.py RefactoringTool: functional_tests/test_multiprocessing/test_class.py RefactoringTool: functional_tests/test_multiprocessing/test_keyboardinterrupt.py RefactoringTool: functional_tests/test_multiprocessing/test_nameerror.py RefactoringTool: functional_tests/test_multiprocessing/test_process_timeout.py RefactoringTool: functional_tests/test_multiprocessing/support/class.py +++ functional_tests/support/fdp/test_fdp.py (refactored) @@ -2,7 +2,7 @@ raise TypeError("I can't type") def test_fail(): - print "Hello" + print("Hello") a = 2 assert a == 4, "a is not 4" --- functional_tests/support/gen/test.py (original) +++ functional_tests/support/gen/test.py (refactored) @@ -7,6 +7,6 @@ def func(_l, _n): eq_(len(_l), _n) l = [] - for i in xrange(5): + for i in range(5): yield func, l, i l.append(None) --- functional_tests/support/ipt/test1/ipthelp.py (original) +++ functional_tests/support/ipt/test1/ipthelp.py (refactored) @@ -1,4 +1,4 @@ -print "1help imported" +print("1help imported") def help(): - print "1help called" + print("1help called") pass --- functional_tests/support/ipt/test1/tests.py (original) +++ functional_tests/support/ipt/test1/tests.py (refactored) @@ -1,7 +1,7 @@ import sys -print 'ipthelp', sys.modules.get('ipthelp') +print('ipthelp', sys.modules.get('ipthelp')) import ipthelp -print ipthelp +print(ipthelp) def test1(): ipthelp.help() --- functional_tests/support/ipt/test2/ipthelp.py (original) +++ functional_tests/support/ipt/test2/ipthelp.py (refactored) @@ -1,5 +1,5 @@ -print "2help imported" +print("2help imported") def help(a): - print "2 help %s" % 1 + print("2 help %s" % 1) pass --- functional_tests/support/ipt/test2/tests.py (original) +++ functional_tests/support/ipt/test2/tests.py (refactored) @@ -1,8 +1,8 @@ import sys -print 'ipthelp', sys.modules.get('ipthelp') +print('ipthelp', sys.modules.get('ipthelp')) import ipthelp -print ipthelp +print(ipthelp) def test2(): ipthelp.help(1) --- functional_tests/support/issue072/test.py (original) +++ functional_tests/support/issue072/test.py (refactored) @@ -1,4 +1,4 @@ def test(): - print "something" + print("something") a = 4 assert a == 2 --- functional_tests/support/issue134/test.py (original) +++ functional_tests/support/issue134/test.py (refactored) @@ -1,3 +1,3 @@ def test(): - print "something" + print("something") raise IOError(42, "test") --- functional_tests/support/issue649/test.py (original) +++ functional_tests/support/issue649/test.py (refactored) @@ -5,5 +5,5 @@ class TestUnicodeInAssertion(unittest.TestCase): def test_unicodeInAssertion(self): - print "Wurst!" + print("Wurst!") raise ValueError("Käse!") --- functional_tests/support/issue680/test.py (original) +++ functional_tests/support/issue680/test.py (refactored) @@ -1,3 +1,3 @@ # coding: utf-8 def test_foo(): - print(u"abc€") + print("abc€") --- functional_tests/support/issue720/test.py (original) +++ functional_tests/support/issue720/test.py (refactored) @@ -2,5 +2,5 @@ import unittest class Test(unittest.TestCase): def test(self): - print u"Unicöde" + print("Unicöde") assert 1 == 2 --- functional_tests/support/package2/test_pak/__init__.py (original) +++ functional_tests/support/package2/test_pak/__init__.py (refactored) @@ -1,4 +1,4 @@ -print "*** test_pak imported" +print("*** test_pak imported") state = [] def setup(): --- functional_tests/support/package2/test_pak/test_mod.py (original) +++ functional_tests/support/package2/test_pak/test_mod.py (refactored) @@ -1,14 +1,14 @@ -print "test_mod imported!" +print("test_mod imported!") import maths from test_pak import state def setup(): - print "MOD setup called", state, id(state) + print("MOD setup called", state, id(state)) state.append('test_pak.test_mod.setup') def test_add(): - print "MOD.test_add called", state, id(state) + print("MOD.test_add called", state, id(state)) state.append('test_pak.test_mod.test_add') assert maths.add(1, 2) == 3 @@ -16,5 +16,5 @@ state.append('test_pak.test_mod.test_minus') def teardown(): - print "MOD teardown called", state, id(state) + print("MOD teardown called", state, id(state)) state.append('test_pak.test_mod.teardown') --- functional_tests/support/xunit/test_xunit_as_suite.py (original) +++ functional_tests/support/xunit/test_xunit_as_suite.py (refactored) @@ -15,7 +15,7 @@ raise TypeError("oops, wrong type") def test_non_ascii_error(self): - raise Exception(u"日本") + raise Exception("日本") def test_output(self): sys.stdout.write("test-generated output\n") --- functional_tests/test_multiprocessing/test_keyboardinterrupt.py (original) +++ functional_tests/test_multiprocessing/test_keyboardinterrupt.py (refactored) @@ -66,11 +66,11 @@ process, logfile, _ = keyboardinterrupt('keyboardinterrupt.py') stdout, stderr = [s.decode('utf-8') for s in process.communicate(None)] log = get_log_content(logfile) - print stderr - print '----' - print stdout - print '----' - print log + print(stderr) + print('----') + print(stdout) + print('----') + print(log) assert 'setup' in log assert 'test_timeout' in log assert 'test_timeout_finished' not in log @@ -88,11 +88,11 @@ os.killpg(process.pid, signal.SIGINT) stdout, stderr = [s.decode('utf-8') for s in process.communicate(None)] log = get_log_content(logfile) - print stderr - print '----' - print stdout - print '----' - print log + print(stderr) + print('----') + print(stdout) + print('----') + print(log) assert 'setup' in log assert 'test_timeout' in log assert 'test_timeout_finished' not in log --- functional_tests/test_multiprocessing/test_nameerror.py (original) +++ functional_tests/test_multiprocessing/test_nameerror.py (refactored) @@ -7,7 +7,7 @@ suitepath = os.path.join(os.path.dirname(__file__), 'support', 'nameerror.py') def runTest(self): - print str(self.output) + print(str(self.output)) assert 'NameError' in self.output assert "'undefined_variable' is not defined" in self.output --- functional_tests/test_multiprocessing/support/fake_nosetest.py (original) +++ functional_tests/test_multiprocessing/support/fake_nosetest.py (refactored) @@ -8,7 +8,7 @@ if __name__ == '__main__': if len(sys.argv) < 3: - print "USAGE: %s TEST_FILE LOG_FILE KILL_FILE" % sys.argv[0] + print("USAGE: %s TEST_FILE LOG_FILE KILL_FILE" % sys.argv[0]) sys.exit(1) os.environ['NOSE_MP_LOG']=sys.argv[2] os.environ['NOSE_MP_KILL']=sys.argv[3] RefactoringTool: functional_tests/test_multiprocessing/support/fake_nosetest.py RefactoringTool: functional_tests/test_multiprocessing/support/keyboardinterrupt.py RefactoringTool: functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.py RefactoringTool: functional_tests/test_multiprocessing/support/timeout.py RefactoringTool: functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py RefactoringTool: Warnings/messages while refactoring: RefactoringTool: ### In file unit_tests/test_issue_101.py ### RefactoringTool: Line 22: could not convert: raise "oh no!" RefactoringTool: Python 3 does not support string exceptions RefactoringTool: ### In file functional_tests/support/issue130/test.py ### RefactoringTool: Line 2: could not convert: raise "KABOOM" RefactoringTool: Python 3 does not support string exceptions RefactoringTool: ### In file functional_tests/support/string-exception/test.py ### RefactoringTool: Line 14: could not convert: raise "string exception in setup" RefactoringTool: Python 3 does not support string exceptions RefactoringTool: Line 22: could not convert: raise "string exception in teardown" RefactoringTool: Python 3 does not support string exceptions RefactoringTool: Line 30: could not convert: raise "string exception in test" RefactoringTool: Python 3 does not support string exceptions RefactoringTool: Line 9: could not convert: raise "string exception" RefactoringTool: Python 3 does not support string exceptions + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.yTUSHQ + umask 022 + cd /builddir/build/BUILD + cd nose-1.3.7 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ' + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s' running build running build_py creating build creating build/lib creating build/lib/nose copying nose/result.py -> build/lib/nose copying nose/__main__.py -> build/lib/nose copying nose/inspector.py -> build/lib/nose copying nose/twistedtools.py -> build/lib/nose copying nose/failure.py -> build/lib/nose copying nose/selector.py -> build/lib/nose copying nose/exc.py -> build/lib/nose copying nose/importer.py -> build/lib/nose copying nose/config.py -> build/lib/nose copying nose/suite.py -> build/lib/nose copying nose/commands.py -> build/lib/nose copying nose/loader.py -> build/lib/nose copying nose/case.py -> build/lib/nose copying nose/core.py -> build/lib/nose copying nose/proxy.py -> build/lib/nose copying nose/__init__.py -> build/lib/nose copying nose/util.py -> build/lib/nose copying nose/pyversion.py -> build/lib/nose creating build/lib/nose/ext copying nose/ext/dtcompat.py -> build/lib/nose/ext copying nose/ext/__init__.py -> build/lib/nose/ext creating build/lib/nose/plugins copying nose/plugins/multiprocess.py -> build/lib/nose/plugins copying nose/plugins/skip.py -> build/lib/nose/plugins copying nose/plugins/capture.py -> build/lib/nose/plugins copying nose/plugins/manager.py -> build/lib/nose/plugins copying nose/plugins/xunit.py -> build/lib/nose/plugins copying nose/plugins/collect.py -> build/lib/nose/plugins copying nose/plugins/base.py -> build/lib/nose/plugins copying nose/plugins/plugintest.py -> build/lib/nose/plugins copying nose/plugins/prof.py -> build/lib/nose/plugins copying nose/plugins/logcapture.py -> build/lib/nose/plugins copying nose/plugins/deprecated.py -> build/lib/nose/plugins copying nose/plugins/cover.py -> build/lib/nose/plugins copying nose/plugins/doctests.py -> build/lib/nose/plugins copying nose/plugins/allmodules.py -> build/lib/nose/plugins copying nose/plugins/failuredetail.py -> build/lib/nose/plugins copying nose/plugins/__init__.py -> build/lib/nose/plugins copying nose/plugins/builtin.py -> build/lib/nose/plugins copying nose/plugins/testid.py -> build/lib/nose/plugins copying nose/plugins/errorclass.py -> build/lib/nose/plugins copying nose/plugins/debug.py -> build/lib/nose/plugins copying nose/plugins/isolate.py -> build/lib/nose/plugins copying nose/plugins/attrib.py -> build/lib/nose/plugins creating build/lib/nose/sphinx copying nose/sphinx/pluginopts.py -> build/lib/nose/sphinx copying nose/sphinx/__init__.py -> build/lib/nose/sphinx creating build/lib/nose/tools copying nose/tools/trivial.py -> build/lib/nose/tools copying nose/tools/nontrivial.py -> build/lib/nose/tools copying nose/tools/__init__.py -> build/lib/nose/tools copying nose/usage.txt -> build/lib/nose running build_scripts creating build/scripts-3.9 copying and adjusting bin/nosetests -> build/scripts-3.9 changing mode of build/scripts-3.9/nosetests from 644 to 755 + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.owaqaq + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch ++ dirname /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch + cd nose-1.3.7 + mkdir -p /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/man/man1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ' + /usr/bin/python3 setup.py install -O1 --skip-build --root /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch running install /usr/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running install_lib creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9 creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/result.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/__main__.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/multiprocess.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/skip.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/capture.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/manager.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/xunit.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/collect.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/base.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/plugintest.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/prof.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/logcapture.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/deprecated.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/cover.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/doctests.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/allmodules.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/failuredetail.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/__init__.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/builtin.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/testid.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/errorclass.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/debug.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/isolate.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/plugins/attrib.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins copying build/lib/nose/usage.txt -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/inspector.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/sphinx copying build/lib/nose/sphinx/pluginopts.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/sphinx copying build/lib/nose/sphinx/__init__.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/sphinx creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/ext copying build/lib/nose/ext/dtcompat.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/ext copying build/lib/nose/ext/__init__.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/ext copying build/lib/nose/twistedtools.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/failure.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/selector.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/exc.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/importer.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/config.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/suite.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/commands.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools copying build/lib/nose/tools/trivial.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools copying build/lib/nose/tools/nontrivial.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools copying build/lib/nose/tools/__init__.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools copying build/lib/nose/loader.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/case.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/core.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/proxy.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/__init__.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/util.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose copying build/lib/nose/pyversion.py -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/result.py to result.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/__main__.py to __main__.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/multiprocess.py to multiprocess.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/skip.py to skip.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/capture.py to capture.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/manager.py to manager.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/xunit.py to xunit.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/collect.py to collect.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/base.py to base.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/plugintest.py to plugintest.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/prof.py to prof.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/logcapture.py to logcapture.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/deprecated.py to deprecated.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/cover.py to cover.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/doctests.py to doctests.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/allmodules.py to allmodules.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/failuredetail.py to failuredetail.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/__init__.py to __init__.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/builtin.py to builtin.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/testid.py to testid.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/errorclass.py to errorclass.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/debug.py to debug.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/isolate.py to isolate.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/plugins/attrib.py to attrib.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/inspector.py to inspector.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/sphinx/pluginopts.py to pluginopts.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/sphinx/__init__.py to __init__.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/ext/dtcompat.py to dtcompat.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/ext/__init__.py to __init__.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/twistedtools.py to twistedtools.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/failure.py to failure.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/selector.py to selector.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/exc.py to exc.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/importer.py to importer.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/config.py to config.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/suite.py to suite.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/commands.py to commands.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools/trivial.py to trivial.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools/nontrivial.py to nontrivial.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/tools/__init__.py to __init__.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/loader.py to loader.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/case.py to case.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/core.py to core.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/proxy.py to proxy.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/__init__.py to __init__.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/util.py to util.cpython-39.pyc byte-compiling /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose/pyversion.py to pyversion.cpython-39.pyc writing byte-compilation script '/tmp/tmp9rgkip0g.py' /usr/bin/python3 /tmp/tmp9rgkip0g.py removing /tmp/tmp9rgkip0g.py running install_data creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/man creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/man/man1 copying nosetests.1 -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/man/man1 running install_egg_info running egg_info writing nose.egg-info/PKG-INFO writing dependency_links to nose.egg-info/dependency_links.txt deleting nose.egg-info/entry_points.txt writing top-level names to nose.egg-info/top_level.txt reading manifest file 'nose.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'doc/.build' adding license file 'AUTHORS' writing manifest file 'nose.egg-info/SOURCES.txt' Copying nose.egg-info to /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages/nose-1.3.7-py3.9.egg-info running install_scripts creating /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin copying build/scripts-3.9/nosetests -> /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin changing mode of /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin/nosetests to 755 + rm -rfv /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin/__pycache__ + mv /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin/nosetests /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin/nosetests-3.9 + ln -sf nosetests-3.9 /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin/nosetests-3 + mv /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/man/man1/nosetests.1 /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/man/man1/nosetests-3.9.1 + ln -sf nosetests-3.9.1 /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/man/man1/nosetests-3.1 + ln -sf nosetests-3 /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/bin/nosetests + ln -sf nosetests-3.1 /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/man/man1/nosetests.1 + /usr/bin/find-debuginfo -j12 --strict-build-id -m -i --build-id-seed 1.3.7-34.el9 --unique-debug-suffix -1.3.7-34.el9.noarch --unique-debug-src-base python-nose-1.3.7-34.el9.noarch --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 --remove-section .gnu.build.attributes -S debugsourcefiles.list /builddir/build/BUILD/nose-1.3.7 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 Bytecompiling .py files below /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9 using python3.9 + /usr/lib/rpm/brp-python-hardlink + /usr/lib/rpm/redhat/brp-mangle-shebangs Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.xH5l2B + umask 022 + cd /builddir/build/BUILD + cd nose-1.3.7 + export PYTHONPATH=/builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages + PYTHONPATH=/builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/lib/python3.9/site-packages + /usr/bin/python3 -c 'import nose; from nose.config import Config; from nose.core import TestProgram; assert callable(nose.run); assert Config; assert TestProgram' + RPM_EC=0 ++ jobs -p + exit 0 Processing files: python3-nose-1.3.7-34.el9.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.QEETwR + umask 022 + cd /builddir/build/BUILD + cd nose-1.3.7 + DOCDIR=/builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/doc/python3-nose + export LC_ALL=C + LC_ALL=C + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/doc/python3-nose + cp -pr AUTHORS /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/doc/python3-nose + cp -pr CHANGELOG /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/doc/python3-nose + cp -pr NEWS /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/doc/python3-nose + cp -pr README.txt /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/doc/python3-nose + RPM_EC=0 ++ jobs -p + exit 0 Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.GCsdCa + umask 022 + cd /builddir/build/BUILD + cd nose-1.3.7 + LICENSEDIR=/builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/licenses/python3-nose + export LC_ALL=C + LC_ALL=C + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/licenses/python3-nose + cp -pr lgpl.txt /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch/usr/share/licenses/python3-nose + RPM_EC=0 ++ jobs -p + exit 0 Provides: deprecated() python-nose = 1.3.7-34.el9 python3-nose = 1.3.7-34.el9 python3.9-nose = 1.3.7-34.el9 python3.9dist(nose) = 1.3.7 python3dist(nose) = 1.3.7 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: /usr/bin/python3 python(abi) = 3.9 Conflicts: python-nose < 1.3.7-34.el9 Obsoletes: python-nose < 1.3.7-34.el9 python-nose-docs < 1.3.7-30 python39-nose < 1.3.7-34.el9 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-nose-1.3.7-34.el9.noarch Wrote: /builddir/build/RPMS/python3-nose-1.3.7-34.el9.noarch.rpm Child return code was: 0