def globs(test):
    """
    Return the globals for *test*, which can be a `doctest`
    or a regular `unittest.TestCase`.
    """
    try:
        return test.globs
    except AttributeError:
        return test.__dict__