[conduit: 74/138] Allow filtering on specific methodTestNames (not just TestCase.name())
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit: 74/138] Allow filtering on specific methodTestNames (not just TestCase.name())
- Date: Thu, 21 May 2009 03:33:09 -0400 (EDT)
commit e677bb8261d000862ca1c160442b7219c84854ed
Author: John Carr <john carr unrouted co uk>
Date: Sun May 3 10:47:52 2009 -0700
Allow filtering on specific methodTestNames (not just TestCase.name())
---
test/soup/__init__.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/soup/__init__.py b/test/soup/__init__.py
index 4a14d18..5348ff3 100644
--- a/test/soup/__init__.py
+++ b/test/soup/__init__.py
@@ -38,9 +38,13 @@ class TestCase(unittest.TestCase):
self.testMethod = getattr(self, methodName)
@classmethod
- def name(self):
+ def name(cls):
""" Returns the name of the class. We need to override this on generated classes """
- return self.__class__.__name__
+ return cls.__name__
+
+ def id(self):
+ """ Returns the name of the class and the test this particular instance will run """
+ return self.name() + "." + self.testMethodName
def shortDescription(self):
""" Describe the test that is currently running
@@ -200,14 +204,14 @@ class TestLoader(unittest.TestLoader):
if len(self.include) > 0:
is_included = False
for i in self.include:
- if i in test.name():
+ if i in test.id():
is_included = True
if not is_included:
continue
if len(self.exclude) > 0:
is_excluded = False
for x in self.exclude:
- if x in test.name():
+ if x in test.id():
is_excluded = True
if is_excluded:
continue
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]