提交 e80e9441 编写于 作者: B Ben Darnell

test: Fix circlerefs test on python 3.10 and before

Local/attribute dicts are reported a bit differently here.
上级 1d5fc980
......@@ -125,9 +125,14 @@ class CircleRefsTest(unittest.TestCase):
b.c = c
del a, b
self.assertIn("Circular", str(cm.exception))
self.assertIn("name=a", str(cm.exception))
self.assertIn("name=b", str(cm.exception))
self.assertNotIn("name=c", str(cm.exception))
# Leading spaces ensure we only catch these at the beginning of a line, meaning they are a
# cycle participant and not simply the contents of a locals dict or similar container. (This
# depends on the formatting above which isn't ideal but this test evolved from a
# command-line script) Note that the behavior here changed in python 3.11; in newer pythons
# locals are handled a bit differently and the test passes without the spaces.
self.assertIn(" name=a", str(cm.exception))
self.assertIn(" name=b", str(cm.exception))
self.assertNotIn(" name=c", str(cm.exception))
async def run_handler(self, handler_class):
app = web.Application(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册