mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-22 22:09:23 +06:00
Modify warnings
in a with
block to avoid flaky tests (#31893)
* fix * [test_all] check before merge --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
parent
ec03d97b27
commit
080e14b24c
@ -218,6 +218,7 @@ class TrainerCallbackTest(unittest.TestCase):
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
# XXX: for now ignore scatter_gather warnings in this test since it's not relevant to what's being tested
|
# XXX: for now ignore scatter_gather warnings in this test since it's not relevant to what's being tested
|
||||||
|
with warnings.catch_warnings():
|
||||||
warnings.simplefilter(action="ignore", category=UserWarning)
|
warnings.simplefilter(action="ignore", category=UserWarning)
|
||||||
|
|
||||||
trainer = self.get_trainer(callbacks=[MyTestTrainerCallback])
|
trainer = self.get_trainer(callbacks=[MyTestTrainerCallback])
|
||||||
|
Loading…
Reference in New Issue
Block a user