diff options
| author | Marius Gedminas <marius@gedmin.as> | 2013-02-15 08:37:37 +0200 |
|---|---|---|
| committer | Marius Gedminas <marius@gedmin.as> | 2013-02-15 08:39:33 +0200 |
| commit | 25fc9b2e2b6d78188132f5e3c5db2eeff6f20c7c (patch) | |
| tree | e2a38176892af71f6ea439ce50240d8a337e6e87 /src | |
| parent | 6a9a6cc89b86e829b792161f8b0f49284e0b5e27 (diff) | |
| download | zope-security-25fc9b2e2b6d78188132f5e3c5db2eeff6f20c7c.tar.gz | |
Fix nondeterministic test failures
This fixes three test failures I've seen on Python 3.3:
test_allow_w_single_interface
test_require_w_set_schema_normal_fields
test_require_w_single_interface
All caused by dictionary iteration returning items in a different order
than the test expected.
Diffstat (limited to 'src')
| -rw-r--r-- | src/zope/security/metaconfigure.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zope/security/metaconfigure.py b/src/zope/security/metaconfigure.py index 54484ac..e2dd0a0 100644 --- a/src/zope/security/metaconfigure.py +++ b/src/zope/security/metaconfigure.py @@ -109,7 +109,7 @@ class ClassDirective(object): def __protectByInterface(self, interface, permission_id): "Set a permission on names in an interface." - for n, d in interface.namesAndDescriptions(1): + for n, d in sorted(interface.namesAndDescriptions(1)): self.__protectName(n, permission_id) self.__context.action( discriminator = None, @@ -143,7 +143,7 @@ class ClassDirective(object): def __protectSetSchema(self, schema, permission_id): "Set a permission on a bunch of names." _context = self.__context - for name in schema: + for name in sorted(schema): field = schema[name] if IField.providedBy(field) and not field.readonly: _context.action( |
