[Test refactor 1/5] Per-folder tests reorganization (#15725)

* Per-folder tests reorganization

Co-authored-by: sgugger <sylvain.gugger@gmail.com>
Co-authored-by: Stas Bekman <stas@stason.org>
This commit is contained in:
Lysandre Debut
2022-02-23 15:46:28 -05:00
committed by GitHub
parent fecb08c2b8
commit 29c10a41d0
438 changed files with 636 additions and 565 deletions

View File

@@ -27,7 +27,6 @@ from transformers.testing_utils import (
CaptureLogger,
CaptureStd,
CaptureStderr,
ExtendSysPath,
LoggingLevel,
TestCasePlus,
execute_subprocess_async,
@@ -40,14 +39,11 @@ from transformers.testing_utils import (
)
from transformers.trainer_utils import get_last_checkpoint, set_seed
from ..trainer.test_trainer import TrainerIntegrationCommon # noqa
tests_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
root_dir = os.path.dirname(tests_dir)
with ExtendSysPath(tests_dir):
from test_trainer import TrainerIntegrationCommon # noqa
if is_torch_available():
from test_trainer import RegressionModelConfig, RegressionPreTrainedModel, get_regression_trainer # noqa
if is_torch_available():
from ..trainer.test_trainer import RegressionModelConfig, RegressionPreTrainedModel, get_regression_trainer # noqa
set_seed(42)