Skip to content

fix: allow closing a context more than once - #354

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
patrick-immometrica:fix/context-close-twice
Nov 23, 2026
Merged

Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
patrick-immometrica:fix/context-close-twice

Conversation

@patrick-immometrica

Copy link
Copy Markdown
Contributor

Calling close() twice on a context is fine in Playwright, but with the plugin the second call fails the test:

ValueError: list.remove(x): x not in list

It comes from the close wrapper in new_context. A second call now skips the bookkeeping and goes straight to the original close(). Test added for sync and async.

@patrick-immometrica
Patrick Hintermayer (patrick-immometrica) marked this pull request as ready for review November 21, 2026 11:30

@dgozman Dmitry Gozman (dgozman) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the fix, looks great.

@dgozman
Dmitry Gozman (dgozman) merged commit 23a8a99 into microsoft:main Nov 23, 2026
13 checks passed
@patrick-immometrica
Patrick Hintermayer (patrick-immometrica) deleted the fix/context-close-twice branch November 23, 2026 11:36
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.

2 participants