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-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase #30198

Merged
merged 11 commits into from Dec 19, 2021

Conversation

asvetlov
Copy link
Contributor

@asvetlov asvetlov commented Dec 19, 2021

@asvetlov
Copy link
Contributor Author

The issue can be backported to 3.9-3.10, it doesn't add backward compatibility issues

@asvetlov asvetlov added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Dec 19, 2021
asvetlov and others added 2 commits December 19, 2021 13:24
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM in general, but I have some questions.

Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
self.assertFalse(lock.locked())
self.assertTrue(ta.done())
self.assertTrue(tb.cancelled())
self.assertTrue(tc.done())
await tc
Copy link
Member

Choose a reason for hiding this comment

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

It differs from the former code. Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically the same, but the new version also checks that tc task was not cancelled.

I can revert if you insist.

Copy link
Member

Choose a reason for hiding this comment

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

If it is the same it LGTM.

Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

@serhiy-storchaka thanks for the review.
Comments are addressed.

Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
self.assertFalse(lock.locked())
self.assertTrue(ta.done())
self.assertTrue(tb.cancelled())
self.assertTrue(tc.done())
await tc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically the same, but the new version also checks that tc task was not cancelled.

I can revert if you insist.

Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
Lib/test/test_asyncio/test_locks.py Outdated Show resolved Hide resolved
self.assertFalse(lock.locked())
self.assertTrue(ta.done())
self.assertTrue(tb.cancelled())
self.assertTrue(tc.done())
await tc
Copy link
Member

Choose a reason for hiding this comment

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

If it is the same it LGTM.

@asvetlov asvetlov merged commit 9c06fd8 into python:main Dec 19, 2021
@miss-islington
Copy link
Contributor

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

@asvetlov asvetlov deleted the rewrite-aasync-lock-tests branch December 19, 2021 14:36
@miss-islington
Copy link
Contributor

Sorry, @asvetlov, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 9c06fd89514a9a2865e2adcc472095f6949cecb2 3.10

@miss-islington
Copy link
Contributor

Sorry @asvetlov, I had trouble checking out the 3.9 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 9c06fd89514a9a2865e2adcc472095f6949cecb2 3.9

asvetlov added a commit to asvetlov/cpython that referenced this pull request Dec 19, 2021
…tCase (pythonGH-30198)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 9c06fd8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
@bedevere-bot
Copy link

GH-30202 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Dec 19, 2021
asvetlov added a commit that referenced this pull request Dec 19, 2021
…tCase (GH-30198) (GH-30202)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 9c06fd8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Dec 19, 2021
asvetlov added a commit to asvetlov/cpython that referenced this pull request Dec 19, 2021
…Case (pythonGH-30198)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 9c06fd8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
asvetlov added a commit that referenced this pull request Dec 19, 2021
…Case (GH-30198) (GH-30204)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 9c06fd8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Dec 27, 2021
…ythonGH-30198)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
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.

None yet

6 participants