def _setUpConfig(self, content): tox_ini_path = os.path.join( self.useFixture(fixtures.TempDir()).path, 'tox.ini') with open(tox_ini_path, 'w') as tox_ini: tox_ini.write(content) return config.Config('hacking', tox_ini_path)
def setUp(self): tox_ini_path = os.path.join(self.useFixture(fixtures.TempDir()).path, 'tox.ini') with open(tox_ini_path, 'w') as tox_ini: tox_ini.write(TEST_TOX_INI) self.conf = config.Config('hacking', tox_ini_path) super(ConfigTest, self).setUp()
# Error code block layout #H1xx comments #H20x except #H23x Python 2.x -> 3.x portability issues #H3xx imports #H4xx docstrings #H5xx dictionaries/lists #H6xx calling methods #H7xx localization #H8xx git commit messages #H9xx other CONF = config.Config('hacking') DEFAULT_IMPORT_EXCEPTIONS = [ 'sqlalchemy', 'migrate', ] IMPORT_EXCEPTIONS = CONF.get_multiple('import_exceptions', default=[]) IMPORT_EXCEPTIONS += DEFAULT_IMPORT_EXCEPTIONS # Paste is missing a __init__ in top level directory START_DOCSTRING_TRIPLE = ['u"""', 'r"""', '"""', "u'''", "r'''", "'''"] END_DOCSTRING_TRIPLE = ['"""', "'''"] def is_import_exception(mod):