Skip to content

Commit 0c9447e

Browse files
aepfliclaude
andcommitted
fix: add comment for Gherkin escape handling in testkit utils
Explain why the replace('\"', '"') is needed — pytest-bdd preserves backslash escapes from Gherkin table cells. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Simon Schrottner <simon.schrottner@gmail.com>
1 parent 87b71d2 commit 0c9447e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

tools/openfeature-flagd-api-testkit/hatch_build_sync.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
ROOT = Path(__file__).parent
1111
TEST_HARNESS_EVALUATOR = (
12-
ROOT / "../../providers/openfeature-provider-flagd/openfeature/test-harness/evaluator"
12+
ROOT
13+
/ "../../providers/openfeature-provider-flagd/openfeature/test-harness/evaluator"
1314
).resolve()
1415
DEST_BASE = ROOT / "src/openfeature/contrib/tools/flagd/testkit"
1516

tools/openfeature-flagd-api-testkit/src/openfeature/contrib/tools/flagd/testkit/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ def str2bool(v: str) -> bool:
1111
"Float": float,
1212
"String": str,
1313
"Boolean": str2bool,
14+
# Gherkin uses \" to escape quotes in table cells; pytest-bdd preserves the
15+
# backslash, so we strip it before feeding the string to json.loads.
1416
"Object": lambda v: json.loads(v.replace('\\\\"', '"')),
1517
}
1618

0 commit comments

Comments
 (0)