<s> from __future__ import absolute_import , division , print_function , unicode_literals <EOL> from sys import version_info <EOL> import pytest <EOL> from pies . overrides import * <EOL> from frosted import messages as m <EOL> from . utils import flakes <EOL> def test_unusedImport ( ) : <EOL> flakes ( '<STR_LIT>' , m . UnusedImport , m . UnusedImport ) <EOL> flakes ( '<STR_LIT>' , m . UnusedImport , m . UnusedImport ) <EOL> def test_aliasedImport ( ) : <EOL> flakes ( '<STR_LIT>' , <EOL> m . RedefinedWhileUnused , m . UnusedImport ) <EOL> flakes ( '<STR_LIT>' , <EOL> m . RedefinedWhileUnused , m . UnusedImport ) <EOL> def test_usedImport ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_redefinedWhileUnused ( ) : <EOL> flakes ( '<STR_LIT>' , m . RedefinedWhileUnused ) <EOL> flakes ( '<STR_LIT>' , m . RedefinedWhileUnused ) <EOL> flakes ( '<STR_LIT>' , m . RedefinedWhileUnused ) <EOL> def test_redefinedIf ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_redefinedIfElse ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_redefinedTry ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_redefinedTryExcept ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_redefinedTryNested ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_redefinedTryExceptMulti ( ) : <EOL> flakes ( """<STR_LIT>""" ) <EOL> def test_redefinedTryElse ( ) : <EOL> flakes ( """<STR_LIT>""" , m . RedefinedWhileUnused ) <EOL> def test_redefinedTryExceptElse ( ) : <EOL> flakes ( """<STR_LIT>""" ) <EOL> def test_redefinedTryExceptFinally ( ) : <EOL> flakes ( """<STR_LIT>""" ) <EOL> def test_redefinedTryExceptElseFinally ( ) : <EOL> flakes ( """<STR_LIT>""" ) <EOL> def test_redefinedByFunction ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_redefinedInNestedFunction ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused , m . UnusedImport ) <EOL> def test_redefinedByClass ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_redefinedBySubclass ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_redefinedInClass ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInFunction ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_shadowedByParameter ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_newAssignment ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInGetattr ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' , m . UnusedImport ) <EOL> def test_usedInSlice ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInIfBody ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInIfConditional ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInElifConditional ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInElse ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInCall ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInClass ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInClassBase ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_notUsedInNestedScope ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInFor ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInForElse ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_redefinedByFor ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_shadowedByFor ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . ImportShadowedByLoopVar ) <EOL> def test_shadowedByForDeep ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . ImportShadowedByLoopVar ) <EOL> def test_usedInReturn ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInOperators ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInAssert ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInSubscript ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInLogic ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInList ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInTuple ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInTry ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInExcept ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_redefinedByExcept ( ) : <EOL> as_exc = '<STR_LIT:U+002CU+0020>' if version_info < ( <NUM_LIT:2> , <NUM_LIT:6> ) else '<STR_LIT>' <EOL> flakes ( '''<STR_LIT>''' % as_exc , m . RedefinedWhileUnused ) <EOL> def test_usedInRaise ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInYield ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInDict ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInParameterDefault ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInAttributeAssign ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInKeywordArg ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInAssignment ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInListComp ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_redefinedByListComp ( ) : <EOL> flakes ( '<STR_LIT>' , m . RedefinedWhileUnused ) <EOL> def test_usedInTryFinally ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInWhile ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_usedInGlobal ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport ) <EOL> @ pytest . mark . skipif ( "<STR_LIT>" ) <EOL> def test_usedInBackquote ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_usedInExec ( ) : <EOL> if version_info < ( <NUM_LIT:3> , ) : <EOL> exec_stmt = '<STR_LIT>' <EOL> else : <EOL> exec_stmt = '<STR_LIT>' <EOL> flakes ( '<STR_LIT>' % exec_stmt ) <EOL> def test_usedInLambda ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_shadowedByLambda ( ) : <EOL> flakes ( '<STR_LIT>' , m . UnusedImport ) <EOL> def test_usedInSliceObj ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_unusedInNestedScope ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport , m . UndefinedName ) <EOL> def test_methodsDontUseClassScope ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport , m . UndefinedName ) <EOL> def test_nestedFunctionsNestScope ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_nestedClassAndFunctionScope ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_importStar ( ) : <EOL> flakes ( '<STR_LIT>' , m . ImportStarUsed , ignore_frosted_errors = [ ] ) <EOL> def test_packageImport ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_unusedPackageImport ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '<STR_LIT>' , m . UnusedImport ) <EOL> def test_duplicateSubmoduleImport ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_differentSubmoduleImport ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_assignRHSFirst ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_tryingMultipleImports ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_nonGlobalDoesNotRedefine ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_functionsRunLater ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_functionNamesAreBoundNow ( ) : <EOL> flakes ( '''<STR_LIT>''' , m . RedefinedWhileUnused ) <EOL> def test_ignoreNonImportRedefinitions ( ) : <EOL> flakes ( '<STR_LIT>' ) <EOL> @ pytest . mark . skipif ( "<STR_LIT>" ) <EOL> def test_importingForImportError ( ) : <EOL> flakes ( '''<STR_LIT>''' ) <EOL> @ pytest . mark . skipif ( "<STR_LIT>" ) <EOL> def test_importedInClass ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_futureImport ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_futureImportFirst ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . LateFutureImport ) <EOL> flakes ( '''<STR_LIT>''' , m . LateFutureImport ) <EOL> def test_ignoredInFunction ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport , m . UnusedVariable ) <EOL> def test_ignoredInClass ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport ) <EOL> def test_warningSuppressed ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> def test_unrecognizable ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport ) <EOL> flakes ( '''<STR_LIT>''' , m . UnusedImport ) <EOL> def test_unboundExported ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . UndefinedExport ) <EOL> for filename in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> flakes ( '''<STR_LIT>''' , filename = filename , ** { '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] } ) <EOL> def test_importStarExported ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' , m . ImportStarUsed ) <EOL> def test_usedInGenExp ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '<STR_LIT>' ) <EOL> flakes ( '<STR_LIT>' ) <EOL> def test_redefinedByGenExp ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '<STR_LIT>' , m . RedefinedWhileUnused , m . UnusedImport ) <EOL> def test_usedAsDecorator ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' , m . UndefinedName ) <EOL> def test_usedAsClassDecorator ( ) : <EOL> """<STR_LIT>""" <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' ) <EOL> flakes ( '''<STR_LIT>''' , m . UndefinedName ) </s>
