Update `gen_test` tests to be more robust
@@ -152,20 +152,35 @@ async def test_gen_cluster_tls(e, s, a, b):
assert s.nthreads == {w.address: w.nthreads for w in [a, b]}
+@pytest.mark.xfail(
+ reason="Test should always fail to ensure the body of the test function was run",
+ strict=True,
+)
@gen_test()
async def test_gen_test():
await asyncio.sleep(0.01)
+ assert False
+@pytest.mark.xfail(
+ reason="Test should always fail to ensure the body of the test function was run",
+ strict=True,
+)
@gen_test()
def test_gen_test_legacy_implicit():
yield asyncio.sleep(0.01)
+ assert False
+@pytest.mark.xfail(
+ reason="Test should always fail to ensure the body of the test function was run",
+ strict=True,
+)
@gen_test()
@gen.coroutine
def test_gen_test_legacy_explicit():
yield asyncio.sleep(0.01)
+ assert False
@contextmanager
