タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

docsとtestingと*programに関するsh19910711のブックマーク (1)

  • pytest-htmlでテスト関数のdocstringをレポートに出力する - Qiita

    テスト関数の詳細情報としてdocstringをpytest-htmlのレポートに出力する方法をまとめます。 1. conftest.pyを編集 testsディレクトリ直下のconftest.py(なければ作成)に以下の設定を追記します。 テーブルヘッダーの3列目にタイトル、テーブルボディの3列目にテスト関数のdocstringの情報を挿入しています。 import pytest from py.xml import html def pytest_html_results_table_header(cells): cells.insert(2, html.th('Description')) def pytest_html_results_table_row(report, cells): cells.insert(2, html.td(report.description)) @pyte

    pytest-htmlでテスト関数のdocstringをレポートに出力する - Qiita
    sh19910711
    sh19910711 2024/06/17
    "テスト関数の詳細情報としてdocstringをpytest-htmlのレポートに出力する / testsディレクトリ直下のconftest.py(なければ作成)に以下の設定を追記 / pytest_html_results_table_header + pytest.hookimpl(hookwrapper=True)" 2020
  • 1