Skip to content

Commit c17a186

Browse files
committed
Update code
Signed-off-by: Jing Chen <[email protected]>
1 parent a2949e3 commit c17a186

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

docs/contrib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Follow the following instructions to set up a dev environment to get started wit
5151
pdl examples/demo/1-hello.pdl
5252
5353
Hello
54-
Hello! How can I help you today?
54+
Hello
5555
```
5656
5757
### Documentation updates

tests/test_examples_run.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ def __init__(self, monkeypatch: MonkeyPatch) -> None:
146146
self.expected_runtime_error = content["expected_runtime_error"]
147147

148148
for filename, inputs_type in content["with_inputs"].items():
149-
stdin = inputs_type["stdin"]
150-
scope = inputs_type["scope"]
149+
stdin, scope = None, None
150+
if "stdin" in inputs_type:
151+
stdin = inputs_type["stdin"]
152+
if "scope" in inputs_type:
153+
scope = inputs_type["scope"]
151154
self.with_inputs[filename] = InputsType(
152155
stdin=stdin, scope=PdlDict(scope) if scope is not None else None
153156
)
@@ -314,10 +317,10 @@ def test_example_runs(capsys: CaptureFixture[str], monkeypatch: MonkeyPatch) ->
314317
# Print the actual results for wrong results
315318
for file, actual in background.failed_results.wrong_results.items():
316319
print(
317-
"============================================================================"
320+
"\n============================================================================"
318321
)
319322
print(f"File that produced wrong result: {file}")
320-
print(f"Actual (copy everything below this line):✂️----------------------------------\n{actual}\n-----------------------------------")
323+
print(f"Actual result (copy everything below this line):\n✂️ ------------------------------------------------------------\n{actual}\n-------------------------------------------------------------")
321324

322325
assert (
323326
len(background.failed_results.unexpected_parse_error) == 0

tests/test_examples_run.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
update_results: true
1+
update_results: false
22
check: []
33
skip:
44
- examples/cldk/cldk-assistant.pdl
@@ -66,6 +66,7 @@ with_inputs:
6666
scope:
6767
something: ABC
6868
tests/data/optimizer_gsm8k.pdl:
69+
stdin: null
6970
scope:
7071
model: watsonx_text/ibm/granite-3-8b-instruct
7172
prompt_pattern: cot

0 commit comments

Comments
 (0)