bpo-32663 Make SMTPUTF8SimTests run#5314
Conversation
The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because they were never added to test_main. Additionally, one of the tests needed to be in the non-UTF8 server class because it relied on the server not being UTF-8 compatible.
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
Lib/test/test_smtplib.py
Outdated
| SMTPAUTHInitialResponseSimTests, | ||
| SMTPSimTests, | ||
| TooLongLineTests, | ||
| SMTPUTF8SimTests, |
There was a problem hiding this comment.
Rather than add to this list, let's modernize this test file. It doesn't do anything special in test_main, so we can just delete test_main and make the if __name__ == '__main__' clause call unittest.main(), and regrtest/unittest will find all the tests.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Updating __main__ to call unittest.main() as per bitdancer's request
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @bitdancer: please review the changes made to this pull request. |
|
I am not sure but your test seems to be similar to mine, https://github.com/python/cpython/blob/master/Lib/test/test_smtplib.py#L1077 ? @bitdancer do you confirm? |
|
@matrixise I don't think that your test was in there when I wrote this PR, but the test isn't mine, I copied it from here: https://github.com/python/cpython/blob/master/Lib/test/test_smtplib.py#L1221 The problem is that once you actually enable that test to be run, it fails since it relies on UTF8 NOT being enabled. This change just moves it up to the proper class. The test I moved doesn't seem very related to your test, as it is testing to see if smtplib will properly raise an exception when using a UTF8 email address on a server not configured for it. |
|
@bitdancer: Please replace |
|
Thanks @chason for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
|
Thanks @chason for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-8470 is a backport of this pull request to the 3.6 branch. |
Enable and fix SMTPUTF8SimTests in test_smtplib. The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because test_smtplib was still using the 'test_main' pattern, and the class was never added to test_main. Additionally, one of the tests needed to be moved to the non-UTF8 server class because it relies on the server not being UTF-8 compatible (and it had a bug in in). (cherry picked from commit 48ed88a) Co-authored-by: chason <chason@gmail.com>
Enable and fix SMTPUTF8SimTests in test_smtplib. The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because test_smtplib was still using the 'test_main' pattern, and the class was never added to test_main. Additionally, one of the tests needed to be moved to the non-UTF8 server class because it relies on the server not being UTF-8 compatible (and it had a bug in in). (cherry picked from commit 48ed88a) Co-authored-by: chason <chason@gmail.com>
|
GH-8471 is a backport of this pull request to the 3.7 branch. |
Enable and fix SMTPUTF8SimTests in test_smtplib. The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because test_smtplib was still using the 'test_main' pattern, and the class was never added to test_main. Additionally, one of the tests needed to be moved to the non-UTF8 server class because it relies on the server not being UTF-8 compatible (and it had a bug in in). (cherry picked from commit 48ed88a) Co-authored-by: chason <chason@gmail.com>
Enable and fix SMTPUTF8SimTests in test_smtplib. The tests for SMTPUTF8SimTests in test_smtplib.py were not actually being run because test_smtplib was still using the 'test_main' pattern, and the class was never added to test_main. Additionally, one of the tests needed to be moved to the non-UTF8 server class because it relies on the server not being UTF-8 compatible (and it had a bug in in). (cherry picked from commit 48ed88a) Co-authored-by: chason <chason@gmail.com>
The tests for SMTPUTF8SimTests in test_smtplib.py were not actually
being run because they were never added to test_main. Additionally, one
of the tests needed to be in the non-UTF8 server class because it relied
on the server not being UTF-8 compatible.
https://bugs.python.org/issue32663