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

WIP: Using pytest instead of nose requires renaming to regression_test.py #90

Merged
merged 2 commits into from
May 13, 2024

Conversation

rjleveque
Copy link
Member

After changing regression_tests.py to regression_test.py, using pytest seems to work fine.

It gave some warnings:

% pytest
=============================== warnings summary ===============================
../../../pyclaw/src/pyclaw/classic/solver.py:16
  /Users/rjl/git/clawpack/pyclaw/src/pyclaw/classic/solver.py:16: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
    from imp import reload

classic/tests/acoustics_3d_heterogeneous/regression_test.py::Acoustics3DHeterogeneousTest::runTest
  <frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================== 1 passed, 2 warnings in 3.70s =========================

The first is fixed in clawpack/pyclaw#701.

I don't know what's up with the numpy warning.

@mandli, @ketch: We should discuss further before merging this to make sure pytest is what we want to use.

@ketch
Copy link
Member

ketch commented Sep 6, 2023

Answers here suggest that updating numpy may get rid of the second warning:

https://stackoverflow.com/questions/66060487/valueerror-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-exp

I'm using numpy version 1.25.1 and I'm able to run the tests (using pytest) without getting that warning.

However, it should be noted that this still depends on nose (see line 32 of regression_test.py). If you uninstall nose, the tests won't run.

@rjleveque
Copy link
Member Author

Thanks @ketch, but it does not look like the @wip is used anywhere so I tried to clean this up in
clawpack/clawutil#155

@rjleveque
Copy link
Member Author

Merging this so we can test github CI

@rjleveque rjleveque merged commit 5f178e4 into clawpack:master May 13, 2024
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