From: Daniele Varrazzo Date: Fri, 16 Dec 2022 15:36:45 +0000 (+0000) Subject: test(numpy): fix skipping tests if numpy module is not installed X-Git-Tag: pool-3.2.0~70^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a48098ea82a9ca86e7d75a7c58f3a69c80286df;p=thirdparty%2Fpsycopg.git test(numpy): fix skipping tests if numpy module is not installed --- diff --git a/tests/types/test_numpy.py b/tests/types/test_numpy.py index 5fc8bf7e5..bf2558465 100644 --- a/tests/types/test_numpy.py +++ b/tests/types/test_numpy.py @@ -1,11 +1,12 @@ import pytest from psycopg.adapt import PyFormat -pytest.importorskip("numpy") - - -import numpy as np # noqa: E402 +try: + import numpy as np +except ImportError: + pass +pytest.importorskip("numpy") pytestmark = [pytest.mark.numpy]