New issue 562: @nose.tools.istest not respected
https://bitbucket.org/hpk42/pytest/issue/562/nosetoolsistest-not-respected

Tom V:

Given the [Supported nose 
Idioms](http://pytest.org/latest/nose.html#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? That would make the `istest` decorator redundant.


_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to