Skip to content
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

Use tmp_path in test_mainfunction #667

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/test_ecldiff2roff.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,24 @@ def test_mainfunction(
datefmt,
expected_files,
reek_data,
tmp_path,
):
"""Test the command line functionality of ecldiff2roff"""
# pylint: disable=unused-argument
# pylint: disable=redefined-outer-name
# pylint: disable=too-many-arguments
Path("datediff.txt").write_text(diffdates, encoding="utf8")

if outputfilebase.startswith("/tmp"):
outputfilebase = str(tmp_path / outputfilebase[5:])

modified_expected_files = [
str(tmp_path / ef[5:]) if ef.startswith("/tmp") else ef for ef in expected_files
]
Path("datediff.txt").write_text(diffdates, encoding="utf8")
ecldiff2roff.ecldiff2roff_main(
eclroot, prop, "datediff.txt", outputfilebase, sep, datesep, datefmt
)
for expected_file in expected_files:
for expected_file in modified_expected_files:
assert Path(expected_file).exists()


Expand Down
Loading