Merge lp://qastaging/~cmiller/desktopcouch/test-from-setupdotpy into lp://qastaging/desktopcouch

Proposed by Chad Miller
Status: Merged
Approved by: Chad Miller
Approved revision: not available
Merged at revision: not available
Proposed branch: lp://qastaging/~cmiller/desktopcouch/test-from-setupdotpy
Merge into: lp://qastaging/desktopcouch
Diff against target: 39 lines (+24/-0)
2 files modified
runtests.py (+23/-0)
setup.py (+1/-0)
To merge this branch: bzr merge lp://qastaging/~cmiller/desktopcouch/test-from-setupdotpy
Reviewer Review Type Date Requested Status
Nicola Larosa (community) Approve
Ubuntu One hackers Pending
Review via email: mp+14998@code.qastaging.launchpad.net

Commit message

Make tests runnable from setuptools' setup.py 'test' rule.

To post a comment you must log in.
Revision history for this message
Nicola Larosa (teknico) wrote :

Ooh, you're an angel. You make this grumpy old chap's heart melt. ;-) Thank you.

However, since I'm a grumpy old chap, I'll mutter in a low voice that when I run tests with "trail desktopcouch", I get a nice green column of [OK]; it's not there anymore when running "setup.py test", though.

Can you get that back too? :-)

review: Approve
Revision history for this message
Chad Miller (cmiller) wrote :

> When I
> run tests with "trail desktopcouch", I get a nice green column of [OK]; it's
> not there anymore when running "setup.py test", though.
>
> Can you get that back too? :-)

Sorry, no. That's a different test runner. All I provide to setuputils is the test suite.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'runtests.py'
--- runtests.py 1970-01-01 00:00:00 +0000
+++ runtests.py 2009-11-18 16:25:22 +0000
@@ -0,0 +1,23 @@
1#!/usr/bin/python
2
3import os, sys
4from twisted.trial import runner, itrial, reporter
5
6dir, filename = os.path.split(__file__)
7sys.path.insert(0, os.path.realpath(dir))
8
9def get_test_suite():
10 loader = runner.TestLoader()
11 return loader.loadByNames(['desktopcouch'], True)
12
13def run():
14 test_runner = runner.TrialRunner(reporter.TreeReporter)
15 test_result = test_runner.run(get_test_suite())
16 return test_result.wasSuccessful()
17
18if __name__ == '__main__':
19 import gobject
20 gobject.set_application_name("desktopcouch test runner")
21
22 ret = run()
23 sys.exit(not ret)
024
=== modified file 'setup.py'
--- setup.py 2009-10-22 20:52:56 +0000
+++ setup.py 2009-11-18 16:25:22 +0000
@@ -28,6 +28,7 @@
28 license='LGPL-3',28 license='LGPL-3',
29 author='Stuart Langridge',29 author='Stuart Langridge',
30 author_email='stuart.langridge@canonical.com',30 author_email='stuart.langridge@canonical.com',
31 test_suite="runtests.get_test_suite",
31 packages=find_packages(),32 packages=find_packages(),
32 scripts=['bin/desktopcouch-pair'],33 scripts=['bin/desktopcouch-pair'],
33 data_files = [('/usr/lib/desktopcouch/', ['bin/desktopcouch-service',34 data_files = [('/usr/lib/desktopcouch/', ['bin/desktopcouch-service',

Subscribers

People subscribed via source and target branches