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 on Windows #203

Merged
merged 11 commits into from
Oct 23, 2023
Merged

Fix Tests on Windows #203

merged 11 commits into from
Oct 23, 2023

Conversation

trevorb1
Copy link
Member

@trevorb1 trevorb1 commented Oct 21, 2023

Description

In this PR I update otoole to fix failing tests on Windows.

Specifically this includes:

  • Explicitly setting all int as int64 data types when the config file is first read in. Im not sure why, but on Windows pandas seems to set int as int32, while on Linux it will set it as int64 (or is just not concerned about int32 vs. int64). Anyways, int64 is explicitly set now
  • Explicitly setting int64 for int datatypes in the results package (note, the config file dtypes are not accessible here)
  • Explicitly setting int64 for read_strategies of solvers
  • Specify the lineterminator argument as \n when writing to csv or datafiles, as Windows will default to \r\n. More information here
  • Fix NamedTemporaryFile calls in the tests on Windows. As this Stack Overflow comment and this Python docs states, to open a NamedTemporaryFile on Windows, you must set delete=False and then explicitly close and delete the file. Therefore, I have wrapped all NamedTemporaryFile calls in tests in try finally blocks, where the finally code closes and deletes the temporary file.
  • Adds Windows testing to the CI GitHub Action

Issue Ticket Number

Closes #202

Documentation

na

@trevorb1 trevorb1 marked this pull request as ready for review October 23, 2023 00:15
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.

[Bug]: Tests fail on Windows
1 participant