Revert "[Doctests] Refactor doctests + add CI" (#23245)

Revert "[Doctests] Refactor doctests + add CI (#22987)"

This reverts commit 627f44799a.
This commit is contained in:
Sylvain Gugger
2023-05-09 15:26:15 -04:00
committed by GitHub
parent a0c0a78233
commit 69ee46243c
10 changed files with 178 additions and 287 deletions

View File

@@ -20,10 +20,6 @@ import sys
import warnings
from os.path import abspath, dirname, join
import _pytest
from transformers.utils.doctest_utils import HfDoctestModule, HfDocTestParser
# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
@@ -42,7 +38,9 @@ def pytest_configure(config):
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_pipeline_test: mark test to run only when pipelines are tested")
config.addinivalue_line(
"markers", "is_pipeline_test: mark test to run only when pipelines are tested"
)
config.addinivalue_line("markers", "is_staging_test: mark test to run only in the staging environment")
config.addinivalue_line("markers", "accelerate_tests: mark test that require accelerate")
@@ -68,7 +66,7 @@ def pytest_sessionfinish(session, exitstatus):
# Doctest custom flag to ignore output.
IGNORE_RESULT = doctest.register_optionflag("IGNORE_RESULT")
IGNORE_RESULT = doctest.register_optionflag('IGNORE_RESULT')
OutputChecker = doctest.OutputChecker
@@ -81,5 +79,3 @@ class CustomOutputChecker(OutputChecker):
doctest.OutputChecker = CustomOutputChecker
_pytest.doctest.DoctestModule = HfDoctestModule
doctest.DocTestParser = HfDocTestParser