8000 do not truncate --output-file until ready to write (fixes #54) by japsu · Pull Request #55 · con2/emrichen · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

do not truncate --output-file until ready to write (fixes #54) #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

japsu
Copy link
Collaborator
@japsu japsu commented Jan 11, 2022

No description provided.

akx
akx previously requested changes Jan 11, 2022
@japsu japsu dismissed akx’s stale review January 11, 2022 14:19

disagree on tmpdir

@japsu japsu merged commit 1c63154 into master Jan 11, 2022
Copy link
Collaborator
@akx akx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you merged it already...

Comment on lines +26 to +39
def test_main_notruncate():
with TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)
original_path = temp_path / "original.yaml"
update_path = temp_path / "update.yaml"
template_path = temp_path / "template.yaml"

for path, content in [
(original_path, ORIGINAL_YAML),
(update_path, UPDATE_YAML),
(template_path, TEMPLATE_YAML),
]:
with open(path, 'w', encoding="UTF-8") as output_file:
output_file.write(content)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fine, let's split the tmpdir difference and use tmp_path:

Suggested change
def test_main_notruncate():
with TemporaryDirectory() as temp_dir:
temp_path = Path(temp_dir)
original_path = temp_path / "original.yaml"
update_path = temp_path / "update.yaml"
template_path = temp_path / "template.yaml"
for path, content in [
(original_path, ORIGINAL_YAML),
(update_path, UPDATE_YAML),
(template_path, TEMPLATE_YAML),
]:
with open(path, 'w', encoding="UTF-8") as output_file:
output_file.write(content)
def test_main_notruncate(tmp_pa 993B th: pathlib.Path):
original_path = tmp_path / "original.yaml"
update_path = tmp_path / "update.yaml"
template_path = tmp_path / "template.yaml"
for path, content in [
(original_path, ORIGINAL_YAML),
(update_path, UPDATE_YAML),
(template_path, TEMPLATE_YAML),
]:
path.write_text(content, encoding="UTF-8")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0