fix: Deprecate the Cells.pop function (#608)

This commit is contained in:
Jim Brännlund 2023-04-01 15:18:36 +02:00 committed by GitHub
parent 3306c1c09f
commit 080780cf09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -58,6 +58,12 @@ class BaseReport:
html = html.replace("col", "data-column-type") html = html.replace("col", "data-column-type")
self._html[index] = html self._html[index] = html
def pop(self, *args):
warnings.warn(
"'pop' is deprecated and no longer supported.",
DeprecationWarning,
)
class Report: class Report:
def __init__(self, title, config): def __init__(self, title, config):
self._config = config self._config = config

View File

@ -24,3 +24,19 @@ def test_duration_format_deprecation_warning(pytester):
"*DeprecationWarning: 'duration_formatter'*", "*DeprecationWarning: 'duration_formatter'*",
], ],
) )
def test_cells_pop_deprecation_warning(pytester):
pytester.makeconftest(
"""
def pytest_html_results_table_row(cells):
cells.pop()
"""
)
pytester.makepyfile("def test_pass(): pass")
result = run(pytester)
result.stdout.fnmatch_lines(
[
"*DeprecationWarning: 'pop' is deprecated*",
],
)