[issue45042] Many multiprocessing tests are silently skipped since 3.9

Serhiy Storchaka report at bugs.python.org
Mon Aug 30 09:13:37 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Thank you Nikita.

The difference between the original and the proposed in PR 28060 code is that in the original code the conditional was tested at the testing time, while in the proposed code it is tested at the loading time. I do not know what effect  it causes on tests. If it does not matter, the code can be simpler:

   return unittest.skipIf(should_be_skipped,
                          f"hash digest '{digestname}' is not available.")

But if it matters, there are two options:

1. In requires_hashdigest() raise exception if func is a class. Remove the decorator from classes and add it to test and setup methods or just to the setUpClass() classmethod.

2. In requires_hashdigest() check if func is a class, and if it is true, patch its test and setup methods (or just add a decorated setUpClass() classmethod).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45042>
_______________________________________


More information about the Python-bugs-list mailing list