[Python-checkins] bpo-37953: Fix deprecation warnings in test_typing (GH-16133)
Miss Islington (bot)
webhook-mailer at python.org
Sat Sep 14 04:02:23 EDT 2019
https://github.com/python/cpython/commit/66da347ef0034ad9bddc7fad112025c886249f0d
commit: 66da347ef0034ad9bddc7fad112025c886249f0d
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-09-14T01:02:19-07:00
summary:
bpo-37953: Fix deprecation warnings in test_typing (GH-16133)
self.assertEquals() is deprecated.
```
./python -We -m test test_typing
Run tests sequentially
0:00:00 load avg: 0.23 [1/1] test_typing
test test_typing failed -- Traceback (most recent call last):
File "/home/lubuntu2/cpython/Lib/test/test_typing.py", line 2382, in test_forward_equality_gth
self.assertEquals(Union[c1, c1_gth], Union[c1])
File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 1390, in deprecated_func
warnings.warn(
DeprecationWarning: Please use assertEqual instead.
test_typing failed
== Tests result: FAILURE ==
1 test failed:
test_typing
Total duration: 140 ms
Tests result: FAILURE
```
https://bugs.python.org/issue37953
(cherry picked from commit d057b896f97e6d7447b9bf9246770c41cf205299)
Co-authored-by: Zackery Spytz <zspytz at gmail.com>
files:
M Lib/test/test_typing.py
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 28b3d316d350..59b1b4e6d548 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -2379,8 +2379,8 @@ def foo(a: c1_gth, b: c2_gth):
self.assertEqual(List[c1], List[c1_gth])
self.assertNotEqual(List[c1], List[C])
self.assertNotEqual(List[c1_gth], List[C])
- self.assertEquals(Union[c1, c1_gth], Union[c1])
- self.assertEquals(Union[c1, c1_gth, int], Union[c1, int])
+ self.assertEqual(Union[c1, c1_gth], Union[c1])
+ self.assertEqual(Union[c1, c1_gth, int], Union[c1, int])
def test_forward_equality_hash(self):
c1 = typing.ForwardRef('int')
More information about the Python-checkins
mailing list