Skip to content

chore: improve expect.set_options timeout reset handling #1981

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

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Jun 16, 2023

We do a good job in resetting the expect timeout here:

async def test_should_be_able_to_set_custom_global_timeout(page: Page) -> None:
try:
expect.set_options(timeout=111)
with pytest.raises(AssertionError) as exc_info:
await expect(page.locator("#a1")).to_be_visible()
assert "LocatorAssertions.to_be_visible with timeout 111ms" in str(
exc_info.value
)
finally:
expect.set_options(timeout=None)

but it gets ignored here, which ends up that the timeout is not getting reset to the default:

if timeout is not None:
self._timeout = timeout

So lets check if the param got actually passed over as per here.

Fixes #1973

@mxschmitt mxschmitt changed the title chore: unflake docker tests chore: improve expect.set_options timeout reset handlign Jun 16, 2023
@mxschmitt mxschmitt changed the title chore: improve expect.set_options timeout reset handlign chore: improve expect.set_options timeout reset handling Jun 16, 2023
@mxschmitt mxschmitt merged commit f8c4548 into main Jun 16, 2023
@mxschmitt mxschmitt deleted the unflake-docker-tests branch June 16, 2023 19:46
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.

[internal] investigate docker test failures
2 participants