test_ok2/testing/example_scripts/unittest/test_unittest_asynctest.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
457 B
Python
Raw Normal View History

# mypy: allow-untyped-defs
"""Issue #7110"""
import asyncio
from typing import List
import asynctest
2020-10-06 09:13:05 +08:00
teardowns: List[None] = []
class Test(asynctest.TestCase):
async def tearDown(self):
teardowns.append(None)
async def test_error(self):
await asyncio.sleep(0)
self.fail("failing on purpose")
async def test_ok(self):
await asyncio.sleep(0)
def test_teardowns(self):
assert len(teardowns) == 2