diff options
author | John Doe <jdoe@example.com> | 2009-06-14 14:34:11 +1000 |
---|---|---|
committer | John Doe <jdoe@example.com> | 2009-06-14 14:34:11 +1000 |
commit | b0c7c274d394ccfba2ea84fa6e9785f41f4cddd8 (patch) | |
tree | 2fa7b24b86aa2151d62400afabf908bda72cd5bc /libbe/bzr.py | |
parent | a711ecf10df62e30d83c1941065404c53fecd35b (diff) | |
download | bugseverywhere-b0c7c274d394ccfba2ea84fa6e9785f41f4cddd8.tar.gz |
Make RCS testcase subclasses dynamically.
Diffstat (limited to 'libbe/bzr.py')
-rw-r--r-- | libbe/bzr.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libbe/bzr.py b/libbe/bzr.py index a0ae715..4a01d8a 100644 --- a/libbe/bzr.py +++ b/libbe/bzr.py @@ -14,12 +14,15 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import sys import os import re import unittest import doctest -from rcs import RCS, RCStestCase, CommandError +import rcs +from rcs import RCS def new(): return Bzr() @@ -79,7 +82,7 @@ class Bzr(RCS): def postcommit(self): try: self._u_invoke_client('merge') - except CommandError, e: + except rcs.CommandError, e: if ('No merge branch known or specified' in e.err_str or 'No merge location known or specified' in e.err_str): pass @@ -91,8 +94,8 @@ class Bzr(RCS): if len(self._u_invoke_client('status', directory=directory)[1]) > 0: self.commit('Merge from upstream') -class BzrTestCase(RCStestCase): - Class = Bzr + +rcs.make_rcs_testcase_subclasses(Bzr, sys.modules[__name__]) -unitsuite = unittest.TestLoader().loadTestsFromTestCase(BzrTestCase) +unitsuite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) suite = unittest.TestSuite([unitsuite, doctest.DocTestSuite()]) |