Skip to content

Commit 886a2d3

Browse files
committed
Add an error message _pyawaitable_test can't be imported.
1 parent ca703c0 commit 886a2d3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import unittest
2-
import _pyawaitable_test
32
import asyncio
43
from typing import Any, Callable
54
from collections.abc import Awaitable, Coroutine
65
import inspect
76

7+
NOT_FOUND = """
8+
The PyAwaitable test package wasn't built!
9+
Please install it with `pip install ./tests`
10+
"""
11+
try:
12+
import _pyawaitable_test
13+
except ImportError as err:
14+
raise RuntimeError(NOT_FOUND) from err
815

916
class PyAwaitableTests(unittest.TestCase):
1017
def test_awaitable_semantics(self):

0 commit comments

Comments
 (0)