Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-46198: rename duplicate tests and remove unused code #30297

Merged
merged 3 commits into from
Mar 10, 2022

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Dec 30, 2021

Right now, two tests have the same name:

  1. def test_get_unstructured_invalid_ew(self):
  2. def test_get_unstructured_invalid_ew(self):

The first one is always skipped.
I think that NEWS should not be added.

https://bugs.python.org/issue46198

@sobolevn
Copy link
Member Author

test_asyncio is still failing sometimes on Windows 🤔

@sobolevn sobolevn closed this Dec 30, 2021
@sobolevn sobolevn reopened this Dec 30, 2021
@sobolevn sobolevn closed this Dec 30, 2021
@sobolevn sobolevn reopened this Dec 30, 2021
@AlexWaygood AlexWaygood added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Dec 30, 2021
@sobolevn
Copy link
Member Author

sobolevn commented Jan 1, 2022

I am addressing feedback from https://bugs.python.org/issue46198, so I am increasing the scope of this PR to also include other similar cases. I am using flake8 with --select=F811 to find duplicates.

Amount of tests:

  • test_enum: 232 -> 236
  • test__header_value_parser.py: 1659 -> 1660
  • test_dict: 108 -> 109
  • test_compile: 101 -> 102
  • test_typing: 407 -> 408

@AlexWaygood
Copy link
Member

Title of the PR needs to change!

@sobolevn sobolevn changed the title bpo-46198: unskip one test in test_email bpo-46198: rename duplicate tests and remove unused code Jan 1, 2022
Lib/test/test_enum.py Outdated Show resolved Hide resolved
Lib/test/test_enum.py Outdated Show resolved Hide resolved
@sobolevn
Copy link
Member Author

Rebased to solve merge conflicts in test_enum (it is going through a major refactoring).

@sobolevn
Copy link
Member Author

Rebased to solve conflicts in test_typing.

@merwok
Copy link
Member

merwok commented Jan 26, 2022

In general, please do merges for CPython rather than rebases and force pushes: https://devguide.python.org/pullrequest/
The reviewing experience on github is poor when there are force pushes.

@merwok
Copy link
Member

merwok commented Jan 30, 2022

@raghavthind2005 hello 👋🏽 Reviews by non-core developers are useful if you carefully consider the bug report, the changes, the discussions. Sometimes you need to get the branch locally, build python and try out the code to see if it does what it’s supposed to. It is useful if people who are not core devs do these things and write a message on the PR to say that. But just giving +1 without engaging with the process or the people has little value.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks, I'm planning to merge this (cc @gvanrossum).

The duplicate test cases are quite bad and we should definitely fix them. The duplicate imports aren't as bad but it's still cleaner to get them fixed.

@JelleZijlstra JelleZijlstra self-assigned this Mar 10, 2022
@gvanrossum
Copy link
Member

@JelleZijlstra Looks fine to me. (In general I think you don't have to CC me on things you plan to merge any more, unless you really want me to have another look. You're doing great!)

@JelleZijlstra
Copy link
Member

Great, thanks! I was thinking of asking when I could leave new core dev quarantine :)

@JelleZijlstra JelleZijlstra merged commit 6c83c8e into python:main Mar 10, 2022
@miss-islington
Copy link
Contributor

Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @sobolevn and @JelleZijlstra, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97 3.10

@miss-islington
Copy link
Contributor

Sorry, @sobolevn and @JelleZijlstra, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97 3.9

@JelleZijlstra
Copy link
Member

I'll backport

JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this pull request Mar 10, 2022
…onGH-30297).

(cherry picked from commit 6c83c8e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Mar 10, 2022
@bedevere-bot
Copy link

GH-31797 is a backport of this pull request to the 3.9 branch.

JelleZijlstra pushed a commit to JelleZijlstra/cpython that referenced this pull request Mar 10, 2022
…nGH-30297).

(cherry picked from commit 6c83c8e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@JelleZijlstra
Copy link
Member

#31796 is the 3.10 backport, not sure why the bot didn't pick it up

AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Mar 10, 2022
pythonGH-30297 removed a duplicate `from test import support` statement from `test_asyncio.test_sslproto`. However, in between that PR being filed and it being merged, pythonGH-31275 removed the _other_ `from test import support` statement. This means that `support` is now undefined in `test_asyncio.test_sslproto`, causing the CI to fail on all platforms for all PRS.
JelleZijlstra added a commit that referenced this pull request Mar 10, 2022
) (GH-31797)

(cherry picked from commit 6c83c8e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
JelleZijlstra pushed a commit that referenced this pull request Mar 10, 2022
GH-30297 removed a duplicate `from test import support` statement from `test_asyncio.test_sslproto`. However, in between that PR being filed and it being merged, GH-31275 removed the _other_ `from test import support` statement. This means that `support` is now undefined in `test_asyncio.test_sslproto`, causing the CI to fail on all platforms for all PRS.
JelleZijlstra added a commit that referenced this pull request Mar 10, 2022
…0297) (GH-31796)

(cherry picked from commit 6c83c8e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…nGH-30297) (pythonGH-31797)

(cherry picked from commit 6c83c8e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport to 3.10 only security fixes skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants