#NEWLINE# def test_lua_compatible_server( self , sr , monkeypatch ) : #NEWLINE# #INDENT# @ classmethod #NEWLINE# def mock_register( cls , redis ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# monkeypatch . setattr ( LuaLock , 'register_scripts' , self ) #NEWLINE# try : #NEWLINE# #INDENT# lock = sr . lock ( 'foo' ) #NEWLINE# assert ( type ( lock ) == LuaLock ) #NEWLINE# assert ( sr . _use_lua_lock is True ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# sr . _use_lua_lock = None