Merge lp:~allenap/storm/has-zope-security-bug-848848 into lp:storm

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: 403
Merged at revision: 406
Proposed branch: lp:~allenap/storm/has-zope-security-bug-848848
Merge into: lp:storm
Diff against target: 116 lines (+20/-12)
5 files modified
test (+5/-2)
tests/twisted/transact.py (+3/-3)
tests/zope/__init__.py (+8/-3)
tests/zope/testing.py (+3/-3)
tests/zope/zstorm.py (+1/-1)
To merge this branch: bzr merge lp:~allenap/storm/has-zope-security-bug-848848
Reviewer Review Type Date Requested Status
Jamu Kakar (community) Approve
Storm Developers Pending
Review via email: mp+75152@code.launchpad.net

Commit message

Skip tests/zope/README.txt when zope.security is not found.

Description of the change

Checks for zope.security - which is needed by tests/zope/README.txt -
and also ditches the has_zope variable because it covered too much
ground.

To post a comment you must log in.
Revision history for this message
Jamu Kakar (jkakar) wrote :

Good catch, +1!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test'
2--- test 2009-11-09 03:26:09 +0000
3+++ test 2011-09-13 10:46:23 +0000
4@@ -68,8 +68,11 @@
5 if relpath == os.path.join("tests", "zope", "README.txt"):
6 # Special case the inclusion of the Zope-dependent
7 # ZStorm doctest.
8- from tests.zope import has_zope
9- load_test = has_zope
10+ import tests.zope as ztest
11+ load_test = (
12+ ztest.has_transaction and
13+ ztest.has_zope_component and
14+ ztest.has_zope_security)
15 if load_test:
16 parent_path = os.path.dirname(relpath).replace(
17 os.path.sep, ".")
18
19=== modified file 'tests/twisted/transact.py'
20--- tests/twisted/transact.py 2011-05-04 14:16:28 +0000
21+++ tests/twisted/transact.py 2011-09-13 10:46:23 +0000
22@@ -2,10 +2,10 @@
23 import random
24
25 from tests.helper import TestHelper
26-from tests.zope import has_zope
27+from tests.zope import has_transaction, has_zope_component
28 from tests.twisted import (has_twisted, has_psycopg)
29
30-if has_zope and has_twisted:
31+if has_transaction and has_zope_component and has_twisted:
32 import transaction
33
34 from twisted.trial.unittest import TestCase
35@@ -28,7 +28,7 @@
36 class TransactorTest(TestCase, TestHelper):
37
38 def is_supported(self):
39- return has_zope and has_twisted
40+ return has_transaction and has_zope_component and has_twisted
41
42 def setUp(self):
43 TestCase.setUp(self)
44
45=== modified file 'tests/zope/__init__.py'
46--- tests/zope/__init__.py 2010-08-31 08:33:09 +0000
47+++ tests/zope/__init__.py 2011-09-13 10:46:23 +0000
48@@ -20,8 +20,8 @@
49
50 __all__ = [
51 'has_transaction',
52- 'has_zope',
53 'has_zope_component',
54+ 'has_zope_security',
55 'has_testresources',
56 ]
57
58@@ -40,10 +40,15 @@
59 has_zope_component = True
60
61 try:
62+ import zope.security
63+except ImportError:
64+ has_zope_security = False
65+else:
66+ has_zope_security = True
67+
68+try:
69 import testresources
70 except ImportError:
71 has_testresources = False
72 else:
73 has_testresources = True
74-
75-has_zope = has_transaction and has_zope_component
76
77=== modified file 'tests/zope/testing.py'
78--- tests/zope/testing.py 2011-08-16 10:00:16 +0000
79+++ tests/zope/testing.py 2011-09-13 10:46:23 +0000
80@@ -22,12 +22,12 @@
81 import sys
82
83 from tests.helper import TestHelper
84-from tests.zope import has_zope, has_testresources
85+from tests.zope import has_transaction, has_zope_component, has_testresources
86
87 from storm.locals import create_database, Store, Unicode, Int
88 from storm.exceptions import IntegrityError
89
90-if has_zope and has_testresources:
91+if has_transaction and has_zope_component and has_testresources:
92 from zope.component import provideUtility, getUtility
93 from storm.zope.zstorm import ZStorm
94 from storm.zope.interfaces import IZStorm
95@@ -44,7 +44,7 @@
96 class ZStormResourceManagerTest(TestHelper):
97
98 def is_supported(self):
99- return has_zope and has_testresources
100+ return has_transaction and has_zope_component and has_testresources
101
102 def setUp(self):
103 super(ZStormResourceManagerTest, self).setUp()
104
105=== modified file 'tests/zope/zstorm.py'
106--- tests/zope/zstorm.py 2010-07-01 17:47:01 +0000
107+++ tests/zope/zstorm.py 2011-09-13 10:46:23 +0000
108@@ -266,7 +266,7 @@
109 class ZStormUtilityTest(TestHelper):
110
111 def is_supported(self):
112- return has_zope_component
113+ return has_transaction and has_zope_component
114
115 def test_utility(self):
116 provideUtility(ZStorm())

Subscribers

People subscribed via source and target branches

to status/vote changes: