'Custom assertion that checks a circular dependency is detected correctly.'

def assertCircularDependency(self, trace, target, graph):

    self.assertRaises(exceptions.CircularDependency, depends, target, (lambda n: graph[n]))
    try:
        depends(target, (lambda n: graph[n]))
    except exceptions.CircularDependency as e:
        self.assertEqual(trace, e.trace)
