Skip to content

Commit 080780c

Browse files
authored
fix: Deprecate the Cells.pop function (#608)
1 parent 3306c1c commit 080780c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/pytest_html/nextgen.py

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def insert(self, index, html):
5858
html = html.replace("col", "data-column-type")
5959
self._html[index] = html
6060

61+
def pop(self, *args):
62+
warnings.warn(
63+
"'pop' is deprecated and no longer supported.",
64+
DeprecationWarning,
65+
)
66+
6167
class Report:
6268
def __init__(self, title, config):
6369
self._config = config

testing/test_unit.py

+16
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,19 @@ def pytest_runtest_makereport(item, call):
2424
"*DeprecationWarning: 'duration_formatter'*",
2525
],
2626
)
27+
28+
29+
def test_cells_pop_deprecation_warning(pytester):
30+
pytester.makeconftest(
31+
"""
32+
def pytest_html_results_table_row(cells):
33+
cells.pop()
34+
"""
35+
)
36+
pytester.makepyfile("def test_pass(): pass")
37+
result = run(pytester)
38+
result.stdout.fnmatch_lines(
39+
[
40+
"*DeprecationWarning: 'pop' is deprecated*",
41+
],
42+
)

0 commit comments

Comments
 (0)