#NEWLINE# @ pytest . mark . parametrize ( 'script,name' , [ ( 'from flask.ext import foo; foo.' , 'Foo' ) , ( 'from flask.ext import bar; bar.' , 'Bar' ) , ( 'from flask.ext import baz; baz.' , 'Baz' ) , ( 'from flask.ext import moo; moo.' , 'Moo' ) , ( 'from flask.ext.' , 'foo' ) , ( 'from flask.ext.' , 'bar' ) , ( 'from flask.ext.' , 'baz' ) , ( 'from flask.ext.' , 'moo' ) , pytest . mark . xfail ( ( 'import flask.ext.foo; flask.ext.foo.' , 'Foo' ) ) , pytest . mark . xfail ( ( 'import flask.ext.bar; flask.ext.bar.' , 'Foo' ) ) , pytest . mark . xfail ( ( 'import flask.ext.baz; flask.ext.baz.' , 'Foo' ) ) , pytest . mark . xfail ( ( 'import flask.ext.moo; flask.ext.moo.' , 'Foo' ) ) ] ) #NEWLINE# def test_flask_ext( script , name ) : #NEWLINE# #INDENT# 'flask.ext.foo is really imported from flaskext.foo or flask_foo.\n    ' #NEWLINE# path = os . path . join ( os . path . dirname ( __file__ ) , 'flask-site-packages' ) #NEWLINE# sys . path . append ( path ) #NEWLINE# try : #NEWLINE# #INDENT# assert ( name in [ c . name for c in jedi . Script ( script ) . completions ( ) ] ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# sys . path . remove ( path )