acroucher / PyTOUGH

A Python library for automating TOUGH2 simulations of subsurface fluid and heat flow
GNU Lesser General Public License v3.0
96 stars 36 forks source link

Some unit tests failed locally in VS Code #41

Open ychen1492 opened 1 year ago

ychen1492 commented 1 year ago

Hi, thanks for sharing the code. I am trying to check some methods using unit tests. I see the github action build is fine, however, I get some failed unit tests locally in vscode. It seems like the paths to the test data are not set properly. All test data is in the subfolders of tests. After I made the following adjustments, image I can debug the unit tests in vscode. image I am using the master version of this tool, Commit hash: 1e205948fe2e267ba32c2a83f1cb601e0689c8c9 I see in github actions, you are using the ubuntu Linux rather than the windows machine. I am not sure if this results in the success in github actions but failed on my local machine.

Another issue I have is on the integer data type, it looks like numpy doesn't have int type, instead, only int works fine. I am not sure if anyone else has an issue there. image

Thanks again.

acroucher commented 1 year ago

I am not sure what caused the issue with the unit test data path, maybe VSCode tries to run them from the top directory of the PyTOUGH install? If you look at the script used to run the unit tests as a Github Action (.github/workflows/pythontest.yml) you will see it navigates to the tests directory first before running the tests.

Another issue I have is on the integer data type

This is caused by recent changes to numpy and is fixed in the PyTOUGH testing branch - will be in the next release of PyTOUGH.