comparison genshi/template/tests/eval.py @ 854:0d9e87c6cf6e

More work on reducing the size of the diff produced by 2to3.
author cmlenz
date Tue, 10 Nov 2009 22:53:21 +0000
parents 9cabfbc4ac5c
children efc03d0719f3
comparison
equal deleted inserted replaced
853:4376010bb97e 854:0d9e87c6cf6e
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # 2 #
3 # Copyright (C) 2006-2008 Edgewall Software 3 # Copyright (C) 2006-2009 Edgewall Software
4 # All rights reserved. 4 # All rights reserved.
5 # 5 #
6 # This software is licensed as described in the file COPYING, which 6 # This software is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution. The terms 7 # you should have received as part of this distribution. The terms
8 # are also available at http://genshi.edgewall.org/wiki/License. 8 # are also available at http://genshi.edgewall.org/wiki/License.
635 assert 'ifilter' in data 635 assert 'ifilter' in data
636 636
637 def test_import_in_def(self): 637 def test_import_in_def(self):
638 suite = Suite("""def fun(): 638 suite = Suite("""def fun():
639 from itertools import ifilter 639 from itertools import ifilter
640 return ifilter(None, xrange(3)) 640 return ifilter(None, range(3))
641 """) 641 """)
642 data = Context() 642 data = Context()
643 suite.execute(data) 643 suite.execute(data)
644 assert 'ifilter' not in data 644 assert 'ifilter' not in data
645 self.assertEqual([1, 2], list(data['fun']())) 645 self.assertEqual([1, 2], list(data['fun']()))
Copyright (C) 2012-2017 Edgewall Software