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

@nose.tools.istest not respected #562

Closed
pytestbot opened this issue Aug 10, 2014 · 5 comments
Closed

@nose.tools.istest not respected #562

pytestbot opened this issue Aug 10, 2014 · 5 comments
Labels
good first issue easy issue that is friendly to new contributor type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Tom V (BitBucket: tomviner, GitHub: tomviner)


Given the Supported nose Idioms page says pytest supports: __test__ attribute on modules/classes/functions I assumed the following test would be collected:

@nose.tools.istest
def toast_stuff():
    assert 0

Full script with the final test showing that the attribute __test__ is successfully set on the toast_stuff function

import nose.tools

def not_nose():
    assert 0

@nose.tools.istest
def toast_stuff():
    assert 0

def test_attributes():
    assert not hasattr(not_nose, '__test__')
    assert toast_stuff.__test__


$ py.test test_nose.py -v
=== test session starts ===
platform linux2 -- Python 2.7.6 -- py-1.4.23 -- pytest-2.6.1
collected 1 items 

test_nose.py::test_attributes PASSED

=== 1 passed in 0.03 seconds ===

Am I misunderstanding the docs, and test must also meet the usual name prefix criteria? But I can confirm that nose does find the toast_stuff test:

$ nosetests test_nose.py -v
test_nose.toast_stuff ... FAIL

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
@RonnyPfannschmidt RonnyPfannschmidt added the good first issue easy issue that is friendly to new contributor label Jul 25, 2015
@RonnyPfannschmidt
Copy link
Member

teaching the nose plugin to consider functions with the test markers should be a matter of a few lines

@tomviner
Copy link
Contributor

ok, will have a go at a fix

@tomviner
Copy link
Contributor

tomviner commented Aug 6, 2015

@RonnyPfannschmidt have a look at my PR #921

In particular, are you still thinking this could have been done in the nose plugin rather than core python.py?

RonnyPfannschmidt added a commit that referenced this issue Aug 9, 2015
Issue #562 - Ensure @nose.tools.istest is respected
@tomviner
Copy link
Contributor

tomviner commented Aug 9, 2015

This issue was resolved by the merge of #921

Its a pull in from bitbucket so it's owned by @pytestbot not me. Please close.

@RonnyPfannschmidt
Copy link
Member

thanks for the note :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

3 participants