~/talk

How to Write Pytest Plugins

Talkat PyOhio 2019 · 2019-07-27..07-28· [testing]
links:none on file
slides:none on file

Shows how to implement a concrete pytest plugin that emits a CSV of test IDs, docstrings and markers by tapping pytest_collection_modifyitems and calling pytest.exit to stop after report generation, and a second plugin that generates a self-contained HTML via pytest-html, then uploads it to Google Cloud Storage at tryfirst ordered session_finish. Includes code snippets for setup.py entry_points, uses google-cloud-storage client, and reports successful uploads with date-based bucket paths.

AI-written summary · about

  1. 0:00Introduction to pytest
  2. 1:22Overview of pytest plugins
  3. 3:02Fixtures and local plugins
  4. 6:10Understanding pytest hooks
  5. 8:55Building a custom test plan
  6. 16:07Creating installable plugins
  7. 17:00Integrating with external tools
  8. 22:59Summary and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.