代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/python-testtools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From d528842b99b16efce212e15dae3f0a54927d06d8 Mon Sep 17 00:00:00 2001
From: Cyril Roelandt <cyril@redhat.com>
Date: Fri, 19 Mar 2021 02:50:13 +0000
Subject: [PATCH] Fix tests with Python 3.10
In Python 3, error messages have become a bit more precise. For
instance, the following code snippet:
----
class Foo():
def bar(self, a):
pass
try:
Foo().bar(1, 2)
except TypeError as e:
print(e)
----
will return:
- in Python 3.9: "bar() takes 2 positional arguments but 3 were given"
- in Python 3.10: "Foo.bar() takes 2 positional arguments but 3 were
given"
Fix our tests accordingly.
---
testtools/tests/test_testsuite.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testtools/tests/test_testsuite.py b/testtools/tests/test_testsuite.py
index 7ad5b74d..65cb88d7 100644
--- a/testtools/tests/test_testsuite.py
+++ b/testtools/tests/test_testsuite.py
@@ -181,7 +181,7 @@ def run(self):
test.run(process_result)
""", doctest.ELLIPSIS))
self.assertThat(events[3][6].decode('utf8'), DocTestMatches("""\
-TypeError: run() takes ...1 ...argument...2...given...
+TypeError: ...run() takes ...1 ...argument...2...given...
""", doctest.ELLIPSIS))
events = [event[0:10] + (None,) for event in events]
events[1] = events[1][:6] + (None,) + events[1][7:]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。