<86>Apr 14 00:38:00 userdel[13286]: delete user 'rooter' <86>Apr 14 00:38:00 userdel[13286]: removed shadow group 'rooter' owned by 'rooter' <86>Apr 14 00:38:00 groupadd[13297]: group added to /etc/group: name=rooter, GID=585 <86>Apr 14 00:38:00 groupadd[13297]: group added to /etc/gshadow: name=rooter <86>Apr 14 00:38:00 groupadd[13297]: new group: name=rooter, GID=585 <86>Apr 14 00:38:00 useradd[13305]: new user: name=rooter, UID=585, GID=585, home=/root, shell=/bin/bash <86>Apr 14 00:38:00 userdel[13318]: delete user 'builder' <86>Apr 14 00:38:00 userdel[13318]: removed group 'builder' owned by 'builder' <86>Apr 14 00:38:00 userdel[13318]: removed shadow group 'builder' owned by 'builder' <86>Apr 14 00:38:00 groupadd[13326]: group added to /etc/group: name=builder, GID=586 <86>Apr 14 00:38:00 groupadd[13326]: group added to /etc/gshadow: name=builder <86>Apr 14 00:38:00 groupadd[13326]: new group: name=builder, GID=586 <86>Apr 14 00:38:00 useradd[13334]: new user: name=builder, UID=586, GID=586, home=/usr/src, shell=/bin/bash <13>Apr 14 00:38:03 rpmi: libexpat-2.2.4-alt0.M80P.1 1503871120 installed <13>Apr 14 00:38:03 rpmi: libgdbm-1.8.3-alt10 1454943313 installed <13>Apr 14 00:38:03 rpmi: libtinfo-devel-5.9-alt8 1456756459 installed <13>Apr 14 00:38:03 rpmi: libncurses-devel-5.9-alt8 1456756459 installed <13>Apr 14 00:38:03 rpmi: python-modules-curses-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:03 rpmi: libverto-0.2.6-alt1_6 1455633234 installed <13>Apr 14 00:38:03 rpmi: libkeyutils-1.5.10-alt0.M80P.2 p8+216694.100.6.1 1547827915 installed <13>Apr 14 00:38:03 rpmi: libcom_err-1.42.13-alt2 1449075846 installed <13>Apr 14 00:38:03 rpmi: ca-certificates-2016.02.25-alt1 1462368370 installed <13>Apr 14 00:38:04 rpmi: libcrypto10-1.0.2n-alt0.M80P.1 1512766129 installed <13>Apr 14 00:38:04 rpmi: libssl10-1.0.2n-alt0.M80P.1 1512766129 installed <86>Apr 14 00:38:04 groupadd[18268]: group added to /etc/group: name=_keytab, GID=499 <86>Apr 14 00:38:04 groupadd[18268]: group added to /etc/gshadow: name=_keytab <86>Apr 14 00:38:04 groupadd[18268]: new group: name=_keytab, GID=499 <13>Apr 14 00:38:04 rpmi: libkrb5-1.14.6-alt1.M80P.1 1525355673 installed <13>Apr 14 00:38:04 rpmi: python3-base-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 00:38:05 rpmi: python3-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 00:38:05 rpmi: python-modules-compiler-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:05 rpmi: rpm-build-python3-0.1.10.10-alt1.M80P.1 1530521451 installed <13>Apr 14 00:38:05 rpmi: libpython3-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 00:38:05 rpmi: python3-module-py-1.4.34-alt0.M80P.1 1503506764 installed <13>Apr 14 00:38:05 rpmi: python3-dev-3.5.4-alt2.M80P.1 1527753911 installed <13>Apr 14 00:38:05 rpmi: python-modules-email-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:05 rpmi: python3-module-pytest-3.2.1-alt0.M80P.1 1503499784 installed <13>Apr 14 00:38:05 rpmi: python3-module-setuptools-1:18.5-alt0.M80P.1 1497527461 installed <13>Apr 14 00:38:05 rpmi: python-modules-unittest-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-ctypes-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-encodings-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-multiprocessing-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-logging-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-tools-2to3-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-xml-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-hotshot-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-modules-bsddb-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-dev-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-module-py-1.4.34-alt0.M80P.1 1503506764 installed <13>Apr 14 00:38:06 rpmi: python-modules-json-2.7.11-alt6.M80P.1 1527682470 installed <13>Apr 14 00:38:06 rpmi: python-module-pytest-3.2.1-alt0.M80P.1 1503499784 installed <13>Apr 14 00:38:06 rpmi: python-module-setuptools-1:18.5-alt0.M80P.1 1497527461 installed Installing python-module-enum-0.4.4-alt1.1.src.rpm Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /usr/src/tmp/rpm-tmp.39164 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf enum-0.4.4 + echo 'Source #0 (enum-0.4.4.tar):' Source #0 (enum-0.4.4.tar): + /bin/tar -xf /usr/src/RPM/SOURCES/enum-0.4.4.tar + cd enum-0.4.4 + /bin/chmod -c -Rf u+rwX,go-w . + echo 'Patch #0 (enum-0.4.4-alt-python3.patch):' Patch #0 (enum-0.4.4-alt-python3.patch): + /usr/bin/patch -p2 patching file setup.py + cp -fR . ../python3 + find ../python3 -type f -name '*.py' -exec 2to3 -w -n '{}' + 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 ../python3/setup.py RefactoringTool: No changes to ../python3/test/tools.py RefactoringTool: Refactored ../python3/test/test_enum.py --- ../python3/test/test_enum.py (original) +++ ../python3/test/test_enum.py (refactored) @@ -15,7 +15,7 @@ import unittest import operator -import tools +from . import tools import enum @@ -74,7 +74,7 @@ ), } - for enumtype, params in testcase.valid_values.items(): + for enumtype, params in list(testcase.valid_values.items()): params['enumtype'] = enumtype values = {} for i, key in enumerate(params['keys']): @@ -94,72 +94,72 @@ def test_author_name_is_string(self): """ Module should have __author_name__ string. """ mod_author_name = self.module.__author_name__ - self.failUnless(isinstance(mod_author_name, basestring)) + self.assertTrue(isinstance(mod_author_name, str)) def test_author_email_is_string(self): """ Module should have __author_email__ string. """ mod_author_email = self.module.__author_email__ - self.failUnless(isinstance(mod_author_email, basestring)) + self.assertTrue(isinstance(mod_author_email, str)) def test_author_is_string(self): """ Module should have __author__ string. """ mod_author = self.module.__author__ - self.failUnless(isinstance(mod_author, basestring)) + self.assertTrue(isinstance(mod_author, str)) def test_author_contains_name(self): """ Module __author__ string should contain author name. """ mod_author = self.module.__author__ mod_author_name = self.module.__author_name__ - self.failUnless(mod_author.startswith(mod_author_name)) + self.assertTrue(mod_author.startswith(mod_author_name)) def test_author_contains_email(self): """ Module __author__ string should contain author email. """ mod_author = self.module.__author__ mod_author_email = self.module.__author_email__ - self.failUnless(mod_author.endswith("<%(mod_author_email)s>" % vars())) + self.assertTrue(mod_author.endswith("<%(mod_author_email)s>" % vars())) def test_date_is_string(self): """ Module should have __date__ string. """ mod_date = self.module.__date__ - self.failUnless(isinstance(mod_date, basestring)) + self.assertTrue(isinstance(mod_date, str)) def test_copyright_is_string(self): """ Module should have __copyright__ string. """ mod_copyright = self.module.__copyright__ - self.failUnless(isinstance(mod_copyright, basestring)) + self.assertTrue(isinstance(mod_copyright, str)) def test_copyright_contains_name(self): """ Module __copyright__ string should contain author name. """ mod_copyright = self.module.__copyright__ mod_author_name = self.module.__author_name__ - self.failUnless(mod_copyright.endswith(mod_author_name)) + self.assertTrue(mod_copyright.endswith(mod_author_name)) def test_copyright_contains_begin_year(self): """ Module __copyright__ string should contain beginning year. """ mod_copyright = self.module.__copyright__ year_begin = self.module._copyright_year_begin - self.failUnless(year_begin in mod_copyright) + self.assertTrue(year_begin in mod_copyright) def test_copyright_contains_latest_year(self): """ Module __copyright__ string should contain latest year.. """ mod_copyright = self.module.__copyright__ year_latest = self.module.__date__.split('-')[0] - self.failUnless(year_latest in mod_copyright) + self.assertTrue(year_latest in mod_copyright) def test_license_is_string(self): """ Module should have __license__ string. """ mod_license = self.module.__license__ - self.failUnless(isinstance(mod_license, basestring)) + self.assertTrue(isinstance(mod_license, str)) def test_url_is_string(self): """ Module should have __url__ string. """ mod_url = self.module.__url__ - self.failUnless(isinstance(mod_url, basestring)) + self.assertTrue(isinstance(mod_url, str)) def test_version_is_string(self): """ Module should have __version__ string. """ mod_version = self.module.__version__ - self.failUnless(isinstance(mod_version, basestring)) + self.assertTrue(isinstance(mod_version, str)) @@ -183,28 +183,28 @@ ), } - for exc_type, params in self.valid_exceptions.items(): + for exc_type, params in list(self.valid_exceptions.items()): args = (None,) * params['min_args'] instance = exc_type(*args) self.valid_exceptions[exc_type]['instance'] = instance def test_EnumException_abstract(self): """ The module exception base class should be abstract. """ - self.failUnlessRaises( + self.assertRaises( NotImplementedError, enum.EnumException) def test_exception_instance(self): """ Exception instance should be created. """ - for exc_type, params in self.valid_exceptions.items(): + for exc_type, params in list(self.valid_exceptions.items()): instance = params['instance'] - self.failUnless(instance) + self.assertTrue(instance) def test_exception_types(self): """ Exception instances should match expected types. """ - for exc_type, params in self.valid_exceptions.items(): + for exc_type, params in list(self.valid_exceptions.items()): instance = params['instance'] for match_type in params['types']: - self.failUnless( + self.assertTrue( isinstance(instance, match_type), msg=( "instance: %(instance)r, match_type: %(match_type)s" @@ -227,64 +227,64 @@ def test_instantiate(self): """ Creating an EnumValue instance should succeed. """ - for enumtype, params in self.valid_values.items(): - for key, instance in params['values'].items(): - self.failUnless(instance) + for enumtype, params in list(self.valid_values.items()): + for key, instance in list(params['values'].items()): + self.assertTrue(instance) def test_enumtype_equal(self): """ EnumValue should export its enum type. """ - for enumtype, params in self.valid_values.items(): - for key, instance in params['values'].items(): - self.failUnlessEqual(enumtype, instance.enumtype) + for enumtype, params in list(self.valid_values.items()): + for key, instance in list(params['values'].items()): + self.assertEqual(enumtype, instance.enumtype) def test_key_equal(self): """ EnumValue should export its string key. """ - for enumtype, params in self.valid_values.items(): - for key, instance in params['values'].items(): - self.failUnlessEqual(key, instance.key) + for enumtype, params in list(self.valid_values.items()): + for key, instance in list(params['values'].items()): + self.assertEqual(key, instance.key) def test_str_key(self): """ String value for EnumValue should be its key string. """ - for enumtype, params in self.valid_values.items(): - for key, instance in params['values'].items(): - self.failUnlessEqual(key, str(instance)) + for enumtype, params in list(self.valid_values.items()): + for key, instance in list(params['values'].items()): + self.assertEqual(key, str(instance)) def test_index_equal(self): """ EnumValue should export its sequence index. """ - for enumtype, params in self.valid_values.items(): - for i, key in enumerate(params['keys']): - instance = params['values'][key] - self.failUnlessEqual(i, instance.index) + for enumtype, params in list(self.valid_values.items()): + for i, key in enumerate(params['keys']): + instance = params['values'][key] + self.assertEqual(i, instance.index) def test_repr(self): """ Representation of EnumValue should be meaningful. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): instance = params['values'][key] repr_str = repr(instance) - self.failUnless(repr_str.startswith('EnumValue(')) - self.failUnless(repr_str.count(repr(enumtype))) - self.failUnless(repr_str.count(repr(i))) - self.failUnless(repr_str.count(repr(key))) - self.failUnless(repr_str.endswith(')')) + self.assertTrue(repr_str.startswith('EnumValue(')) + self.assertTrue(repr_str.count(repr(enumtype))) + self.assertTrue(repr_str.count(repr(i))) + self.assertTrue(repr_str.count(repr(key))) + self.assertTrue(repr_str.endswith(')')) def test_hash_equal(self): """ Each EnumValue instance should have same hash as its value. """ - for enumtype, params in self.valid_values.items(): - for i, key in enumerate(params['keys']): - instance = params['values'][key] - self.failUnlessEqual(hash(i), hash(instance)) + for enumtype, params in list(self.valid_values.items()): + for i, key in enumerate(params['keys']): + instance = params['values'][key] + self.assertEqual(hash(i), hash(instance)) def test_hash_unequal(self): """ Different EnumValue instances should have different hashes. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): instance = params['values'][key] for j, other_key in enumerate(params['keys']): if i == j: continue other_instance = params['values'][other_key] - self.failIfEqual( + self.assertNotEqual( hash(instance), hash(other_instance)) def test_comparison_method_has_matching_name(self): @@ -293,7 +293,7 @@ func_name = compare_func.__name__ expect_name = func_name compare_method = getattr(enum.EnumValue, func_name) - self.failUnlessEqual( + self.assertEqual( expect_name, compare_method.__name__) def test_comparison_method_has_docstring(self): @@ -301,33 +301,33 @@ for compare_func in compare_functions: func_name = compare_func.__name__ compare_method = getattr(enum.EnumValue, func_name) - self.failUnless( - isinstance(compare_method.__doc__, basestring)) + self.assertTrue( + isinstance(compare_method.__doc__, str)) def test_compare_equal(self): """ An EnumValue should compare equal to its value. """ - for enumtype, params in self.valid_values.items(): - for i, key in enumerate(params['keys']): - instance = params['values'][key] - self.failUnlessEqual( + for enumtype, params in list(self.valid_values.items()): + for i, key in enumerate(params['keys']): + instance = params['values'][key] + self.assertEqual( instance, enum.EnumValue(enumtype, i, key)) def test_compare_unequal(self): """ An EnumValue should compare different to other values. """ - for enumtype, params in self.valid_values.items(): - for i, key in enumerate(params['keys']): - instance = params['values'][key] - self.failIfEqual( + for enumtype, params in list(self.valid_values.items()): + for i, key in enumerate(params['keys']): + instance = params['values'][key] + self.assertNotEqual( instance, enum.EnumValue(enumtype, None, None)) def test_compare_sequence(self): """ EnumValue instances should compare as their sequence order. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, left_key in enumerate(params['keys']): for j, right_key in enumerate(params['keys']): for compare_func in compare_functions: - self.failUnlessEqual( + self.assertEqual( compare_func(i, j), compare_func(params['values'][left_key], enum.EnumValue(enumtype, j, right_key)) @@ -335,14 +335,14 @@ def test_compare_different_enum(self): """ An EnumValue should not implement comparison to other enums. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): for compare_func in compare_functions: instance = params['values'][key] test_value = enum.EnumValue(self.SimpleEnum, i, key) compare_method = getattr(instance, compare_func.__name__) compare_result = compare_method(test_value) - self.failUnlessEqual(NotImplemented, compare_result) + self.assertEqual(NotImplemented, compare_result) def test_compare_non_enum(self): """ An EnumValue should not implement comparison to other types. """ @@ -351,21 +351,21 @@ for compare_func in compare_functions: compare_method = getattr(test_value, compare_func.__name__) compare_result = compare_method(other_value) - self.failUnlessEqual(NotImplemented, compare_result) + self.assertEqual(NotImplemented, compare_result) def test_compare_equality_different_enum(self): """ An EnumValue should compare inequal to values of other enums. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): instance = params['values'][key] test_value = enum.EnumValue(self.SimpleEnum, i, key) - self.failIfEqual(test_value, instance) + self.assertNotEqual(test_value, instance) def test_compare_equality_non_enum(self): """ An EnumValue should compare inequal to any other value. """ test_value = enum.EnumValue(self.SimpleEnum, 0, 'test') for other_value in self.other_values: - self.failIfEqual(test_value, other_value) + self.assertNotEqual(test_value, other_value) def test_sequence_other_values(self): """ An EnumValue should compare sequentially to other values. """ @@ -373,19 +373,19 @@ test_list = list(self.other_values) test_list.append(test_value) test_list.sort() - self.failUnless(test_value in test_list) + self.assertTrue(test_value in test_list) def test_value_key(self): """ An EnumValue should have the specified key. """ - for enumtype, params in self.valid_values.items(): - for key, instance in params['values'].items(): - self.failUnlessEqual(key, instance.key) + for enumtype, params in list(self.valid_values.items()): + for key, instance in list(params['values'].items()): + self.assertEqual(key, instance.key) def test_value_enumtype(self): """ An EnumValue should have its associated enumtype. """ - for enumtype, params in self.valid_values.items(): - for key, instance in params['values'].items(): - self.failUnlessEqual(enumtype, instance.enumtype) + for enumtype, params in list(self.valid_values.items()): + for key, instance in list(params['values'].items()): + self.assertEqual(enumtype, instance.enumtype) @@ -400,7 +400,7 @@ def test_empty_enum(self): """ Enum constructor should refuse empty keys sequence. """ - self.failUnlessRaises( + self.assertRaises( enum.EnumEmptyError, enum.Enum) @@ -408,111 +408,111 @@ """ Enum constructor should refuse non-string keys. """ for key in self.bad_keys: args = ("valid", key, "valid") - self.failUnlessRaises( + self.assertRaises( enum.EnumBadKeyError, enum.Enum, *args) def test_value_attributes(self): """ Enumeration should have attributes for each value. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): instance = getattr(enumtype, key) test_value = enum.EnumValue(enumtype, i, key) - self.failUnlessEqual(test_value, instance) + self.assertEqual(test_value, instance) def test_length(self): """ Enumeration should have length of its value set. """ - for enumtype, params in self.valid_values.items(): - self.failUnlessEqual(len(params['values']), len(enumtype)) + for enumtype, params in list(self.valid_values.items()): + self.assertEqual(len(params['values']), len(enumtype)) def test_value_items(self): """ Enumeration should have items for each value. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): value = enumtype[i] test_value = enum.EnumValue(enumtype, i, key) - self.failUnlessEqual(test_value, value) + self.assertEqual(test_value, value) def test_iterable(self): """ Enumeration class should iterate over its values. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, value in enumerate(enumtype): key = params['keys'][i] test_value = params['values'][key] - self.failUnlessEqual(value, test_value) + self.assertEqual(value, test_value) def test_iterate_sequence(self): """ Enumeration iteration should match specified sequence. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): values_dict = params['values'] values_seq = [values_dict[key] for key in params['keys']] enum_seq = [val for val in enumtype] - self.failUnlessEqual(values_seq, enum_seq) - self.failIfEqual(values_seq.reverse(), enum_seq) + self.assertEqual(values_seq, enum_seq) + self.assertNotEqual(values_seq.reverse(), enum_seq) def test_membership_bogus(self): """ Enumeration should not contain bogus values. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for value in self.other_values: - self.failIf(value in enumtype) + self.assertFalse(value in enumtype) def test_membership_value(self): """ Enumeration should contain explicit value. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for i, key in enumerate(params['keys']): value = params['values'][key] - self.failUnless(value in enumtype) + self.assertTrue(value in enumtype) def test_membership_kRefactoringTool: Refactored ../python3/enum.py RefactoringTool: Files that were modified: RefactoringTool: ../python3/setup.py RefactoringTool: ../python3/test/tools.py RefactoringTool: ../python3/test/test_enum.py RefactoringTool: ../python3/enum.py ey(self): """ Enumeration should contain key string. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for key in params['keys']: - self.failUnless(key in enumtype) + self.assertTrue(key in enumtype) def test_add_attribute(self): """ Enumeration should refuse attribute addition. """ - for enumtype, params in self.valid_values.items(): - self.failUnlessRaises( + for enumtype, params in list(self.valid_values.items()): + self.assertRaises( enum.EnumImmutableError, setattr, enumtype, 'bogus', "bogus") def test_modify_attribute(self): """ Enumeration should refuse attribute modification. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for key in params['keys']: - self.failUnlessRaises( + self.assertRaises( enum.EnumImmutableError, setattr, enumtype, key, "bogus") def test_delete_attribute(self): """ Enumeration should refuse attribute deletion. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): for key in params['keys']: - self.failUnlessRaises( + self.assertRaises( enum.EnumImmutableError, delattr, enumtype, key) def test_add_item(self): """ Enumeration should refuse item addition. """ - for enumtype, params in self.valid_values.items(): + for enumtype, params in list(self.valid_values.items()): index = len(params['keys']) - self.failUnlessRaises( + self.assertRaises( enum.EnumImmutableError, enumtype.__setitem__, index, "bogus") def test_modify_item(self): """ Enumeration should refuse item modification. """ - for enumtype, params in self.valid_values.items(): - for i, key in enumerate(params['keys']): - self.failUnlessRaises( + for enumtype, params in list(self.valid_values.items()): + for i, key in enumerate(params['keys']): + self.assertRaises( enum.EnumImmutableError, enumtype.__setitem__, i, "bogus") def test_delete_item(self): """ Enumeration should refuse item deletion. """ - for enumtype, params in self.valid_values.items(): - for i, key in enumerate(params['keys']): - self.failUnlessRaises( + for enumtype, params in list(self.valid_values.items()): + for i, key in enumerate(params['keys']): + self.assertRaises( enum.EnumImmutableError, enumtype.__delitem__, i) @@ -536,7 +536,7 @@ exitcode = None try: unittest.main(argv=argv, defaultTest='suite') - except SystemExit, exc: + except SystemExit as exc: exitcode = exc.code return exitcode --- ../python3/enum.py (original) +++ ../python3/enum.py (refactored) @@ -226,7 +226,7 @@ def __contains__(self, value): is_member = False - if isinstance(value, basestring): + if isinstance(value, str): is_member = (value in self._keys) else: is_member = (value in self._values) + exit 0 Executing(%build): /bin/sh -e /usr/src/tmp/rpm-tmp.31870 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd enum-0.4.4 + CFLAGS='-pipe -Wall -g -O2' + export CFLAGS + CXXFLAGS='-pipe -Wall -g -O2' + export CXXFLAGS + FFLAGS='-pipe -Wall -g -O2' + export FFLAGS + /usr/bin/python2.7 setup.py build running build running build_py creating build creating build/lib copying enum.py -> build/lib + pushd ../python3 ~/RPM/BUILD/python3 ~/RPM/BUILD/enum-0.4.4 + CFLAGS='-pipe -Wall -g -O2' + export CFLAGS + CXXFLAGS='-pipe -Wall -g -O2' + export CXXFLAGS + FFLAGS='-pipe -Wall -g -O2' + export FFLAGS + python3 setup.py build Traceback (most recent call last): File "setup.py", line 17, in from setuptools import setup, find_packages File "/usr/lib/python3/site-packages/setuptools/__init__.py", line 12, in from setuptools.extension import Extension File "/usr/lib/python3/site-packages/setuptools/extension.py", line 8, in from .dist import _get_unpatched File "/usr/lib/python3/site-packages/setuptools/dist.py", line 16, in from setuptools.depends import Require File "/usr/lib/python3/site-packages/setuptools/depends.py", line 6, in from setuptools import compat File "/usr/lib/python3/site-packages/setuptools/compat.py", line 45, in import http.client as httplib File "/usr/lib64/python3.5/http/__init__.py", line 1, in from enum import IntEnum ImportError: cannot import name 'IntEnum' error: Bad exit status from /usr/src/tmp/rpm-tmp.31870 (%build) RPM build errors: Bad exit status from /usr/src/tmp/rpm-tmp.31870 (%build) Command exited with non-zero status 1 2.17user 0.29system 0:02.56elapsed 96%CPU (0avgtext+0avgdata 27048maxresident)k 0inputs+0outputs (0major+45418minor)pagefaults 0swaps hsh-rebuild: rebuild of `python-module-enum-0.4.4-alt1.1.src.rpm' failed. Command exited with non-zero status 1 8.90user 4.17system 0:12.84elapsed 101%CPU (0avgtext+0avgdata 122064maxresident)k 0inputs+0outputs (0major+231501minor)pagefaults 0swaps