Skip to content

Conversation

@chason
Copy link
Contributor

@chason chason commented Jan 25, 2018

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

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.
@chason chason requested a review from a team as a code owner January 25, 2018 09:08
@the-knights-who-say-ni
Copy link

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!

SMTPAUTHInitialResponseSimTests,
SMTPSimTests,
TooLongLineTests,
SMTPUTF8SimTests,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Updating __main__ to call unittest.main() as per bitdancer's request
@chason
Copy link
Contributor Author

chason commented Jan 26, 2018

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@bitdancer: please review the changes made to this pull request.

@matrixise
Copy link
Member

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?

@chason
Copy link
Contributor Author

chason commented Feb 6, 2018

@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 bitdancer merged commit 48ed88a into python:master Jul 25, 2018
@bedevere-bot
Copy link

@bitdancer: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @chason for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @chason for the PR, and @bitdancer for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-8470 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 25, 2018
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 <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 25, 2018
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 <[email protected]>
@bedevere-bot
Copy link

GH-8471 is a backport of this pull request to the 3.7 branch.

bitdancer pushed a commit that referenced this pull request Jul 26, 2018
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 <[email protected]>
bitdancer pushed a commit that referenced this pull request Jul 26, 2018
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants