Bug 2155245

Summary: python-pysrt fails to build with Python 3.12: AttributeError: 'TestSerialAndParsing' object has no attribute 'assertEquals'.
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-pysrtAssignee: Juan Orti Alcaine <jorti>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jorti, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pysrt-1.1.2-12.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-11 15:12:37 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: 2135404    

Description Tomáš Hrnčiar 2022-12-20 13:54:01 UTC
python-pysrt fails to build with Python 3.12.0a3.

======================================================================
ERROR: test_junk_after_timestamp (tests.test_srtitem.TestSerialAndParsing.test_junk_after_timestamp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtitem.py", line 210, in test_junk_after_timestamp
    self.assertEquals(item, self.item)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestSerialAndParsing' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: test_no_index (tests.test_srtitem.TestSerialAndParsing.test_no_index)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtitem.py", line 205, in test_no_index
    self.assertEquals(item.index, None)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestSerialAndParsing' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: test_string_index (tests.test_srtitem.TestSerialAndParsing.test_string_index)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtitem.py", line 200, in test_string_index
    self.assertEquals(item.index, 'foo')
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestSerialAndParsing' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: test_missing_indexes (tests.test_srtfile.TestIntegration.test_missing_indexes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtfile.py", line 254, in test_missing_indexes
    self.assertEquals(len(items), 7)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestIntegration' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: test_at (tests.test_srtfile.TestSlice.test_at)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtfile.py", line 120, in test_at
    self.assertEquals(len(self.file.at((0, 0, 31, 0))), 1)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestSlice' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: test_multiple_item (tests.test_srtfile.TestText.test_multiple_item)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtfile.py", line 147, in test_multiple_item
    self.assertEquals(srt_file.text, 'Hello\nWorld !')
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestText' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

======================================================================
ERROR: test_single_item (tests.test_srtfile.TestText.test_single_item)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pysrt-1.1.2/tests/test_srtfile.py", line 140, in test_single_item
    self.assertEquals(srt_file.text, 'Hello')
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestText' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?


Removed many old deprecated unittest features:

    - A number of TestCase method aliases:

    | Deprecated alias      |  Method Name           | Deprecated in |
    +-----------------------|------------------------|---------------+
    | failUnless            | assertTrue()           |      3.1      |
    | failIf                | assertFalse()          |      3.1      |
    | failUnlessEqual       | assertEqual()          |      3.1      |
    | failIfEqual           | assertNotEqual()       |      3.1      |
    | failUnlessAlmostEqual | assertAlmostEqual()    |      3.1      |
    | failIfAlmostEqual     | assertNotAlmostEqual() |      3.1      |
    | failUnlessRaises      | assertRaises()         |      3.1      |
    | assert_               | assertTrue()           |      3.2      |
    | assertEquals          | assertEqual()          |      3.2      |
    | assertNotEquals       | assertNotEqual()       |      3.2      |
    | assertAlmostEquals    | assertAlmostEqual()    |      3.2      |
    | assertNotAlmostEquals | assertNotAlmostEqual() |      3.2      |
    | assertRegexpMatches   | assertRegex()          |      3.2      |
    | assertRaisesRegexp    | assertRaisesRegex()    |      3.2      |
    | assertNotRegexpMatches| assertNotRegex()       |      3.5      |
    +-----------------------|------------------------|---------------+

    You can use https://github.com/isidentical/teyit to automatically modernise your unit tests.

    - Undocumented and broken TestCase method assertDictContainsSubset (deprecated in Python 3.2).

    - Undocumented 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/issue?@action=redirect&bpo=45162



https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05129602-python-pysrt/

For all our attempts to build python-pysrt with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-pysrt/

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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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.