def test_to_gpu_unavailable(self): x = numpy.array([1]) if not cuda.available: with self.assertRaises(RuntimeError): cuda.to_gpu(x)