playwright-python
playwright-python copied to clipboard
[BUG] Can't pass a list into to_have_values
Repro:
import typing
from playwright.sync_api import Page, expect
def to_have_text(
expected: typing.List[typing.Union[typing.Pattern[str], str]],
# this works: expected: typing.Union[typing.List[typing.Pattern[str]], typing.List[str]],
):
pass
def test_should_persist_its_data(page: Page) -> None:
my_list = ["a", "b", "c"]
to_have_text(my_list)
expect(page.locator("")).to_have_text(my_list)
Verified with latest mypy and pyright.
Once fixed, make sure to remove the linting exclude rules in:
- .pre-commit-config.yaml
- pyproject.toml