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 issues encountered during pytest #166

Open
wants to merge 9 commits into
base: fastsim-3
Choose a base branch
from

Conversation

michael-okeefe
Copy link
Collaborator

Fixes some issues encountered during running pytest -v on Windows:

  • updates how Python is called for demo tests so that it works within a virtual environment
  • Handles how Polars DataFrame is printed by first transforming to a Pandas DataFrame

Additionally, this version adds a CI workflow file to build and test the application.

Michael O'Keefe added 3 commits November 14, 2024 12:08
Previously, the string "python" was being used
in the subprocess call. However, this did not always
do the right thing when, for example, the demo tests
are being called within a virutal environment using
pytest. By using sys.executable, we use the same
python interpreter used to run pytest and/or the test_demos.py
file.
On Windows (and perhaps other platforms), we were running
into an encoding error when the Polars DataFrame was being
asked to print (i.e., being converted to a string). As a
work-around, we convert the Polars DataFrame to a Pandas
DataFrame prior to printing and this works without issue.
@michael-okeefe michael-okeefe added the bug Something isn't working label Nov 14, 2024
@michael-okeefe michael-okeefe self-assigned this Nov 14, 2024
Michael O'Keefe added 5 commits November 14, 2024 14:13
This is required on (at least) Ubuntu for the
Polars DataFrame to Pandas DataFrame conversion.
These did not consistently pass on the CI.

From Chad Baker:
... the speedup failing tests can be ignored for now.
We need to come up with a better way of testing the speed
up relative to fastsim-2, but I’m not sure that's an
urgent problem.
@michael-okeefe michael-okeefe marked this pull request as ready for review November 14, 2024 22:18
@michael-okeefe michael-okeefe marked this pull request as draft November 14, 2024 22:19
@michael-okeefe michael-okeefe marked this pull request as ready for review November 14, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant