def test_libref_examples(self):
        s = """
        Examples from the Library Reference:  Doc/lib/libgetopt.tex

        An example using only Unix style options:


        >>> import getopt
        >>> args = '-a -b -cfoo -d bar a1 a2'.split()
        >>> args
        ['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']
        >>> optlist, args = getopt.getopt(args, 'abc:d:')
        >>> optlist
        [('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]
        >>> args
        ['a1', 'a2']

        Using long option names is equally easy:


        >>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'
        >>> args = s.split()
        >>> args
        ['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']
        >>> optlist, args = getopt.getopt(args, 'x', [
        ...     'condition=', 'output-file=', 'testing'])
        >>> optlist
        [('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')]
        >>> args
        ['a1', 'a2']
        """

        import types
        m = types.ModuleType("libreftest", s)
        run_doctest(m, verbose)
def test_main(verbose=None):
    import sys
    test_classes = (
        TestBasic,
        TestVariousIteratorArgs,
        TestSubclass,
        TestSubclassWithKwargs,
        TestSequence,
    )

    support.run_unittest(*test_classes)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in range(len(counts)):
            support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print(counts)

    # doctests
    from sql_mode import test_deque
    support.run_doctest(test_deque, verbose)
def test_main(verbose=None):
    from sql_mode import test_code
    run_doctest(test_code, verbose)
    tests = [CodeTest, CodeConstsTest, CodeWeakRefTest]
    if check_impl_detail(cpython=True):
        tests.append(CoExtra)
    run_unittest(*tests)
Ejemplo n.º 4
0
def test_main(verbose=None):
    # Obscure:  import this module as test.test_descrtut instead of as
    # plain test_descrtut because the name of this module works its way
    # into the doctest examples, and unless the full test.test_descrtut
    # business is used the name can change depending on how the test is
    # invoked.
    from sql_mode import support, test_descrtut
    support.run_doctest(test_descrtut, verbose)
def test_main(verbose=None):
    from sql_mode import support
    from sql_mode import test_genexps
    support.run_doctest(test_genexps, verbose)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in range(len(counts)):
            support.run_doctest(test_genexps, verbose)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print(counts)
def test_main():
    from sql_mode import test_doctest2
    EXPECTED = 19
    f, t = support.run_doctest(test_doctest2)
    if t != EXPECTED:
        raise support.TestFailed("expected %d tests to run, not %d" %
                                 (EXPECTED, t))
Ejemplo n.º 7
0
def test_main():
    run_unittest(CookieTests, MorselTests)
    run_doctest(cookies)
def test_main():
    support.run_unittest(SyntaxTestCase)
    from sql_mode import test_syntax
    support.run_doctest(test_syntax, verbosity=True)
def test_main(verbose=None):
    from sql_mode import test_cmd
    support.run_doctest(test_cmd, verbose)
    support.run_unittest(TestAlternateInput)
Ejemplo n.º 10
0
def test_main(verbose=False):
    from sql_mode import support
    from sql_mode import test_unpack_ex
    support.run_doctest(test_unpack_ex, verbose)
Ejemplo n.º 11
0
def test_main(verbose=False):
    from sql_mode import support
    from sql_mode import test_metaclass
    support.run_doctest(test_metaclass, verbose)
def test_main():
    support.run_unittest(OptimizedPickleTests)
    support.run_unittest(MiscTestCase)
    support.run_doctest(pickletools)
def test_main():
    support.run_doctest(sys.modules[__name__], True)