From 759c931fb3b751c71a79472aa7fb831a93556df7 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Fri, 6 Dec 2024 12:38:49 +0100 Subject: [PATCH] fix test --- tests/test_meta.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_meta.py b/tests/test_meta.py index a8072b1..78784b7 100644 --- a/tests/test_meta.py +++ b/tests/test_meta.py @@ -7,6 +7,7 @@ from testutils import run_tests import rendercanvas +import pytest CODE = """ @@ -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. @@ -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)