Skip to content

Commit

Permalink
fix: malformed table rows warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Domínguez authored and bittner committed Sep 10, 2021
1 parent bfda544 commit 6b1e5c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions behave/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
# pylint: enable=line-too-long

from __future__ import absolute_import, with_statement
import logging
import re
import sys
import six
Expand Down Expand Up @@ -644,6 +645,10 @@ def action_table(self, line):
self.state = "steps"
return self.action_steps(line)

if not re.match(r"^(|.+)\|$", line):
logger = logging.getLogger("behave")
logger.warning(u"Malformed table row at %s: line %i", self.feature.filename, self.line)

# -- SUPPORT: Escaped-pipe(s) in Gherkin cell values.
# Search for pipe(s) that are not preceeded with an escape char.
cells = [cell.replace("\\|", "|").strip()
Expand Down

0 comments on commit 6b1e5c4

Please sign in to comment.