Skip to content

Commit

Permalink
Merge pull request #129 from plotly/neyberson/flags_pytest
Browse files Browse the repository at this point in the history
Neyberson/flags pytest
  • Loading branch information
ayjayt authored Oct 7, 2024
2 parents 7b6c0e8 + ff4a2c3 commit 217cae7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 1
- name: Test Process Control DEBUG
if: runner.debug
run: xvfb-run pytest -W error -vvv -rA --capture=tee-sys tests/test_process.py
run: xvfb-run pytest -W error -vv -rA --capture=tee-sys tests/test_process.py
timeout-minutes: 5
- name: Test Process Control
if: ${{ ! runner.debug }}
Expand All @@ -41,7 +41,7 @@ jobs:
timeout-minutes: 1
- name: Test Process Control DEBUG
if: runner.debug
run: pytest -W error -vvv -rA --capture=tee-sys tests/test_process.py
run: pytest -W error -vv -rA --capture=tee-sys tests/test_process.py
timeout-minutes: 5
- name: Test Process Control
if: ${{ ! runner.debug }}
Expand All @@ -65,7 +65,7 @@ jobs:
timeout-minutes: 1
- name: Test Process Control DEBUG
if: runner.debug
run: pytest -W error -vvv -rA --capture=tee-sys tests/test_process.py
run: pytest -W error -vv -rA --capture=tee-sys tests/test_process.py
timeout-minutes: 5
- name: Test Process Control
if: ${{ ! runner.debug }}
Expand Down
14 changes: 12 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ def debug(request):
def debug_browser(request):
return request.param


def pytest_addoption(parser):
parser.addoption("--headless", action="store_true", default=False)


@pytest_asyncio.fixture(scope="function", loop_scope="function")
async def browser():
async def browser(request):
# this needs also to be set by command line TODO
browser = await devtools.Browser()
headless = request.config.getoption("--headless")
debug = request.config.get_verbosity() > 2

browser = await devtools.Browser(
headless=headless, debug=debug, debug_browser=debug
)
yield browser
await browser.close()

Expand Down

0 comments on commit 217cae7

Please sign in to comment.