<s> """<STR_LIT>""" <EOL> import os <EOL> import inspect <EOL> import jedi <EOL> def test_settings_module ( ) : <EOL> """<STR_LIT>""" <EOL> from jedi import cache <EOL> from jedi import settings <EOL> assert cache . settings is settings <EOL> def test_no_duplicate_modules ( ) : <EOL> """<STR_LIT>""" <EOL> import sys <EOL> jedipath = os . path . dirname ( os . path . abspath ( jedi . __file__ ) ) <EOL> def is_submodule ( m ) : <EOL> try : <EOL> filepath = m . __file__ <EOL> except AttributeError : <EOL> return False <EOL> return os . path . abspath ( filepath ) . startswith ( jedipath ) <EOL> modules = list ( filter ( is_submodule , sys . modules . values ( ) ) ) <EOL> top_modules = [ m for m in modules if not m . __name__ . startswith ( '<STR_LIT>' ) ] <EOL> for m in modules : <EOL> if m is jedi : <EOL> continue <EOL> for tm in top_modules : <EOL> try : <EOL> imported = getattr ( m , tm . __name__ ) <EOL> except AttributeError : <EOL> continue <EOL> if inspect . ismodule ( imported ) : <EOL> assert imported is tm </s>
