import pickle
import unittest

try:
    from cupy.cuda import cutensor
    cutensor_available = True
except Exception:
    cutensor_available = False


@unittest.skipUnless(cutensor_available, 'cuTensor is unavailable')
class TestExceptionPicklable(unittest.TestCase):

    def test(self):
        e1 = cutensor.CuTensorError(1)
        e2 = pickle.loads(pickle.dumps(e1))
        assert e1.args == e2.args
        assert str(e1) == str(e2)

@@ -28,17 +28,8 @@
 st%0A%0A
-try:%0A    
 from
@@ -59,87 +59,8 @@
 sor%0A
-    cutensor_available = True%0Aexcept Exception:%0A    cutensor_available = False%0A
 %0A%0A@u
@@ -90,9 +90,9 @@
 nsor
-_
+.
 avai

fix cutensor test to use available flag