File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments