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

fix tests for windows #318

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions tests/unit/dataclasses/test_template_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def test_template_generation_inmemory(
template = template.inline_dependencies()
bindings, filled = template.fill(BLDG, include_optional=include_optional)

with NamedTemporaryFile(suffix=".xlsx") as dest:
with NamedTemporaryFile(suffix=".xlsx", delete=False) as dest:
output = template.generate_spreadsheet()
assert output is not None
dest.write(output.getbuffer())

dest.flush()
w = openpyxl.load_workbook(dest.name)
_add_spreadsheet_row(w.active, bindings)
w.save(Path(dest.name))
Expand All @@ -92,10 +92,10 @@ def test_template_generation_file(
template = template.inline_dependencies()
bindings, filled = template.fill(BLDG, include_optional=include_optional)

with NamedTemporaryFile(suffix=".xlsx") as dest:
with NamedTemporaryFile(suffix=".xlsx", delete=False) as dest:
output = template.generate_spreadsheet(Path(dest.name))
assert output is None

dest.flush()
w = openpyxl.load_workbook(dest.name)
_add_spreadsheet_row(w.active, bindings)
w.save(Path(dest.name))
Expand All @@ -118,7 +118,7 @@ def test_csv_generation_inmemory(
template = template.inline_dependencies()
bindings, filled = template.fill(BLDG, include_optional=include_optional)

with NamedTemporaryFile(mode="w", suffix=".csv") as dest:
with NamedTemporaryFile(mode="w", suffix=".csv", delete=False) as dest:
dllliu marked this conversation as resolved.
Show resolved Hide resolved
output = template.generate_csv()
assert output is not None
dest.writelines([output.getvalue()])
Expand All @@ -145,7 +145,7 @@ def test_csv_generation_file(
template = template.inline_dependencies()
bindings, filled = template.fill(BLDG, include_optional=include_optional)

with NamedTemporaryFile(mode="w", suffix=".csv") as dest:
with NamedTemporaryFile(mode="w", suffix=".csv", delete=False) as dest:
dllliu marked this conversation as resolved.
Show resolved Hide resolved
output = template.generate_csv(Path(dest.name))
assert output is None

Expand Down
Loading