File skip-pyright-tests.patch of Package failed_python-nptyping
Index: nptyping-2.2.0/tests/test_pyright.py
===================================================================
--- nptyping-2.2.0.orig/tests/test_pyright.py
+++ nptyping-2.2.0/tests/test_pyright.py
@@ -1,9 +1,12 @@
from functools import partial
from subprocess import PIPE, run
from typing import Tuple
-from unittest import TestCase
+import unittest
-import pyright
+try:
+ import pyright
+except ImportError:
+ pyright = None
from tests.test_helpers.temp_file import temp_file
@@ -21,8 +24,8 @@ def _check_pyright_on_code(python_code:
finally:
pyright.node.subprocess.run = run
-
-class PyrightTest(TestCase):
+@unittest.skipIf(pyright is None, "pyright not installed")
+class PyrightTest(unittest.TestCase):
def test_pyright_accepts_array_with_shape(self):
exit_code, stdout, sterr = _check_pyright_on_code(
"""