Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Dec 6, 2024
1 parent 664ba5b commit 759c931
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from testutils import run_tests

import rendercanvas
import pytest


CODE = """
Expand Down Expand Up @@ -72,15 +73,14 @@ def test_namespace():
assert "Scheduler" not in dir(rendercanvas)


@pytest.mark.skipif(sys.version_info < (3, 10), reason="Need py310+")
def test_deps_plain_import():
modules = get_loaded_modules("rendercanvas", 1)
assert modules == {"rendercanvas", "sniffio"}


@pytest.mark.skipif(sys.version_info < (3, 10), reason="Need py310+")
def test_deps_asyncio():
if sys.version_info < (3, 10):
return # skip because stdlib_module_names is not available

# I like it that asyncio is only imported when actually being used.
# Since its the default loop for some backends, it must lazy-import.
# We can do this safely because asyncio is std.
Expand All @@ -92,6 +92,7 @@ def test_deps_asyncio():
assert "asyncio" in modules


@pytest.mark.skipif(sys.version_info < (3, 10), reason="Need py310+")
def test_deps_trio():
# For trio, I like that if the trio module is loaded, trio is imported, fail early.
modules = get_loaded_modules("rendercanvas.trio", 1)
Expand Down

0 comments on commit 759c931

Please sign in to comment.