-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
nose compatibility problem with yield-base tests #1716
Comments
I know that I can rewrite my class in order to make it work with pytest (using The quickest way to fix it would be to amend the documentation, to make it clear that compatibility is restricted to generator functions, but that generator methods are not supported. |
Also add nose doc to the root toctree Closes pytest-dev#1716
Also add nose doc to the root toctree Closes pytest-dev#1716
Also add nose doc to the root toctree Closes pytest-dev#1716
is there anywhere documented how to migrate "nose2 type of tests that yield self.assert* and each yield is collected as a separate test" into pytest? |
I wrote a test class for node, using yield-base tests, and it does not behave as expected with py-test 2.9.2.
Consider the following class:
When I run it with
nosetests -qs
, all four tests (1test_a
and 3test_b
's) pass. For each of them,setup
andteardown
are called, as can be seen from the output:When I run the tests with
py.test -qs
, onlytest_a
passes, all 3test_b
's fail on theassert
in_do_test_b
. The output is:We can see that the three
test_b
's are run on the same instance, which is not consistent with Nose. Worse,setup
is not even called on that instance, instead it is called on the instance that was previously used to runtest_a
, which does not make much sense... Finally,teardown
is never called fortest_b
.The text was updated successfully, but these errors were encountered: