Skip to content

Commit

Permalink
don't use new zope.interface features where not available (python2.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Jun 27, 2014
1 parent f7a0e8f commit adf4f5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions master/buildbot/test/util/interfaces.py
Expand Up @@ -14,6 +14,9 @@
# Copyright Buildbot Team Members

import inspect
import pkg_resources

from twisted.trial import unittest


class InterfaceTests(object):
Expand Down Expand Up @@ -81,6 +84,13 @@ def assert_same_argspec_decorator(decorated):

def assertInterfacesImplemented(self, cls):
"Given a class, assert that the zope.interface.Interfaces are implemented to specification."

# see if this version of zope.interface is too old to run these tests
zi_vers = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('zope.interface')).version
if pkg_resources.parse_version(zi_vers) < pkg_resources.parse_version('4.1.1'):
raise unittest.SkipTest("zope.interfaces is too old to run this test")

import zope.interface.interface
for interface in zope.interface.implementedBy(cls):
for attr, template_argspec in interface.namesAndDescriptions():
Expand Down

0 comments on commit adf4f5a

Please sign in to comment.