# HG changeset patch # User John Rouillard # Date 1773846663 14400 # Node ID 67ed90055e476f0f0a8016f2f1d363e13423d512 # Parent bedf11bc0dd5f715c8c063f5acfe9adaf3696170 test: handle failing email signature removal test differently The comment for the test is: # This fails because the sig isn't removed (we currently remove the # sig only if the delimiter is the first line in a section) Originally the test was decorated so it didn't run at all and reported PASSED. The decorator also returned the value 0. This caused a deprecation warning: test/test_mailgw.py::MailgwTestCase::testEmailQuotingRemove3 /usr/lib/python3.12/unittest/case.py:690: DeprecationWarning: It is deprecated to return a value that is not None from a test case [...] Better to handle it using pytest xfail so if we start stripping the signature we get a failure. This does mean the tests get an xfail registered, but I am ok with that. I added "OK" to the reason to indicate it was expected. diff -r bedf11bc0dd5 -r 67ed90055e47 test/test_mailgw.py --- a/test/test_mailgw.py Wed Mar 18 10:55:17 2026 -0400 +++ b/test/test_mailgw.py Wed Mar 18 11:11:03 2026 -0400 @@ -60,12 +60,6 @@ from roundup.test import memorydb from .cmp_helper import StringFragmentCmpHelper -def expectedFailure(method): - """ For marking a failing test. - This will *not* run the test and return success instead. - """ - return lambda x: 0 - def get_body(message): if not message.is_multipart(): @@ -3706,7 +3700,7 @@ # This fails because the sig isn't removed (we currently remove the # sig only if the delimiter is the first line in a section) - @expectedFailure + @pytest.mark.xfail(reason="OK: sig not removed - delim not first section line") def testEmailQuotingRemove3(self): self.instance.config.EMAIL_KEEP_QUOTED_TEXT = 'yes' self.innerTestQuoting(self.thirdquotingtest,