From 900a9c47be2f0a67930f8d59fb8cd72b48d3bf6d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 2 Feb 2024 11:24:31 +0100 Subject: [PATCH] gst-python: Fix unit test for python >= 3.12 unittest.TestCase.assertEquals was marked deprecated since 3.0 and was finally removed in 3.12 Part-of: --- subprojects/gst-python/testsuite/test_gst.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-python/testsuite/test_gst.py b/subprojects/gst-python/testsuite/test_gst.py index e7884890cd..2111b9688c 100644 --- a/subprojects/gst-python/testsuite/test_gst.py +++ b/subprojects/gst-python/testsuite/test_gst.py @@ -21,9 +21,9 @@ import sys import overrides_hack overrides_hack from common import TestCase, unittest - from gi.repository import Gst + class TimeArgsTest(TestCase): def testNoneTime(self): self.assertRaises(TypeError, Gst.TIME_ARGS, None) @@ -32,10 +32,11 @@ class TimeArgsTest(TestCase): self.assertRaises(TypeError, Gst.TIME_ARGS, "String") def testClockTimeNone(self): - self.assertEquals(Gst.TIME_ARGS(Gst.CLOCK_TIME_NONE), 'CLOCK_TIME_NONE') + self.assertEqual(Gst.TIME_ARGS(Gst.CLOCK_TIME_NONE), 'CLOCK_TIME_NONE') def testOneSecond(self): - self.assertEquals(Gst.TIME_ARGS(Gst.SECOND), '0:00:01.000000000') + self.assertEqual(Gst.TIME_ARGS(Gst.SECOND), '0:00:01.000000000') + class TestNotInitialized(TestCase): def testNotInitialized(self): @@ -93,6 +94,7 @@ class TestBin(TestCase): Gst.init(None) self.assertEqual(Gst.ElementFactory.make("bin", None).sinkpads, []) + class TestBufferMap(TestCase): def test_map_unmap_manual(self): @@ -112,5 +114,6 @@ class TestBufferMap(TestCase): with self.assertRaises(ValueError): info.data[0] + if __name__ == "__main__": unittest.main()