Skip to content

Commit 91dec2f

Browse files
ydshiehvijayabhaskar-ev
authored andcommitted
Make debugging failing tests (check and update expect output values) easier 🔥 (huggingface#40727)
* fix * fix --------- Co-authored-by: ydshieh <[email protected]>
1 parent 999d236 commit 91dec2f

File tree

2 files changed

+697
-0
lines changed

2 files changed

+697
-0
lines changed

conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# by pytest before any tests are run
1717

1818
import doctest
19+
import os
1920
import sys
2021
import warnings
2122
from os.path import abspath, dirname, join
@@ -27,6 +28,7 @@
2728
HfDoctestModule,
2829
HfDocTestParser,
2930
is_torch_available,
31+
patch_testing_methods_to_collect_info,
3032
patch_torch_compile_force_graph,
3133
)
3234

@@ -145,3 +147,8 @@ def check_output(self, want, got, optionflags):
145147
# patch `torch.compile`: if `TORCH_COMPILE_FORCE_FULLGRAPH=1` (or values considered as true, e.g. yes, y, etc.),
146148
# the patched version will always run with `fullgraph=True`.
147149
patch_torch_compile_force_graph()
150+
151+
152+
153+
if os.environ.get("PATCH_TESTING_METHODS_TO_COLLECT_OUTPUTS", "").lower() in ("yes", "true", "on", "y", "1"):
154+
patch_testing_methods_to_collect_info()

0 commit comments

Comments
 (0)