Bug 2026264 - python-flaky fails to build with Python 3.11: AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'
Summary: python-flaky fails to build with Python 3.11: AttributeError: 'TestFlakyNoseP...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-flaky
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-24 08:18 UTC by Tomáš Hrnčiar
Modified: 2021-11-25 17:58 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-11-25 17:58:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-24 08:18:30 UTC
python-flaky fails to build with Python 3.11.0a2.

======================================================================
ERROR: test_flaky_plugin_handles_additional_errors (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 134, in test_flaky_plugin_handles_additional_errors
    self._test_flaky_plugin_handles_failure_or_error(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 289, in _test_flaky_plugin_handles_failure_or_error
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_error_for_test_instance (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 116, in test_flaky_plugin_handles_error_for_test_instance
    self._test_flaky_plugin_handles_failure_or_error(is_test_method=False)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 289, in _test_flaky_plugin_handles_failure_or_error
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_error_for_test_method (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 113, in test_flaky_plugin_handles_error_for_test_method
    self._test_flaky_plugin_handles_failure_or_error()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 289, in _test_flaky_plugin_handles_failure_or_error
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_failure_for_no_more_retries (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 128, in test_flaky_plugin_handles_failure_for_no_more_retries
    self._test_flaky_plugin_handles_failure_or_error(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 289, in _test_flaky_plugin_handles_failure_or_error
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_failure_for_test_instance (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 122, in test_flaky_plugin_handles_failure_for_test_instance
    self._test_flaky_plugin_handles_failure_or_error(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 289, in _test_flaky_plugin_handles_failure_or_error
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_failure_for_test_method (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 119, in test_flaky_plugin_handles_failure_for_test_method
    self._test_flaky_plugin_handles_failure_or_error(is_failure=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 289, in _test_flaky_plugin_handles_failure_or_error
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_success_for_needs_rerun (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 86, in test_flaky_plugin_handles_success_for_needs_rerun
    self._test_flaky_plugin_handles_success(min_passes=2)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 380, in _test_flaky_plugin_handles_success
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_success_for_test_instance (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 83, in test_flaky_plugin_handles_success_for_test_instance
    self._test_flaky_plugin_handles_success(is_test_method=False)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 380, in _test_flaky_plugin_handles_success
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

======================================================================
ERROR: test_flaky_plugin_handles_success_for_test_method (test.test_nose.test_flaky_nose_plugin.TestFlakyNosePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 80, in test_flaky_plugin_handles_success_for_test_method
    self._test_flaky_plugin_handles_success()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 380, in _test_flaky_plugin_handles_success
    self._assert_flaky_attributes_contains(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_flaky_nose_plugin.py", line 226, in _assert_flaky_attributes_contains
    self.assertDictContainsSubset(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestFlakyNosePlugin' object has no attribute 'assertDictContainsSubset'

===Flaky Test Report===

test_flaky_thing_that_fails_then_succeeds failed (1 runs remaining out of 2).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 69, in test_flaky_thing_that_fails_then_succeeds
	    raise Exception("Threshold is not high enough: {} vs {}.".format(
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Exception: Threshold is not high enough: 0 vs 1.
test_flaky_thing_that_fails_then_succeeds passed 1 out of the required 1 times. Success!
test_flaky_thing_that_fails_then_succeeds failed (1 runs remaining out of 2).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 69, in test_flaky_thing_that_fails_then_succeeds
	    raise Exception("Threshold is not high enough: {} vs {}.".format(
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Exception: Threshold is not high enough: 0 vs 1.
test_flaky_thing_that_fails_then_succeeds passed 1 out of the required 1 times. Success!
test_non_flaky_thing('ascii name') failed (1 runs remaining out of 2).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/usr/lib/python3.11/site-packages/genty/genty.py", line 362, in <lambda>
	    test_method = lambda my_self: method(
	                                  ^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 95, in test_non_flaky_thing
	    raise Exception(
	    ^^^^^^^^^^^^^^^^
	Exception: Threshold is not high enough: 0 vs 1 for 'ascii name'.
test_non_flaky_thing('ascii name') passed 1 out of the required 1 times. Success!
test_non_flaky_thing('ńőń ÈÅćȉȉ ÅÆ­È•Æ’Æ’') failed (1 runs remaining out of 2).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/usr/lib/python3.11/site-packages/genty/genty.py", line 362, in <lambda>
	    test_method = lambda my_self: method(
	                                  ^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 95, in test_non_flaky_thing
	    raise Exception(
	    ^^^^^^^^^^^^^^^^
	Exception: Threshold is not high enough: 0 vs 1 for 'ńőń ÈÅćȉȉ ÅÆ­È•Æ’Æ’'.
test_non_flaky_thing('ńőń ÈÅćȉȉ ÅÆ­È•Æ’Æ’') passed 1 out of the required 1 times. Success!
test_flaky_thing_that_always_passes passed 1 out of the required 2 times. Running test again until it passes 2 times.
test_flaky_thing_that_always_passes passed 2 out of the required 2 times. Success!
test_flaky_thing_that_fails_then_succeeds failed (2 runs remaining out of 3).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 35, in test_flaky_thing_that_fails_then_succeeds
	    raise Exception("Threshold is not high enough: {} vs {}.".format(
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Exception: Threshold is not high enough: 0 vs 1.
test_flaky_thing_that_fails_then_succeeds passed 1 out of the required 2 times. Running test again until it passes 2 times.
test_flaky_thing_that_fails_then_succeeds passed 2 out of the required 2 times. Success!
test_flaky_thing_that_succeeds_then_fails_then_succeeds passed 1 out of the required 2 times. Running test again until it passes 2 times.
test_flaky_thing_that_succeeds_then_fails_then_succeeds failed (1 runs remaining out of 3).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 46, in test_flaky_thing_that_succeeds_then_fails_then_succeeds
	    self.assertEqual(0, 1)
	    ^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 841, in assertEqual
	    assertion_func(first, second, msg=msg)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 834, in _baseAssertEqual
	    raise self.failureException(msg)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	AssertionError: 0 != 1
test_flaky_thing_that_succeeds_then_fails_then_succeeds passed 2 out of the required 2 times. Success!
test_flaky_function failed (1 runs remaining out of 2).Traceback (most recent call last):
	  File "/usr/lib64/python3.11/unittest/case.py", line 57, in testPartExecutor
	    yield
	    ^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 591, in run
	    self._callTestMethod(testMethod)
	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/usr/lib64/python3.11/unittest/case.py", line 547, in _callTestMethod
	    if method() is not None:
	       ^^^^^^^^
	  File "/usr/lib/python3.11/site-packages/nose/case.py", line 197, in runTest
	    self.test(*self.arg)
	    ^^^^^^^^^^^^^^^^^^^^
	  File "/builddir/build/BUILD/flaky-3.7.0/test/test_nose/test_nose_example.py", line 86, in test_flaky_function
	    assert param_length == 1
	    ^^^^^^^^^^^^^^^^^^^^^^^^
	AssertionError
test_flaky_function passed 1 out of the required 1 times. Success!

===End Flaky Test Report===
----------------------------------------------------------------------
Ran 31 tests in 0.085s

FAILED (SKIP=1, errors=9)

Removed many old deprecated unittest features:
    TestCase method aliases failUnlessEqual, failIfEqual, failUnless, failIf, failUnlessRaises, failUnlessAlmostEqual, failIfAlmostEqual (deprecated in Python 3.1), assertEquals, assertNotEquals, assert_, assertAlmostEquals, assertNotAlmostEquals, assertRegexpMatches, assertRaisesRegexp (deprecated in Python 3.2), and assertNotRegexpMatches (deprecated in Python 3.5).
    Undocumented and broken TestCase method assertDictContainsSubset (deprecated in Python 3.2).
    Undocumented <unittest.TestLoader.loadTestsFromModule> TestLoader.loadTestsFromModule() parameter use_load_tests (deprecated and ignored since Python 3.2).
    An alias of the TextTestResult class: _TextTestResult (deprecated in Python 3.2).
(Contributed by Serhiy Storchaka in bpo-45162.)

https://bugs.python.org/issue45162
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02984870-python-flaky/

For all our attempts to build python-flaky with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-flaky/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.


Note You need to log in before you can comment on or make changes to this bug.