This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients davin, pitrou, serhiy.storchaka, sobolevn, vstinner
Date 2021-08-30.13:13:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630329217.58.0.507735354628.issue45042@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2021-08-30 13:13:37serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner, davin, sobolevn
2021-08-30 13:13:37serhiy.storchakasetmessageid: <1630329217.58.0.507735354628.issue45042@roundup.psfhosted.org>
2021-08-30 13:13:37serhiy.storchakalinkissue45042 messages
2021-08-30 13:13:37serhiy.storchakacreate