Skip to content

Commit 2993b26

Browse files
author
Jairo Llopis
committed
fixup! Increase timeout for pexpect and use yaml.load_safe
1 parent 7f3477d commit 2993b26

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tests/test_migrations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def test_prereleases(tmp_path: Path):
181181
git("tag", "v2.0.0.alpha1")
182182
# Copying with use_prereleases=False copies v1
183183
copy(src_path=str(src), dst_path=dst, force=True)
184-
answers = yaml.load_safe((dst / ".copier-answers.yml").read_text())
184+
answers = yaml.safe_load((dst / ".copier-answers.yml").read_text())
185185
assert answers["_commit"] == "v1.0.0"
186186
assert (dst / "version.txt").read_text() == "v1.0.0"
187187
assert not (dst / "v1.9").exists()
@@ -204,7 +204,7 @@ def test_prereleases(tmp_path: Path):
204204
assert not (dst / "v2.a2").exists()
205205
# Update it with prereleases
206206
copy(dst_path=dst, force=True, use_prereleases=True)
207-
answers = yaml.load_safe((dst / ".copier-answers.yml").read_text())
207+
answers = yaml.safe_load((dst / ".copier-answers.yml").read_text())
208208
assert answers["_commit"] == "v2.0.0.alpha1"
209209
assert (dst / "version.txt").read_text() == "v2.0.0.alpha1"
210210
assert (dst / "v1.9").exists()

tests/test_prompt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_when(tmp_path_factory, question_2_when, asks):
138138
tui.expect_exact(["question_2?", "Format: yaml"])
139139
tui.sendline()
140140
tui.expect_exact(pexpect.EOF)
141-
answers = yaml.load_safe((subproject / ".copier-answers.yml").read_text())
141+
answers = yaml.safe_load((subproject / ".copier-answers.yml").read_text())
142142
assert answers == {
143143
"_src_path": str(template),
144144
"question_1": True,
@@ -176,7 +176,7 @@ def test_placeholder(tmp_path_factory):
176176
)
177177
tui.sendline()
178178
tui.expect_exact(pexpect.EOF)
179-
answers = yaml.load_safe((subproject / ".copier-answers.yml").read_text())
179+
answers = yaml.safe_load((subproject / ".copier-answers.yml").read_text())
180180
assert answers == {
181181
"_src_path": str(template),
182182
"question_1": "answer 1",

tests/test_templated_prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def test_templated_prompt(
136136
tui.expect_exact([f"{question_name}?"] + expected_outputs)
137137
tui.sendline()
138138
tui.expect_exact(pexpect.EOF)
139-
answers = yaml.load_safe((subproject / ".copier-answers.yml").read_text())
139+
answers = yaml.safe_load((subproject / ".copier-answers.yml").read_text())
140140
assert answers[question_name] == expected_value
141141

142142

0 commit comments

Comments
 (0)