Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
pytest documentation
Logo
  • 開始使用
  • 操作指南
    • How to invoke pytest
    • How to write and report assertions in tests
    • How to use fixtures
    • How to mark test functions with attributes
    • How to parametrize fixtures and test functions
    • How to use subtests
    • How to use temporary directories and files in tests
    • How to monkeypatch/mock modules and environments
    • How to run doctests
    • How to re-run failed tests and maintain state between test runs
    • How to handle test failures
    • Managing pytest's output
    • How to manage logging
    • How to capture stdout/stderr output
    • How to capture warnings
    • How to use skip and xfail to deal with tests that cannot succeed
    • How to install and use plugins
    • Writing plugins
    • Writing hook functions
    • How to use pytest with an existing test suite
    • How to use unittest-based tests with pytest
    • How to implement xunit-style set-up
    • How to set up bash completion
  • 參考指南
    • API 參考
    • 夾具參考
    • 組態
    • 退出碼
    • Pytest Plugin List
  • Explanation
    • Anatomy of a test
    • About fixtures
    • Good Integration Practices
    • pytest import mechanisms and sys.path/PYTHONPATH
    • Typing in pytest
    • CI Pipelines
    • Flaky tests
  • Examples and customization tricks
    • Demo of Python failure reports with pytest
    • Basic patterns and examples
    • Parametrizing tests
    • Working with custom markers
    • A session-fixture which can look at all collected tests
    • Changing standard (Python) test discovery
    • Working with non-python tests
    • Using a custom directory collector

關於此專案

  • 變更日誌
  • 參與貢獻
  • 向後相容性方針
  • History
  • Python 版本支援
  • 贊助者
  • pytest for enterprise
  • 授權條款
  • 聯絡通道

Useful links

  • pytest @ PyPI
  • pytest @ GitHub
  • 議題追蹤器
  • PDF 文件
Back to top

贊助者¶

pytest 是由來自世界各地的志願者團隊在他們的空閒時間維護的。雖然我們投入 pytest 的工作是因為我們熱愛這個專案,並且在日常工作中經常使用它,但當我們需要從與朋友、家人相處及個人時間中抽身時,可能的金錢補償是受歡迎的。

資金亦用於資助當地的衝刺活動、商品製作(例如在會議上分發的貼紙),以及每隔幾年舉辦一次大型衝刺活動,匯集所有成員參加。

OpenCollective¶

Open Collective 是一個專為開放透明社群設計的線上募資平臺。它提供工具來籌集資金,並以完全透明的方式共享財務資訊。

It is the platform of choice for individuals and companies that want to make one-time or monthly donations directly to the project.

See more details in the pytest collective.

Next
pytest for enterprise
Previous
向後相容性方針
Copyright © 2015, holger krekel and pytest-dev team
Made with Sphinx and @pradyunsg's Furo
On this page
  • 贊助者
    • OpenCollective