Remove pytest dependency. (#2093)
This commit is contained in:
committed by
Julien Chaumond
parent
2670b0d682
commit
0cb163865a
@@ -3,18 +3,19 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import pytest
|
|
||||||
|
|
||||||
from transformers import is_tf_available
|
from transformers import is_tf_available
|
||||||
|
|
||||||
|
from .utils import require_tf
|
||||||
|
|
||||||
if is_tf_available():
|
if is_tf_available():
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
from tensorflow.python.eager import context
|
from tensorflow.python.eager import context
|
||||||
from tensorflow.python.framework import ops
|
from tensorflow.python.framework import ops
|
||||||
from transformers import (create_optimizer, GradientAccumulator)
|
from transformers import (create_optimizer, GradientAccumulator)
|
||||||
else:
|
|
||||||
pytestmark = pytest.mark.skip("Require TensorFlow")
|
|
||||||
|
|
||||||
|
|
||||||
|
@require_tf
|
||||||
class OptimizationFTest(unittest.TestCase):
|
class OptimizationFTest(unittest.TestCase):
|
||||||
def assertListAlmostEqual(self, list1, list2, tol):
|
def assertListAlmostEqual(self, list1, list2, tol):
|
||||||
self.assertEqual(len(list1), len(list2))
|
self.assertEqual(len(list1), len(list2))
|
||||||
|
|||||||
Reference in New Issue
Block a user