Ejemplo n.º 1
0
def load_tests(loader, tests, ignore):
    """Run our main documentation as a test, plus all test functions."""

    from sgp4.wulfgar import add_test_functions
    add_test_functions(loader, tests, __name__)

    # Python 2.6 formats floating-point numbers a bit differently and
    # breaks the doctest, so we only run the doctest on later versions.
    if sys.version_info >= (2, 7):
        tests.addTests(DocTestSuite('sgp4', optionflags=ELLIPSIS))
        tests.addTests(DocTestSuite('sgp4.functions', optionflags=ELLIPSIS))

    return tests
Ejemplo n.º 2
0
def load_tests(loader, tests, ignore):
    """Run our main documentation as a test, plus all test functions."""

    from sgp4.wulfgar import add_test_functions
    add_test_functions(loader, tests, __name__)

    # Python 2.6 formats floating-point numbers a bit differently and
    # breaks the doctest, so we only run the doctest on later versions.
    if sys.version_info >= (2, 7):

        def setCwd(suite):
            suite.olddir = os.getcwd()
            os.chdir(os.path.dirname(__file__))
        def restoreCwd(suite):
            os.chdir(suite.olddir)

        options = dict(optionflags=ELLIPSIS, setUp=setCwd, tearDown=restoreCwd)
        tests.addTests(DocTestSuite('sgp4', **options))
        tests.addTests(DocTestSuite('sgp4.conveniences', **options))
        tests.addTests(DocTestSuite('sgp4.functions', **options))

    return tests