Bug 2019403

Summary: python-nose2 fails to build with Python 3.11: AssertionError: Regex didn't match: 'self.assertTrue\\(x\\) AssertionError: False is not true' not found in 'test_old_assertion (unittest_assertion.test_prettyassert_unittestassertion.TestFoo)
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-nose2Assignee: Aurelien Bompard <aurelien>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: aurelien, hugovk+redhatbugzilla, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.11.0-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-06 12:01:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1992484, 2016048, 2045102    

Description Tomáš Hrnčiar 2021-11-02 13:53:18 UTC
python-nose2 fails to build with Python 3.11.0a1.

======================================================================
ERROR: test_setup_injection (nose2.tests.unit.test_decorators.WithSetupDecoratorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/unit/test_decorators.py", line 20, in test_setup_injection
    self.assertEquals(expected, self.fake_setup)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'WithSetupDecoratorTests' object has no attribute 'assertEquals'

======================================================================
ERROR: test_teardown_injection (nose2.tests.unit.test_decorators.WithTeardownDecoratorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/unit/test_decorators.py", line 34, in test_teardown_injection
    self.assertEquals(expected, self.fake_teardown)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'WithTeardownDecoratorTests' object has no attribute 'assertEquals'

======================================================================
FAIL: test_unittest_assertion (nose2.tests.functional.test_prettyassert.TestPrettyAsserts)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/functional/test_prettyassert.py", line 209, in test_unittest_assertion
    stderr = self.assertProcOutputPattern(proc, expected)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/functional/test_prettyassert.py", line 15, in assertProcOutputPattern
    self.assertTestRunOutputMatches(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/_common.py", line 91, in assertTestRunOutputMatches
    testf(util.safe_decode(cmd_stderr), stderr)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Regex didn't match: 'self.assertTrue\\(x\\)\nAssertionError: False is not true' not found in 'test_old_assertion (unittest_assertion.test_prettyassert_unittestassertion.TestFoo) ... FAIL

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).

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/02910322-python-nose2/

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

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.

Comment 1 Hugo van Kemenade 2021-12-28 20:11:26 UTC
The assertEquals failures have been fixed in upstream on 12th Oct -- https://github.com/nose-devs/nose2/pull/500 -- but not yet released.

The "Regex didn't match" is still there.

Comment 2 Tomáš Hrnčiar 2022-02-07 12:54:50 UTC
Removal of unittest aliases was reverted in Python 3.11 and will be part of Python 3.12, so the above failure is not present anymore. Hugo's PR will be needed next year though.

Regarding Python 3.11 test_run leads to Segmentation fault.

test_run (nose2.tests.functional.test_coverage.TestCoverage) ... /var/tmp/rpm-tmp.VsRQe4: line 42:  1663 Segmentation fault      (core dumped) PYTHONPATH=`pwd` /usr/bin/python3 -m nose2.__main__ -v
error: Bad exit status from /var/tmp/rpm-tmp.VsRQe4 (%check)

Comment 3 Tomáš Hrnčiar 2022-02-07 13:37:57 UTC
Seems like the segfault was caused by outdated build of python-coverage.

Current error is:
======================================================================
FAIL: test_unittest_assertion (nose2.tests.functional.test_prettyassert.TestPrettyAsserts)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/functional/test_prettyassert.py", line 209, in test_unittest_assertion
    stderr = self.assertProcOutputPattern(proc, expected)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/functional/test_prettyassert.py", line 15, in assertProcOutputPattern
    self.assertTestRunOutputMatches(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/_common.py", line 91, in assertTestRunOutputMatches
    testf(util.safe_decode(cmd_stderr), stderr)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Regex didn't match: 'self.assertTrue\\(x\\)\nAssertionError: False is not true' not found in 'test_old_assertion (unittest_assertion.test_prettyassert_unittestassertion.TestFoo) ... FAIL\n\n======================================================================\nFAIL: test_old_assertion (unittest_assertion.test_prettyassert_unittestassertion.TestFoo)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File "/builddir/build/BUILD/nose2-0.9.1/nose2/tests/functional/support/scenario/pretty_asserts/unittest_assertion/test_prettyassert_unittestassertion.py", line 7, in test_old_assertion\n    self.assertTrue(x)\n    ^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n'

Comment 4 Ben Cotton 2022-02-08 20:09:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 5 Tomáš Hrnčiar 2022-04-21 14:14:24 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 37.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-12-28).

A week before the mass branching of Fedora 38 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 36 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-38/f-38-key-tasks.html

Comment 6 Hugo van Kemenade 2022-05-13 20:14:17 UTC
My upstream PR has been merged: https://github.com/nose-devs/nose2/pull/519

Comment 7 Tomáš Hrnčiar 2022-05-18 06:51:47 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 37.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-12-28).

A week before the mass branching of Fedora 38 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 36 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-38/f-38-key-tasks.html