Rev 395: Bring in the test-suite updates in http://bzr.arbash-meinel.com/branches/bzr/bzr-builddeb/changelog-hook
John Arbash Meinel
john at arbash-meinel.com
Thu Jan 28 11:14:20 GMT 2010
At http://bzr.arbash-meinel.com/branches/bzr/bzr-builddeb/changelog-hook
------------------------------------------------------------
revno: 395 [merge]
revision-id: john at arbash-meinel.com-20100128111357-ytzsamq9c0xa3113
parent: john at arbash-meinel.com-20100128102646-6mrjzwfexd9wibh3
parent: john at arbash-meinel.com-20100128111125-562zkvewykc6jzl1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: changelog-hook
timestamp: Thu 2010-01-28 05:13:57 -0600
message:
Bring in the test-suite updates
modified:
__init__.py __init__.py-20051118014441-2307aeda5d9b3cae
tests/__init__.py __init__.py-20070227200631-dcfgd9vfbozyyhhi-2
tests/blackbox/__init__.py __init__.py-20070913213241-vl9d26kbbgn8565r-2
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py 2009-08-25 20:20:10 +0000
+++ b/__init__.py 2010-01-28 11:11:25 +0000
@@ -34,7 +34,6 @@
)
commands = {
- "test_builddeb": [],
"builddeb": ["bd"],
"merge_upstream": ["mu"],
"import_dsc": [],
@@ -120,17 +119,5 @@
SPEC_TYPES.append(RevisionSpec_package)
-def test_suite():
- from unittest import TestSuite
- from bzrlib.plugins.builddeb import tests
- result = TestSuite()
- result.addTest(tests.test_suite())
- return result
-
-
-if __name__ == '__main__':
- print ("This is a Bazaar plugin. Copy this directory to ~/.bazaar/plugins "
- "to use it.\n")
- import unittest
- runner = unittest.TextTestRunner()
- runner.run(test_suite())
+def load_tests(standard_tests, module, loader):
+ return loader.loadTestsFromModuleNames(['bzrlib.plugins.builddeb.tests'])
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2009-08-19 09:56:50 +0000
+++ b/tests/__init__.py 2010-01-28 11:11:25 +0000
@@ -28,12 +28,13 @@
import os
from unittest import TestSuite
+from bzrlib.lazy_import import lazy_import
+lazy_import(globals(), """
from debian_bundle.changelog import Version, Changelog
+""")
from bzrlib.tests import TestUtil, multiply_tests, TestCaseWithTransport
-from bzrlib.plugins.builddeb.tests import blackbox
-
def make_new_upstream_dir(source, dest):
os.rename(source, dest)
@@ -109,10 +110,10 @@
return result
-def test_suite():
- loader = TestUtil.TestLoader()
- suite = TestSuite()
+def load_tests(standard_tests, module, loader):
+ suite = loader.suiteClass()
testmod_names = [
+ 'blackbox',
'test_builder',
'test_commit_message',
'test_config',
@@ -149,15 +150,9 @@
old_tarball='../package-0.2.tar')),
]
suite = multiply_tests(repack_tarball_tests, scenarios, suite)
- packages_to_test = [
- blackbox,
- ]
-
- for package in packages_to_test:
- suite.addTest(package.test_suite())
-
return suite
+
class BuilddebTestCase(TestCaseWithTransport):
package_name = 'test'
=== modified file 'tests/blackbox/__init__.py'
--- a/tests/blackbox/__init__.py 2009-08-28 16:39:39 +0000
+++ b/tests/blackbox/__init__.py 2010-01-28 11:11:25 +0000
@@ -21,7 +21,7 @@
from bzrlib.tests import TestUtil
-def test_suite():
+def load_tests(standard_tests, module, loader):
testmod_names = [
'test_builddeb',
'test_do',
@@ -30,7 +30,6 @@
'test_merge_package',
'test_merge_upstream',
]
- loader = TestUtil.TestLoader()
suite = loader.loadTestsFromModuleNames(["%s.%s" % (__name__, i)
for i in testmod_names])
return suite
More information about the bazaar-commits
mailing list