-
Notifications
You must be signed in to change notification settings - Fork 71
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
Switch from nose to pytest #58
Comments
OK, so I took a first stab at this (on Python 3.6).
|
Neat, thanks for taking a look. I forgot about the pyserial minimum version requirement. There is some more stuff in PR that uses newer features of pyserial, so I'll have to think about what to do there. |
Optimally, we should find out how much effort it is to create a conda-forge recipe for pyserial, then the min version won't be a problem. I think the pymeasure folks have tried this before, correct @cjermain? |
update: Recently, a current version of pyserial has become available on conda-forge, so that can be installed via conda now. |
So, this was a lot of manual work, but I have created a PR (#183). |
* Use mock from the standard lib if available. * Migrate nose raises to pytest.raises. This touches a lot of code because pytest.raises is used in a context manager, so indentation has to be changed. Replacement happened with regex from @raises\((.*)\) to @pytest.mark.xfail(raises=$1) then from @pytest.mark.xfail\(raises=(.*)\)\ndef(.*) to def$2\n with pytest.raises($1): then manual correction of indentation. * Replace nose eq_ by assert, remove nottest. * Move CI from nosetests to pytest, adapt docs. Pin astroid version, too, to avoid wrong errors on CI. * Fix some introduced errors flagged by pylint. * Specify minimum pyserial requirement (see #58).
It has come to my attention that the test framework
nose
(includingnose2
) is not being as actively developed aspy.test
. It has a lot more features and nicer output. It also claims to support nose-tests straight out of the box. I believe the only thing we will need to do is replace anynose.eq_
calls with just straightassert
statements, as well as update travis & docs.https://github.com/pytest-dev/pytest/
http://pytest.org/latest/
Trello card: https://trello.com/c/VHzlJk2U/11-switch-test-framework-from-nose-to-py-test
Acceptance Criteria
The text was updated successfully, but these errors were encountered: