add tests for version functions
@@ -16,11 +16,19 @@ class TestCheckVersion(unittest.TestCase):
@pytest.mark.gpu
def test_check_cuda_version(self):
+ with self.assertRaises(Exception):
+ build.get_cuda_version()
self.assertTrue(build.check_cuda_version(
self.compiler, self.settings))
+ self.assertIsInstance(build.get_cuda_version(), int)
+ self.assertIsInstance(build.get_cuda_version(True), str)
@pytest.mark.gpu
@pytest.mark.cudnn
def test_check_cudnn_version(self):
+ with self.assertRaises(Exception):
+ build.get_cudnn_version()
self.assertTrue(build.check_cudnn_version(
self.compiler, self.settings))
+ self.assertIsInstance(build.get_cudnn_version(), int)
+ self.assertIsInstance(build.get_cudnn_version(True), str)
