/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_source.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-21 06:03:07 UTC
  • mfrom: (4665.7.3 serve-init)
  • Revision ID: pqm@pqm.ubuntu.com-20091221060307-uvja3vdy1o6dzzy0
(mbp) example debian init script

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
2
 
#   Authors: Robert Collins <robert.collins@canonical.com>
3
 
#            and others
 
1
# Copyright (C) 2005, 2006, 2008, 2009 Canonical Ltd
4
2
#
5
3
# This program is free software; you can redistribute it and/or modify
6
4
# it under the terms of the GNU General Public License as published by
42
40
 
43
41
# Files which are listed here will be skipped when testing for Copyright (or
44
42
# GPL) statements.
45
 
COPYRIGHT_EXCEPTIONS = ['bzrlib/lsprof.py', 'bzrlib/_bencode_py.py']
 
43
COPYRIGHT_EXCEPTIONS = ['bzrlib/lsprof.py', 'bzrlib/_bencode_py.py',
 
44
    'bzrlib/doc_generate/sphinx_conf.py']
46
45
 
47
 
LICENSE_EXCEPTIONS = ['bzrlib/lsprof.py', 'bzrlib/_bencode_py.py']
 
46
LICENSE_EXCEPTIONS = ['bzrlib/lsprof.py', 'bzrlib/_bencode_py.py',
 
47
    'bzrlib/doc_generate/sphinx_conf.py']
48
48
# Technically, 'bzrlib/lsprof.py' should be 'bzrlib/util/lsprof.py',
49
49
# (we do not check bzrlib/util/, since that is code bundled from elsewhere)
50
50
# but for compatibility with previous releases, we don't want to move it.
 
51
#
 
52
# sphinx_conf is semi-autogenerated.
51
53
 
52
54
 
53
55
class TestSourceHelper(TestCase):
357
359
                    return True
358
360
            return False
359
361
        badfiles = []
 
362
        assert_re = re.compile(r'\bassert\b')
360
363
        for fname, text in self.get_source_file_contents():
361
364
            if not self.is_our_code(fname):
362
365
                continue
363
 
            ast = parser.ast2tuple(parser.suite(''.join(text)))
 
366
            if not assert_re.search(text):
 
367
                continue
 
368
            ast = parser.ast2tuple(parser.suite(text))
364
369
            if search(ast):
365
370
                badfiles.append(fname)
366
371
        if badfiles: