Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Sep 9, 2019

Remove test_main() from test_socket: use setUpModule() with
tearDownModule() and unittest.main() to discover automatically test
cases.

Reorder also imports.

https://bugs.python.org/issue38063

Remove test_main() from test_socket: use setUpModule() with
tearDownModule() and unittest.main() to discover automatically test
cases.

Reorder also imports.
@vstinner
Copy link
Member Author

vstinner commented Sep 9, 2019

I tested manually that I get the same number of test methods with and without this change:

# this PR
vstinner@apu$ ./python -m test test_socket --list-cases|wc -l
819

# without this change (reference)
vstinner@apu$ git checkout master
vstinner@apu$ ./python -m test test_socket --list-cases|wc -l
819

Copy link
Member

@zware zware left a comment

Choose a reason for hiding this comment

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

LGTM!

@vstinner
Copy link
Member Author

vstinner commented Sep 9, 2019

Oh. "./python -m test test_socket --list-cases" doesn't work as expected. On the master branch, it lists a lot of tests which are not run...

Many tests of test_socket fail with this change. I will work on a fix.

@gpshead gpshead self-requested a review September 10, 2019 15:00
@vstinner vstinner closed this Jan 30, 2020
@vstinner vstinner deleted the test_socket_discovery branch January 30, 2020 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants