Skip to content

switch the test suite to pytest #166

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

Merged
merged 3 commits into from
Jun 16, 2018
Merged

switch the test suite to pytest #166

merged 3 commits into from
Jun 16, 2018

Conversation

ev-br
Copy link
Contributor

@ev-br ev-br commented Apr 11, 2018

This scratches my itch of not havingnose installed anymore.

@ev-br ev-br force-pushed the pytest branch 2 times, most recently from b8b8e91 to ea46780 Compare April 11, 2018 22:51
@jnothman
Copy link
Member

There are another couple of references to nose in the repo. Otherwise +1 from me

@ev-br
Copy link
Contributor Author

ev-br commented Apr 13, 2018

I've found two references: one incantation in setup.py which is meant to enable $ python setup.py test --- is it still relevant? I tried to use instead the recommended pytest idiom using pytest-runner but did not manage to get it to work, and gave up. I suspect it's not worth it since pytest --pyargs numpydoc just works.

The other reference to nose, https://github.com/numpy/numpydoc/blob/master/numpydoc/numpydoc.py#L174
is in comments, and I've no idea if it's still relevant.

@mattip
Copy link
Member

mattip commented Jun 13, 2018

Now that numpy is using pytest in the soon-to-be-released 1.15, is it time to update and merge this? There is currently a merge conflict

ev-br added 2 commits June 14, 2018 01:12
Remove all nose imports, use plain asserts.
@ev-br
Copy link
Contributor Author

ev-br commented Jun 13, 2018

Rebased.

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

I've managed to use pytest-runner elsewhere, but I think this is fine

assert_equal(len(doc['Other Parameters']), 1)
assert_equal([n for n,_,_ in doc['Other Parameters']], ['spam'])
assert len(doc['Other Parameters']) == 1
assert [n for n,_,_ in doc['Other Parameters']] == ['spam']
Copy link
Member

Choose a reason for hiding this comment

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

Pep8: spaces after commas please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, fixed, here and elsewhere.

@jnothman jnothman merged commit 659e43f into numpy:master Jun 16, 2018
@jnothman
Copy link
Member

Thanks!

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.

4 participants