|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import sys |
|
import warnings |
|
from os.path import abspath, dirname, join |
|
|
|
|
|
|
|
|
|
git_repo_path = abspath(join(dirname(dirname(__file__)), "src")) |
|
sys.path.insert(1, git_repo_path) |
|
|
|
|
|
|
|
warnings.simplefilter(action="ignore", category=FutureWarning) |
|
|
|
|
|
def pytest_configure(config): |
|
config.addinivalue_line("markers", "is_pipeline_test: mark test to run only when pipeline are tested") |
|
config.addinivalue_line( |
|
"markers", "is_pt_tf_cross_test: mark test to run only when PT and TF interactions are tested" |
|
) |
|
config.addinivalue_line( |
|
"markers", "is_pt_flax_cross_test: mark test to run only when PT and FLAX interactions are tested" |
|
) |
|
config.addinivalue_line("markers", "is_staging_test: mark test to run only in the staging environment") |
|
|
|
|
|
def pytest_addoption(parser): |
|
from transformers.testing_utils import pytest_addoption_shared |
|
|
|
pytest_addoption_shared(parser) |
|
|
|
|
|
def pytest_terminal_summary(terminalreporter): |
|
from transformers.testing_utils import pytest_terminal_summary_main |
|
|
|
make_reports = terminalreporter.config.getoption("--make-reports") |
|
if make_reports: |
|
pytest_terminal_summary_main(terminalreporter, id=make_reports) |
|
|