Skip to content

Commit c3344ba

Browse files
committed
Merge remote-tracking branch 'origin/running_event' into running_event
2 parents 82caf4c + 43cbe13 commit c3344ba

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

tests/test_circular_imports.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Test to check for circular imports."""
2+
3+
import asyncio
4+
import sys
5+
6+
import pytest
7+
8+
9+
@pytest.mark.asyncio
10+
@pytest.mark.timeout(30) # cloud can take > 9s
11+
@pytest.mark.parametrize(
12+
"module",
13+
[
14+
"zeroconf",
15+
"zeroconf.asyncio",
16+
"zeroconf._protocol.incoming",
17+
"zeroconf._protocol.outgoing",
18+
"zeroconf.const",
19+
"zeroconf._logger",
20+
"zeroconf._transport",
21+
"zeroconf._record_update",
22+
"zeroconf._services.browser",
23+
"zeroconf._services.info",
24+
],
25+
)
26+
async def test_circular_imports(module: str) -> None:
27+
"""Check that components can be imported without circular imports."""
28+
process = await asyncio.create_subprocess_exec(sys.executable, "-c", f"import {module}")
29+
await process.communicate()
30+
assert process.returncode == 0

0 commit comments

Comments
 (0)