File tree Expand file tree Collapse file tree 5 files changed +20
-5
lines changed
examples/docs_beta_snippets
docs_beta_snippets_tests/snippet_checks Expand file tree Collapse file tree 5 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ sphinx_objects_inv:
3232regenerate_cli_snippets :
3333 cd ../examples/docs_beta_snippets && tox -e docs_snapshot_update && echo " \nSnippets regenerated!"
3434
35+ regenerate_cli_snippets_and_screenshots :
36+ cd ../examples/docs_beta_snippets && EXTRA_PARAMS=' --update-screenshots' tox -e docs_snapshot_update && echo " \nSnippets regenerated!"
37+
3538regenerate_cli_snippets_and_test :
3639 cd ../examples/docs_beta_snippets && tox -e docs_snapshot_update && tox -e docs_snapshot_test && echo " \nSnippets regenerated and tested!"
3740
Original file line number Diff line number Diff line change @@ -8,13 +8,22 @@ def pytest_addoption(parser: pytest.Parser) -> None:
88 "--update-snippets" ,
99 action = "store_true" ,
1010 )
11+ parser .addoption (
12+ "--update-screenshots" ,
13+ action = "store_true" ,
14+ )
1115
1216
1317@pytest .fixture
1418def update_snippets (request : pytest .FixtureRequest ) -> bool :
1519 return bool (request .config .getoption ("--update-snippets" ))
1620
1721
22+ @pytest .fixture
23+ def update_screenshots (request : pytest .FixtureRequest ) -> bool :
24+ return bool (request .config .getoption ("--update-screenshots" ))
25+
26+
1827@pytest .fixture (scope = "session" )
1928def get_selenium_driver ():
2029 from selenium import webdriver
Original file line number Diff line number Diff line change 2929)
3030
3131
32- def test_components_docs_index (update_snippets : bool , get_selenium_driver ) -> None :
32+ def test_components_docs_index (
33+ update_snippets : bool , update_screenshots : bool , get_selenium_driver
34+ ) -> None :
3335 snip_no = 0
3436
3537 def next_snip_no ():
@@ -130,7 +132,7 @@ def next_snip_no():
130132 / "projects-and-components"
131133 / "components"
132134 / "component-type-docs.png" ,
133- update_snippets = update_snippets ,
135+ update_screenshots = update_screenshots ,
134136 )
135137
136138 #########################################################
Original file line number Diff line number Diff line change @@ -286,11 +286,11 @@ def screenshot_page(
286286 get_webdriver : "Callable[[], webdriver.Chrome]" ,
287287 url : str ,
288288 path : Path ,
289- update_snippets : bool ,
289+ update_screenshots : bool ,
290290 width : Optional [int ] = 1024 ,
291291 height : Optional [int ] = 768 ,
292292) -> None :
293- if not update_snippets :
293+ if not update_screenshots :
294294 return
295295 webdriver = get_webdriver ()
296296 webdriver .set_window_size (width , height )
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ passenv =
88 COVERALLS_REPO_TOKEN
99 POSTGRES_TEST_DB_HOST
1010 BUILDKITE*
11+ EXTRA_PARAMS
1112install_command = uv pip install {opts} {packages}
1213deps =
1314 duckdb
@@ -92,4 +93,4 @@ commands =
9293 docs_snapshot_test: sh ./docs_beta_snippets_tests/ensure_snapshot_deps.sh
9394 docs_snapshot_test: pytest -c ../../pyproject.toml -vv {posargs} docs_beta_snippets_tests/snippet_checks
9495 docs_snapshot_update: sh ./docs_beta_snippets_tests/ensure_snapshot_deps.sh
95- docs_snapshot_update: pytest -c ../../pyproject.toml -vv {posargs} docs_beta_snippets_tests/snippet_checks --update-snippets
96+ docs_snapshot_update: pytest -c ../../pyproject.toml -vv {posargs} docs_beta_snippets_tests/snippet_checks --update-snippets {env:EXTRA_PARAMS}
You can’t perform that action at this time.
0 commit comments