marks do not work for unittest style test cases

Issue #135 resolved
Anonymous created an issue

With py.test 1.3.4 on python 2.5 (Debian Lenny):

{{{

!python

import py import unittest

class TestSimple: pytestmark = py.test.mark.simple

def test_answer(self):
    assert 41 + 1 == 42

def test_answer2(self):
    assert 41 + 1 == 41

class UnittestTestCase(unittest.TestCase): pytestmark = py.test.mark.unittest def test01(self): pass

def test02(self):
    self.fail()

}}}

py.test => 2 failed, 2 passed (as expected) py.test -k simple => 1 failed, 1 passed, 2 deselected (as expected)

BUT

py.test -k unittest => 4 deselected (expected 1 failed, 1 passed, 2 deselected)

Comments (2)

  1. Holger Krekel repo owner

    thanks for the report. I think i fixed this in the ongoing development branch (which has better unittest support). could you try with

    pip install -i http://pypi.testrun.org -U pytest 
    

    and then run with your test file?

    Also am curious: do you plan to actually mix pytest and unittest-style tests like you did in your example? If not how do you plan to "mix"?

    cheers, holger

  2. Log in to comment