Skip to content

@nose.tools.istest not respected #562

Closed
@pytestbot

Description

@pytestbot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions