Skip to content

Remove unused and undocumented markers #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ You can edit the *Summary* section by using the :code:`pytest_html_results_summa
import pytest
from py.xml import html

@pytest.mark.optionalhook
def pytest_html_results_summary(prefix, summary, postfix):
prefix.extend([html.p("foo: bar")])

Expand Down Expand Up @@ -158,7 +157,7 @@ conftest.py file:
.. code-block:: python

import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
pytest_html = item.config.pluginmanager.getplugin('html')
outcome = yield
Expand Down Expand Up @@ -195,19 +194,17 @@ column:
from py.xml import html
import pytest

@pytest.mark.optionalhook
def pytest_html_results_table_header(cells):
cells.insert(2, html.th('Description'))
cells.insert(1, html.th('Time', class_='sortable time', col='time'))
cells.pop()

@pytest.mark.optionalhook
def pytest_html_results_table_row(report, cells):
cells.insert(2, html.td(report.description))
cells.insert(1, html.td(datetime.utcnow(), class_='col-time'))
cells.pop()

@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand All @@ -221,7 +218,6 @@ following example removes all passed results from the report:

import pytest

@pytest.mark.optionalhook
def pytest_html_results_table_row(report, cells):
if report.passed:
del cells[:]
Expand All @@ -234,7 +230,6 @@ additional HTML and log output with a notice that the log is empty:

import pytest

@pytest.mark.optionalhook
def pytest_html_results_table_html(report, data):
if report.passed:
del data[:]
Expand Down
23 changes: 11 additions & 12 deletions testing/test_pytest_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def test_custom_content_in_summary(self, testdir):
import pytest
from py.xml import html

@pytest.mark.optionalhook
def pytest_html_results_summary(prefix, summary, postfix):
prefix.append(html.p("prefix is {0}"))
summary.extend([html.p("extra summary is {1}")])
Expand All @@ -320,7 +319,7 @@ def test_extra_html(self, testdir):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand All @@ -344,7 +343,7 @@ def test_extra_text(self, testdir, content, encoded):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand All @@ -367,7 +366,7 @@ def test_extra_json(self, testdir):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -395,7 +394,7 @@ def test_extra_url(self, testdir):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -426,7 +425,7 @@ def test_extra_image(self, testdir, mime_type, extension):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -456,7 +455,7 @@ def test_extra_text_separated(self, testdir, content):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -489,7 +488,7 @@ def test_extra_image_separated(self, testdir, file_extension, extra_type):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -523,7 +522,7 @@ def test_extra_image_separated_rerun(self, testdir, file_extension, extra_type):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -561,7 +560,7 @@ def test_extra_image_non_b64(self, testdir, src_type):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand All @@ -583,7 +582,7 @@ def test_very_long_test_name(self, testdir):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -776,7 +775,7 @@ def test_utf8_longrepr(self, testdir, content):
testdir.makeconftest(
"""
import pytest
@pytest.mark.hookwrapper
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
Expand Down