From ad89dfc565e8e5910a3ff7ba35f36752eb49cca2 Mon Sep 17 00:00:00 2001 From: hpk Date: Sun, 21 Sep 2008 08:40:54 +0200 Subject: [PATCH] [svn r58284] make sure that "test" prefix is enough. --HG-- branch : trunk --- contrib/py_unittest/conftest.py | 3 +-- contrib/py_unittest/readme.txt | 3 ++- contrib/py_unittest/test_conftest.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/py_unittest/conftest.py b/contrib/py_unittest/conftest.py index 8582e00f2..e798b4791 100644 --- a/contrib/py_unittest/conftest.py +++ b/contrib/py_unittest/conftest.py @@ -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': diff --git a/contrib/py_unittest/readme.txt b/contrib/py_unittest/readme.txt index d19c4e02f..d185d6fde 100644 --- a/contrib/py_unittest/readme.txt +++ b/contrib/py_unittest/readme.txt @@ -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 diff --git a/contrib/py_unittest/test_conftest.py b/contrib/py_unittest/test_conftest.py index 402b3b13b..a1d1e91c9 100644 --- a/contrib/py_unittest/test_conftest.py +++ b/contrib/py_unittest/test_conftest.py @@ -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):