[svn r58284] make sure that "test" prefix is enough.

--HG--
branch : trunk
This commit is contained in:
hpk 2008-09-21 08:40:54 +02:00
parent 94f1abbbb0
commit ad89dfc565
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,6 @@
import py
import unittest
import sys
from py.__.test.collect import configproperty as _configproperty
unittest.failureException = AssertionError
def configproperty(name):
@ -13,7 +12,7 @@ def configproperty(name):
class Module(py.test.collect.Module):
UnitTestCase = configproperty('UnitTestCase')
def makeitem(self, name, obj, usefilters=True):
# XXX add test_suite() support(?)
# XXX add generic test_suite() support(?)
if py.std.inspect.isclass(obj) and issubclass(obj, unittest.TestCase):
return self.UnitTestCase(name, parent=self)
elif callable(obj) and getattr(obj, 'func_name', '') == 'test_suite':

View File

@ -1,4 +1,5 @@
code for collecting traditional unit tests based on
code for collecting traditional unit tests.
This conftest is based on
http://johnnydebris.net/svn/projects/py_unittest

View File

@ -13,11 +13,11 @@ class TestTestCaseInstance(suptest.InlineSession):
test_one = self.makepyfile(test_one="""
import unittest
class MyTestCase(unittest.TestCase):
def test_passing(self):
def testpassing(self):
self.assertEquals('foo', 'foo')
""")
sorter = self.parse_and_run(test_one)
rep = sorter.getreport("test_passing")
rep = sorter.getreport("testpassing")
assert rep.passed
def test_simple_failing(self):