File: tests-s-assertEquals-assertEqual.patch

package info (click to toggle)
accountsservice 23.13.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,244 kB
  • sloc: ansic: 8,575; python: 1,435; xml: 1,263; sh: 119; makefile: 22; sed: 16
file content (45 lines) | stat: -rw-r--r-- 1,839 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 28 Sep 2023 09:29:07 -0400
Subject: tests: s/assertEquals/assertEqual/
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

CI is currently failing with:

Traceback (most recent call last):
  File "/home/user/accountsservice/_build/../tests/test-libaccountsservice.py", line 118, in test_multiple_inflight_get_user_by_id_calls
    self.assertEquals(user.get_user_name(), 'pizza')
    ^^^^^^^^^^^^^^^^^
AttributeError: 'TestAccountsServicePreExistingUser' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

I have no idea if assertEquals was dropped, or if CI has been failing
all this time or what.

This commit makes the suggested change.

[assertEquals was dropped in Python 3.12, as documented in
https://docs.python.org/3/whatsnew/3.12.html#unittest-testcase-removed-aliases
—smcv]

Origin: upstream, 23.13.10, commit:ad0365b77b583da06bcd1e8da4c1bed74129895a
Bug-Debian: https://bugs.debian.org/1074657
---
 tests/test-libaccountsservice.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-libaccountsservice.py b/tests/test-libaccountsservice.py
index 723ab51..69b9083 100644
--- a/tests/test-libaccountsservice.py
+++ b/tests/test-libaccountsservice.py
@@ -115,8 +115,8 @@ class TestAccountsServicePreExistingUser(AccountsServiceTestBase):
             self.assertTrue(user_objects[instance].is_loaded())
 
         for user in user_objects:
-            self.assertEquals(user.get_user_name(), 'pizza')
-            self.assertEquals(user.get_uid(), 2001)
+            self.assertEqual(user.get_user_name(), 'pizza')
+            self.assertEqual(user.get_uid(), 2001)
 
 @unittest.skipUnless(have_accounts_service,
                      'AccountsService gi introspection not available')