Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

        def warnings_for_string(data, name=''):
    tool = WarnRefactoringTool(
        refactor.get_fixers_from_package(
            'py3kwarn2to3.fixes'))
    data += '\n'  # Silence certain parse errors
    tree = tool.refactor_string(data, name)
    if tree and tree.was_changed:
        tool.processed_file(unicode(tree), name, data)
        return sorted(tool.warnings, key=lambda warning: warning[0])
    return []
        


src/p/y/py3kwarn-0.4.4/py3kwarn/tests.py   py3kwarn(Download)
    def _test_code(self, name, casename=None):
        warnings = main.warnings_for_string(globals()['code_' + name], name)
 
        if not casename:
            casename = 'Fix' + name.title()
    def test_do_not_crash_on_unicode(self):
        main.warnings_for_string('u"å"')
 
    def test_main(self):
        main.main([os.path.join(os.path.dirname(__file__),

src/p/y/py3kwarn-HEAD/py3kwarn/tests.py   py3kwarn(Download)
    def _test_code(self, name, casename=None):
        warnings = main.warnings_for_string(globals()['code_' + name], name)
 
        if not casename:
            casename = 'Fix' + name.title()
    def test_do_not_crash_on_unicode(self):
        main.warnings_for_string('u"å"')
 
    def test_main(self):
        main.main([os.path.join(os.path.dirname(__file__),