Merge lp:~stefanor/ibid/setup-test into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
Approved revision: 1018
Merged at revision: 1021
Proposed branch: lp:~stefanor/ibid/setup-test
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 70 lines (+15/-3)
2 files modified
ibid/test/__init__.py (+14/-3)
setup.py (+1/-0)
To merge this branch: bzr merge lp:~stefanor/ibid/setup-test
Reviewer Review Type Date Requested Status
Max Rabkin Approve
Jonathan Hitchcock Approve
Review via email: mp+51458@code.launchpad.net

Commit message

Add test hook to setup.py

To post a comment you must log in.
Revision history for this message
Max Rabkin (max-rabkin) wrote :

This conflicts with testing-framework.

review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve
Revision history for this message
Ibid Branch Auto-Lander (ibid-tarmac) wrote :

Attempt to merge into lp:ibid failed due to conflicts:

text conflict in ibid/test/__init__.py

Revision history for this message
Ibid Branch Auto-Lander (ibid-tarmac) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Max Rabkin (max-rabkin) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/test/__init__.py'
2--- ibid/test/__init__.py 2011-02-01 15:55:56 +0000
3+++ ibid/test/__init__.py 2011-03-15 10:02:27 +0000
4@@ -1,6 +1,6 @@
5-# Copyright (c) 2009-2011, Jeremy Thurgood, Max Rabkin
6+# Copyright (c) 2009-2011, Jeremy Thurgood, Max Rabkin, Stefano Rivera
7 # Released under terms of the MIT/X/Expat Licence. See COPYING for details.
8-import atexit
9+
10 import logging
11 import os
12 from traceback import format_exception
13@@ -20,6 +20,7 @@
14 from ibid.config import FileConfig
15 from ibid.utils import locate_resource
16
17+
18 # Trial collects log output, so we feed ours logs into it.
19 class TwistedLogHandler(logging.Handler):
20 def emit(self, record):
21@@ -42,14 +43,15 @@
22 def __setattr__(self, name, value):
23 self[name] = value
24
25-
26 def set_config(config):
27 ibid.config = FakeConfig(config)
28
29+
30 class TestAuth(object):
31 def authorise(self, event, permission):
32 return True
33
34+
35 class TestSource(object):
36 type = 'test'
37 permissions = []
38@@ -67,6 +69,7 @@
39 def url(self):
40 return None
41
42+
43 class PluginTestCase(unittest.TestCase):
44 load = []
45 noload = []
46@@ -212,4 +215,12 @@
47 ibid.databases.ibid().bind.engine.dispose()
48 os.unlink(self.dbfile)
49
50+
51+def run():
52+ "Run the Ibid test suite. Bit of a hack"
53+ from twisted.scripts.trial import run
54+ import sys
55+ sys.argv.append('ibid')
56+ run()
57+
58 # vi: set et sta sw=4 ts=4:
59
60=== modified file 'setup.py'
61--- setup.py 2011-03-13 15:12:28 +0000
62+++ setup.py 2011-03-15 10:02:27 +0000
63@@ -65,6 +65,7 @@
64 'scripts/ibid-setup',
65 'scripts/ibid.tac',
66 ],
67+ test_suite='ibid.test.run',
68
69 include_package_data=True,
70 zip_safe=False,

Subscribers

People subscribed via source and target branches