Skip to main content

Release Notes Downloads GitHub CI Status License: MIT

Pause a Playwright page before pytest teardown

page.pause() is awkward to place in a pytest-playwright suite. Put it after yield in the page fixture and pytest has already started tearing other fixtures down. Teardown is LIFO, so a server fixture, a database session, or an auth helper that depends on page is gone before the browser closes. The inspector is attached to a page whose app is already shut down.

--playwright-pause hooks pytest_runtest_teardown and calls page.pause() before that unwind.

Installation

uv add --dev pytest-playwright-pause

pytest loads the plugin on its own. This package depends on pytest-playwright. Install browser binaries before a headed run:

uv run playwright install

Usage

PWDEBUG=1 uv run pytest --playwright-pause -s

PWDEBUG=1 opens the Playwright inspector. -s leaves stdin alone so you can drive it. The run waits on each test that requested page until you resume.

While the flag is set, the plugin turns on headed mode and sets slow motion to 500ms. It also sets the context timeout to 0 for the pause, because Playwright's default 30s timeout will close the inspector.

Tests that never asked for page are unchanged. Leave the flag off in CI.

The plugin's page fixture is context.new_page(). That keeps --browser chromium --browser firefox working when a page fixture is overridden. Older pytest-playwright dropped that parametrization: https://github.com/microsoft/playwright-pytest/issues/172

Features

  • --playwright-pause calls page.pause() before fixture teardown, with the test server and auth still up
  • Headed mode and 500ms slow motion for that run
  • Context timeouts cleared so the inspector is not closed at 30 seconds
  • page comes from context.new_page() so multi-browser parametrization still applies

MIT License


This project was created from iloveitaly/python-package-template

Metadata

Release files for pytest-playwright-pause 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-playwright-pause 0.1.0
File Size Uploaded Provenance Actions
pytest_playwright_pause-0.1.0.tar.gz 4.2 kB Without provenance Details for pytest_playwright_pause-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-playwright-pause 0.1.0
File Interpreter ABI Platform Actions
pytest_playwright_pause-0.1.0-py3-none-any.whl Python 3 none any Details for pytest_playwright_pause-0.1.0-py3-none-any.whl

Total release size: 9.6 kB

Release files / pytest_playwright_pause-0.1.0.tar.gz

Download URL pytest_playwright_pause-0.1.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b33c36f8f836b29ad4a47f652ed5419e9d280dd8523d5cd3907fc6f64c13a5b5
BLAKE2b-256 checksum
How to use checksums
4d08aea9df3919a4ad1f046cca1841270e9087954157a597a49f84303f7d880d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pytest_playwright_pause-0.1.0-py3-none-any.whl

Download URL pytest_playwright_pause-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77b3ce9c092c401b1a00bb0795e6ed10f9f54b13ec80185d43dc459c06f15ee3
BLAKE2b-256 checksum
How to use checksums
93023737caa9e70ab24719ce505c9c998b0060e71a7d03e3bcab3cf3c7c7d163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pytest-playwright-pause 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page