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

Move from nosetests to pytest #147

Merged
merged 5 commits into from
Aug 21, 2020
Merged

Move from nosetests to pytest #147

merged 5 commits into from
Aug 21, 2020

Conversation

micheles
Copy link
Contributor

@micheles micheles commented Aug 21, 2020

Part of #144.
This was difficult because I discovered a lot of broken tests. Tests are broken for various reasons:

  1. due to missing __init__.py files, several tests were not executes by nose, so they were not working anymore
  2. some tests were running only on macos (there was a reference to a directory "Data" while the name is "data" and linux
    is a case-sensitive file system)
  3. some tests were running only from specific directories; notice that using things like '../.../../data/the/file.csv'' is the worse
    thing you could do
  4. there were syntax errors (like true instead of True and null instead of None in a file)
  5. one test was depending on the environment variable GEMDATA which is not set
  6. there was a mismatch rupid <-> rup_id
  7. the way to extract the ruptures file in MFDFromSESMFDFromInputTest was wrong.

I have skipped 5 broken tests that should be addressed by the hazard team (search for unittest.SkipTest).

NB: I have no idea why files like openquake/mbt/tests/tools/fault_modeler/data/fault_model_01.test.xml changed!

@micheles micheles requested a review from mmpagani August 21, 2020 05:11
Copy link
Member

@mmpagani mmpagani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM. Thanks a lot, MIchele. @cossatot you might want to take a look at the fault modeller tests.

@micheles micheles requested a review from cossatot August 21, 2020 07:15
@micheles micheles merged commit 89749cb into master Aug 21, 2020
@micheles micheles deleted the pytest branch August 21, 2020 09:25
@cossatot
Copy link
Contributor

Great, thanks. I like pytest much more. I'll look into the fault modeler tests as well.

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.

3 participants