summaryrefslogtreecommitdiff
path: root/test/run_test.py
diff options
context:
space:
mode:
authorPeter Goldsborough <peter@goldsborough.me>2018-04-10 14:50:24 -0700
committerGitHub <noreply@github.com>2018-04-10 14:50:24 -0700
commit6f10978e7b174b8085265422f4024fd6ce8ab93e (patch)
tree371edd7745fc0f532f5ed323f345972897ec5f86 /test/run_test.py
parent432425c76bb8228a2a8720bb1f07a8125538b53b (diff)
downloadpytorch-6f10978e7b174b8085265422f4024fd6ce8ab93e.tar.gz
pytorch-6f10978e7b174b8085265422f4024fd6ce8ab93e.tar.bz2
pytorch-6f10978e7b174b8085265422f4024fd6ce8ab93e.zip
Skip C++ extensions test when ninja is not available (#6480)
Diffstat (limited to 'test/run_test.py')
-rw-r--r--test/run_test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/run_test.py b/test/run_test.py
index cd92ea0e07..d1747b83d0 100644
--- a/test/run_test.py
+++ b/test/run_test.py
@@ -12,6 +12,7 @@ import sys
import tempfile
import torch
+from torch.utils import cpp_extension
TESTS = [
'autograd',
@@ -76,6 +77,13 @@ def run_test(python, test_module, test_directory, options):
def test_cpp_extensions(python, test_module, test_directory, options):
+ try:
+ cpp_extension.verify_ninja_availability()
+ except RuntimeError:
+ print(
+ 'Ninja is not available. Skipping C++ extensions test. '
+ "Install ninja with 'pip install ninja' or 'conda install ninja'.")
+ return 0
return_code = shell('{} setup.py install --root ./install'.format(python),
os.path.join(test_directory, 'cpp_extensions'))
if return_code != 0: