mirror of
https://github.com/simonw/datasette.git
synced 2026-09-29 05:14:21 +02:00
Just recipes for running Playwright tests
Plus the pytest header now reports selected Playwright browsers
This commit is contained in:
parent
2a887e5853
commit
77fa49cf17
3 changed files with 55 additions and 11 deletions
|
|
@ -93,7 +93,17 @@ def pytest_report_header(config):
|
|||
conn = sqlite3.connect(":memory:")
|
||||
version = conn.execute("select sqlite_version()").fetchone()[0]
|
||||
conn.close()
|
||||
return "SQLite: {}".format(version)
|
||||
headers = ["SQLite: {}".format(version)]
|
||||
if config.getoption("--playwright"):
|
||||
try:
|
||||
browsers = config.getoption("--browser")
|
||||
except ValueError:
|
||||
browsers = None
|
||||
if isinstance(browsers, str):
|
||||
browsers = [browsers]
|
||||
if browsers:
|
||||
headers.append("Playwright browsers: {}".format(", ".join(browsers)))
|
||||
return headers
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue