@@ -1462,7 +1462,6 @@ def test_withStatementNoNames(self):
1462
1462
statement a name defined beforehand.
1463
1463
"""
1464
1464
self .flakes ('''
1465
- from __future__ import with_statement
1466
1465
bar = None
1467
1466
with open("foo"):
1468
1467
bar
@@ -1475,7 +1474,6 @@ def test_withStatementSingleName(self):
1475
1474
within the suite or afterwards.
1476
1475
"""
1477
1476
self .flakes ('''
1478
- from __future__ import with_statement
1479
1477
with open('foo') as bar:
1480
1478
bar
1481
1479
bar
@@ -1487,7 +1485,6 @@ def test_withStatementAttributeName(self):
1487
1485
C{with} statement.
1488
1486
"""
1489
1487
self .flakes ('''
1490
- from __future__ import with_statement
1491
1488
import foo
1492
1489
with open('foo') as foo.bar:
1493
1490
pass
@@ -1499,7 +1496,6 @@ def test_withStatementSubscript(self):
1499
1496
C{with} statement.
1500
1497
"""
1501
1498
self .flakes ('''
1502
- from __future__ import with_statement
1503
1499
import foo
1504
1500
with open('foo') as foo[0]:
1505
1501
pass
@@ -1511,7 +1507,6 @@ def test_withStatementSubscriptUndefined(self):
1511
1507
target of a C{with} statement is not defined.
1512
1508
"""
1513
1509
self .flakes ('''
1514
- from __future__ import with_statement
1515
1510
import foo
1516
1511
with open('foo') as foo[bar]:
1517
1512
pass
@@ -1523,7 +1518,6 @@ def test_withStatementTupleNames(self):
1523
1518
a C{with} statement within the suite or afterwards.
1524
1519
"""
1525
1520
self .flakes ('''
1526
- from __future__ import with_statement
1527
1521
with open('foo') as (bar, baz):
1528
1522
bar, baz
1529
1523
bar, baz
@@ -1535,7 +1529,6 @@ def test_withStatementListNames(self):
1535
1529
C{with} statement within the suite or afterwards.
1536
1530
"""
1537
1531
self .flakes ('''
1538
- from __future__ import with_statement
1539
1532
with open('foo') as [bar, baz]:
1540
1533
bar, baz
1541
1534
bar, baz
@@ -1550,7 +1543,6 @@ def test_withStatementComplicatedTarget(self):
1550
1543
created are respected in the suite of the statement and afterwards.
1551
1544
"""
1552
1545
self .flakes ('''
1553
- from __future__ import with_statement
1554
1546
c = d = e = g = h = i = None
1555
1547
with open('foo') as [(a, b), c[d], e.f, g[h:i]]:
1556
1548
a, b, c, d, e, g, h, i
@@ -1563,7 +1555,6 @@ def test_withStatementSingleNameUndefined(self):
1563
1555
C{with} statement is used before the C{with} statement.
1564
1556
"""
1565
1557
self .flakes ('''
1566
- from __future__ import with_statement
1567
1558
bar
1568
1559
with open('foo') as bar:
1569
1560
pass
@@ -1576,7 +1567,6 @@ def test_withStatementTupleNamesUndefined(self):
1576
1567
C{with} statement.
1577
1568
"""
1578
1569
self .flakes ('''
1579
- from __future__ import with_statement
1580
1570
baz
1581
1571
with open('foo') as (bar, baz):
1582
1572
pass
@@ -1588,7 +1578,6 @@ def test_withStatementSingleNameRedefined(self):
1588
1578
rebound by the name defined by a C{with} statement.
1589
1579
"""
1590
1580
self .flakes ('''
1591
- from __future__ import with_statement
1592
1581
import bar
1593
1582
with open('foo') as bar:
1594
1583
pass
@@ -1601,7 +1590,6 @@ def test_withStatementTupleNamesRedefined(self):
1601
1590
C{with} statement.
1602
1591
"""
1603
1592
self .flakes ('''
1604
- from __future__ import with_statement
1605
1593
import bar
1606
1594
with open('foo') as (bar, baz):
1607
1595
pass
@@ -1613,7 +1601,6 @@ def test_withStatementUndefinedInside(self):
1613
1601
body of a C{with} statement without first being bound.
1614
1602
"""
1615
1603
self .flakes ('''
1616
- from __future__ import with_statement
1617
1604
with open('foo') as bar:
1618
1605
baz
1619
1606
''' , m .UndefinedName )
@@ -1624,7 +1611,6 @@ def test_withStatementNameDefinedInBody(self):
1624
1611
the body ends without warning.
1625
1612
"""
1626
1613
self .flakes ('''
1627
- from __future__ import with_statement
1628
1614
with open('foo') as bar:
1629
1615
baz = 10
1630
1616
baz
@@ -1636,13 +1622,11 @@ def test_withStatementUndefinedInExpression(self):
1636
1622
expression of a C{with} statement is undefined.
1637
1623
"""
1638
1624
self .flakes ('''
1639
- from __future__ import with_statement
1640
1625
with bar as baz:
1641
1626
pass
1642
1627
''' , m .UndefinedName )
1643
1628
1644
1629
self .flakes ('''
1645
- from __future__ import with_statement
1646
1630
with bar as bar:
1647
1631
pass
1648
1632
''' , m .UndefinedName )
0 commit comments