From eaa6b9afc637d9f2d7ebeb1a89fab2eba4d6c477 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Tue, 14 Jan 2020 16:31:39 -0500 Subject: [PATCH] Require Torch when testing examples --- tests/test_examples.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_examples.py b/tests/test_examples.py index ee0167b552..f8a204e800 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -15,6 +15,7 @@ import os import unittest +from .utils import require_torch def get_examples_from_file(file): @@ -40,6 +41,7 @@ def get_examples_from_file(file): return ['\n'.join(example) for example in examples] +@require_torch class TestCodeExamples(unittest.TestCase): def test_configuration_examples(self): transformers_directory = "../src/transformers"