-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to make sure we don't import aiohttp
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright Modal Labs 2024 | ||
import subprocess | ||
import sys | ||
|
||
|
||
def test_slow_dependencies_local(supports_dir): | ||
# Make sure that "import modal" doesn't load some big dependencies like aiohttp | ||
subprocess.check_output([sys.executable, supports_dir / "slow_dependencies_local.py"]) | ||
|
||
|
||
def test_slow_dependencies_container(supports_dir): | ||
# Make sure that "import modal._container_entrypoint" doesn't load some big dependencies like aiohttp | ||
subprocess.check_output([sys.executable, supports_dir / "slow_dependencies_container.py"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright Modal Labs 2024 | ||
import sys | ||
|
||
import modal # noqa | ||
|
||
assert "modal" in sys.modules | ||
|
||
# This is a very heavy dependency that takes about 70-80ms to import | ||
# Let's make sure it doesn't get imported in global scope | ||
assert "aiohttp" not in sys.modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright Modal Labs 2024 | ||
import sys | ||
|
||
import modal # noqa | ||
|
||
assert "modal" in sys.modules | ||
|
||
# This is a very heavy dependency that takes about 70-80ms to import | ||
# Let's make sure it doesn't get imported in global scope | ||
assert "aiohttp" not in sys.modules |