Open dvrogozh opened 2 hours ago
It turns out this is related to pytest interacting with unittest and subTest/skipTest.
If running with python3 ex1.py
(or ex0.py
) with those files with ending
if __name__ == "__main__":
unittest.main()
then subTest/skipTest
works well together ...
There are couple open issues which probably worth mentioning:
As we discussed in https://github.com/huggingface/transformers/pull/34723#issuecomment-2479470083, we spotted that tests using
with self.subTest
along withself.skipTest()
report confusing passing rates. We need to understand how we should handle this. Below is breakdown of behavior on few syntetic tests.Note:
pytest-subtest
is installed or notpytest-subtest
into environment, see https://github.com/huggingface/accelerate/blob/c0552c9012a9bae7f125e1df89cf9ee0b0d250fd/setup.py#L25pytest-subtest
at the momentpytest-subtest
in the environment at the moment (according to below breakdown this means that if first subtest is skipped other subtests won't be executed)Synthetic tests:
ex0.py
-subTest()
without skipping:ex1.py
-subTest()
with skipping:pytest-subtests
ex0.py
pytest-subtests
ex1.py
pytest-subtests
ex0.py
pytest-subtests
ex1.py
Logs:
pytest-subtests
:CC: @ydshieh @ArthurZucker