Skip to content

Commit 6abbbff

Browse files
authored
Remove unused and undocumented markers (#224)
1 parent 8e96c6e commit 6abbbff

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

README.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ You can edit the *Summary* section by using the :code:`pytest_html_results_summa
112112
import pytest
113113
from py.xml import html
114114
115-
@pytest.mark.optionalhook
116115
def pytest_html_results_summary(prefix, summary, postfix):
117116
prefix.extend([html.p("foo: bar")])
118117
@@ -158,7 +157,7 @@ conftest.py file:
158157
.. code-block:: python
159158
160159
import pytest
161-
@pytest.mark.hookwrapper
160+
@pytest.hookimpl(hookwrapper=True)
162161
def pytest_runtest_makereport(item, call):
163162
pytest_html = item.config.pluginmanager.getplugin('html')
164163
outcome = yield
@@ -195,19 +194,17 @@ column:
195194
from py.xml import html
196195
import pytest
197196
198-
@pytest.mark.optionalhook
199197
def pytest_html_results_table_header(cells):
200198
cells.insert(2, html.th('Description'))
201199
cells.insert(1, html.th('Time', class_='sortable time', col='time'))
202200
cells.pop()
203201
204-
@pytest.mark.optionalhook
205202
def pytest_html_results_table_row(report, cells):
206203
cells.insert(2, html.td(report.description))
207204
cells.insert(1, html.td(datetime.utcnow(), class_='col-time'))
208205
cells.pop()
209206
210-
@pytest.mark.hookwrapper
207+
@pytest.hookimpl(hookwrapper=True)
211208
def pytest_runtest_makereport(item, call):
212209
outcome = yield
213210
report = outcome.get_result()
@@ -221,7 +218,6 @@ following example removes all passed results from the report:
221218
222219
import pytest
223220
224-
@pytest.mark.optionalhook
225221
def pytest_html_results_table_row(report, cells):
226222
if report.passed:
227223
del cells[:]
@@ -234,7 +230,6 @@ additional HTML and log output with a notice that the log is empty:
234230
235231
import pytest
236232
237-
@pytest.mark.optionalhook
238233
def pytest_html_results_table_html(report, data):
239234
if report.passed:
240235
del data[:]

testing/test_pytest_html.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ def test_custom_content_in_summary(self, testdir):
299299
import pytest
300300
from py.xml import html
301301
302-
@pytest.mark.optionalhook
303302
def pytest_html_results_summary(prefix, summary, postfix):
304303
prefix.append(html.p("prefix is {0}"))
305304
summary.extend([html.p("extra summary is {1}")])
@@ -320,7 +319,7 @@ def test_extra_html(self, testdir):
320319
testdir.makeconftest(
321320
"""
322321
import pytest
323-
@pytest.mark.hookwrapper
322+
@pytest.hookimpl(hookwrapper=True)
324323
def pytest_runtest_makereport(item, call):
325324
outcome = yield
326325
report = outcome.get_result()
@@ -344,7 +343,7 @@ def test_extra_text(self, testdir, content, encoded):
344343
testdir.makeconftest(
345344
"""
346345
import pytest
347-
@pytest.mark.hookwrapper
346+
@pytest.hookimpl(hookwrapper=True)
348347
def pytest_runtest_makereport(item, call):
349348
outcome = yield
350349
report = outcome.get_result()
@@ -367,7 +366,7 @@ def test_extra_json(self, testdir):
367366
testdir.makeconftest(
368367
"""
369368
import pytest
370-
@pytest.mark.hookwrapper
369+
@pytest.hookimpl(hookwrapper=True)
371370
def pytest_runtest_makereport(item, call):
372371
outcome = yield
373372
report = outcome.get_result()
@@ -395,7 +394,7 @@ def test_extra_url(self, testdir):
395394
testdir.makeconftest(
396395
"""
397396
import pytest
398-
@pytest.mark.hookwrapper
397+
@pytest.hookimpl(hookwrapper=True)
399398
def pytest_runtest_makereport(item, call):
400399
outcome = yield
401400
report = outcome.get_result()
@@ -426,7 +425,7 @@ def test_extra_image(self, testdir, mime_type, extension):
426425
testdir.makeconftest(
427426
"""
428427
import pytest
429-
@pytest.mark.hookwrapper
428+
@pytest.hookimpl(hookwrapper=True)
430429
def pytest_runtest_makereport(item, call):
431430
outcome = yield
432431
report = outcome.get_result()
@@ -456,7 +455,7 @@ def test_extra_text_separated(self, testdir, content):
456455
testdir.makeconftest(
457456
"""
458457
import pytest
459-
@pytest.mark.hookwrapper
458+
@pytest.hookimpl(hookwrapper=True)
460459
def pytest_runtest_makereport(item, call):
461460
outcome = yield
462461
report = outcome.get_result()
@@ -489,7 +488,7 @@ def test_extra_image_separated(self, testdir, file_extension, extra_type):
489488
testdir.makeconftest(
490489
"""
491490
import pytest
492-
@pytest.mark.hookwrapper
491+
@pytest.hookimpl(hookwrapper=True)
493492
def pytest_runtest_makereport(item, call):
494493
outcome = yield
495494
report = outcome.get_result()
@@ -523,7 +522,7 @@ def test_extra_image_separated_rerun(self, testdir, file_extension, extra_type):
523522
testdir.makeconftest(
524523
"""
525524
import pytest
526-
@pytest.mark.hookwrapper
525+
@pytest.hookimpl(hookwrapper=True)
527526
def pytest_runtest_makereport(item, call):
528527
outcome = yield
529528
report = outcome.get_result()
@@ -561,7 +560,7 @@ def test_extra_image_non_b64(self, testdir, src_type):
561560
testdir.makeconftest(
562561
"""
563562
import pytest
564-
@pytest.mark.hookwrapper
563+
@pytest.hookimpl(hookwrapper=True)
565564
def pytest_runtest_makereport(item, call):
566565
outcome = yield
567566
report = outcome.get_result()
@@ -583,7 +582,7 @@ def test_very_long_test_name(self, testdir):
583582
testdir.makeconftest(
584583
"""
585584
import pytest
586-
@pytest.mark.hookwrapper
585+
@pytest.hookimpl(hookwrapper=True)
587586
def pytest_runtest_makereport(item, call):
588587
outcome = yield
589588
report = outcome.get_result()
@@ -776,7 +775,7 @@ def test_utf8_longrepr(self, testdir, content):
776775
testdir.makeconftest(
777776
"""
778777
import pytest
779-
@pytest.mark.hookwrapper
778+
@pytest.hookimpl(hookwrapper=True)
780779
def pytest_runtest_makereport(item, call):
781780
outcome = yield
782781
report = outcome.get_result()

0 commit comments

Comments
 (0)