Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_plain_unittest_does_not_support_async on pypy3 #7625

Merged
merged 1 commit into from Aug 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions testing/test_unittest.py
@@ -1,4 +1,5 @@
import gc
import sys
from typing import List

import pytest
Expand Down Expand Up @@ -1253,6 +1254,14 @@ def test_plain_unittest_does_not_support_async(testdir):
"""
testdir.copy_example("unittest/test_unittest_plain_async.py")
result = testdir.runpytest_subprocess()
result.stdout.fnmatch_lines(
["*RuntimeWarning: coroutine * was never awaited", "*1 passed*"]
)
if hasattr(sys, "pypy_version_info"):
# in PyPy we can't reliable get the warning about the coroutine not being awaited,
# because it depends on the coroutine being garbage collected; given that
# we are running in a subprocess, that's difficult to enforce
expected_lines = ["*1 passed*"]
else:
expected_lines = [
"*RuntimeWarning: coroutine * was never awaited",
"*1 passed*",
]
result.stdout.fnmatch_lines(expected_lines)