Ejemplo n.º 1
0
 def test_collect_no_collect(self):
     # bug http://nose.python-hosting.com/ticket/55
     # we got "iteration over non-sequence" when no files match
     here = os.path.abspath(os.path.dirname(__file__))
     support = os.path.join(here, 'support')
     plug = Doctest()
     for test in plug.loadTestsFromFile(os.path.join(support, 'foo')):
         self.fail("Expected no tests, got %s" % test)
 def test_collect_no_collect(self):
     # bug http://nose.python-hosting.com/ticket/55
     # we got "iteration over non-sequence" when no files match
     here = os.path.abspath(os.path.dirname(__file__))
     support = os.path.join(here, 'support')
     plug = Doctest()
     for test in plug.loadTestsFromFile(os.path.join(support, 'foo')):
         self.fail("Expected no tests, got %s" % test)
Ejemplo n.º 3
0
    def test_collect_txtfile(self):
        here = os.path.abspath(os.path.dirname(__file__))
        support = os.path.join(here, 'support')
        fn = os.path.join(support, 'foo', 'doctests.txt')

        conf = Config()
        opt = Bucket()
        plug = Doctest()
        plug.can_configure = True
        plug.configure(opt, conf)
        plug.extension = ['.txt']
        suite = plug.loadTestsFromFile(fn)
        for test in suite:
            assert str(test).endswith('doctests.txt')
            assert test.address(), "Test %s has no address"
    def test_collect_txtfile(self):
        here = os.path.abspath(os.path.dirname(__file__))
        support = os.path.join(here, 'support')
        fn = os.path.join(support, 'foo', 'doctests.txt')

        conf = Config()
        opt = Bucket()
        plug = Doctest()
        plug.can_configure = True
        plug.configure(opt, conf)
        plug.extension = ['.txt']
        suite = plug.loadTestsFromFile(fn)
        for test in suite:
            assert str(test).endswith('doctests.txt')
            assert test.address(), "Test %s has no address"