Skip to content

TST: Switch to pytest - #10842

Merged
charris merged 7 commits into
numpy:masterfrom
charris:switch-to-pytest
Apr 7, 2018
Merged

charris merged 7 commits into
numpy:masterfrom
charris:switch-to-pytest

Conversation

@charris

@charris charris commented Apr 3, 2018 •

Copy link
Copy Markdown
Member

This switches numpy testing to pytest instead of nose. The nose specific tools remain available for downstream projects that may have depended on them, but NumPy itself should have no nose dependencies. There will be a follow on cleanup PR(s) that will do the following:

  • remove the pytest_tools directory.
  • remove run_module_suite from the test files.
  • fixup the remaining yield tests, warnings currently suppressed in ci testing.
  • test for nose dependencies by removing nose import from some ci tests.
  • update documentation
  • update numpy-wheels

There is currently no requirement for pytest version. Does anyone have a suggestion?

@njsmith You previously noted that runtests was not suitable for ci testing. Could you review your reasoning? Scipy and the NumPy appveyor tests are using runtests, and I'd like to use it for travis also.

See #10856 for checklist of tasks.

@charris
charris force-pushed the switch-to-pytest branch 4 times, most recently from dbe8231 to e80a34e Compare April 4, 2018 11:41
charris added 7 commits April 4, 2018 06:26
* Make PytestTester callable.
* Rename 'timer' to 'durations', corresponding with pytest.
* Offset 'verbose', no entry is now '-q'.
* Move some `ignore` warnings into PytestTester so that they
  affect releases, not just develop.
Use standard pytest markers everywhere in the numpy tests. At this point
there should be no nose dependency. However, nose is required to test
the legacy decorators if so desired.

At this point, numpy test cannot be run in the way with runtests, rather
installed numpy can be tested with `pytest --pyargs numpy` as long as
that is not run from the repo. Run it from the tools directory or some
such.
Numpy can now be tested using the standard

    `python -c"import numpy; numpy.test()"`

construct.
Takes over some bits from SciPy. The most visible user change is the
replacement of `--timer` by `--durations`, with `--durations=0` meaning
time all tests.
For the time being, these tests will ignore the flood of deprecated
yield test warnings. Fixing those is for another PR.
@charris
charris force-pushed the switch-to-pytest branch from ae48430 to fedcb3d Compare April 4, 2018 13:17
@charris charris changed the title WIP, TST: Switch to pytest TST: Switch to pytest Apr 4, 2018
@charris

charris commented Apr 4, 2018

Copy link
Copy Markdown
Member Author

I think this is ready.

@charris
charris requested review from eric-wieser, pv and rgommers April 4, 2018 14:48
@charris charris added this to the 1.15.0 release milestone Apr 5, 2018
@charris
charris merged commit 0361511 into numpy:master Apr 7, 2018
@charris
charris deleted the switch-to-pytest branch April 7, 2018 00:06
@jakirkham

Copy link
Copy Markdown
Contributor

Awesome! Glad to see this. 😄

cc @nicoddemus

@nicoddemus

Copy link
Copy Markdown
Contributor

Awesome indeed. Congratulations @charris on the excellent work!

Thanks @jakirkham for the ping! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants