Skip to content

Commit

Permalink
Fix: Handle assignment on table hooks (pytest-dev#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondEvil authored Apr 5, 2023
1 parent f374f59 commit e4ad806
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pytest_html/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ def append(self, html):


class Cell(Table):
def __setitem__(self, key, value):
warnings.warn(
"list-type assignment is deprecated and support "
"will be removed in a future release. "
"Please use 'insert()' instead.",
DeprecationWarning,
)
self.insert(key, value)

def insert(self, index, html):
# backwards-compat
if not isinstance(html, str):
Expand Down

0 comments on commit e4ad806

Please sign in to comment.