#NEWLINE# def test_nested_doctest_ignored( self ) : #NEWLINE# #INDENT# 'Check that nested doctests are ignored.' #NEWLINE# checker = self . flakes ( '\n        m = None\n\n        def doctest_stuff():\n            \'\'\'\n                >>> def function_in_doctest():\n                ...     """\n                ...     >>> ignored_undefined_name\n                ...     """\n                ...     df = m\n                ...     return df\n                ...\n                >>> function_in_doctest()\n            \'\'\'\n            f = m\n            return f\n        ' ) #NEWLINE# scopes = checker . deadScopes #NEWLINE# module_scopes = [ scope for scope in scopes if ( scope . __class__ is ModuleScope ) ] #NEWLINE# doctest_scopes = [ scope for scope in scopes if ( scope . __class__ is DoctestScope ) ] #NEWLINE# function_scopes = [ scope for scope in scopes if ( scope . __class__ is FunctionScope ) ] #NEWLINE# self . assertEqual ( len ( module_scopes ) , 1 ) #NEWLINE# self . assertEqual ( len ( doctest_scopes ) , 1 ) #NEWLINE# module_scope = module_scopes [ 0 ] #NEWLINE# doctest_scope = doctest_scopes [ 0 ] #NEWLINE# self . assertIn ( 'm' , module_scope ) #NEWLINE# self . assertIn ( 'doctest_stuff' , module_scope ) #NEWLINE# self . assertIn ( 'function_in_doctest' , doctest_scope ) #NEWLINE# self . assertEqual ( len ( function_scopes ) , 2 ) #NEWLINE# self . assertIn ( 'f' , function_scopes [ 0 ] ) #NEWLINE# self . assertIn ( 'df' , function_scopes [ 1 ] )