Skip to content

Commit e4acefd

Browse files
committed
Merge pull request #71 from QuLogic/annotate-failing-2.6-tests
Annotate failing 2.6 tests
2 parents f7732a5 + a33bfb1 commit e4acefd

File tree

8 files changed

+53
-8
lines changed

8 files changed

+53
-8
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ python:
33
- "3.4"
44
- "3.3"
55
- "2.7"
6-
# Disable auto 2.6 tests for now: still about 45-50 failures or errors on Py2.6:
7-
# - "2.6"
6+
- "2.6"
87
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
98
# These packages only exist on Ubuntu 13.04 and newer:
109
# before_install:

future/tests/test_buffer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import (absolute_import, division,
55
print_function, unicode_literals)
66
from future.builtins import *
7-
from future.tests.base import unittest
7+
from future.tests.base import unittest, expectedFailurePY26
88

99
import struct
1010
import sys
@@ -226,6 +226,7 @@ class BytearrayPEP3137Test(unittest.TestCase,
226226
def marshal(self, x):
227227
return bytearray(bytes(x))
228228

229+
@expectedFailurePY26
229230
def test_returns_new_copy(self):
230231
val = self.marshal(b'1234')
231232
# On immutable types these MAY return a reference to themselves

future/tests/test_http_cookiejar.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import re
1111
import time
12-
from future.tests.base import unittest
12+
from future.tests.base import unittest, skip26, expectedFailurePY26
1313
import future.backports.test.support as test_support
1414
import future.backports.urllib.request as urllib_request
1515

@@ -297,6 +297,7 @@ def _interact(cookiejar, url, set_cookie_hdrs, hdr_name):
297297

298298

299299
class FileCookieJarTests(unittest.TestCase):
300+
@skip26
300301
def test_lwp_valueless_cookie(self):
301302
# cookies with no value should be saved and loaded consistently
302303
filename = test_support.TESTFN
@@ -416,6 +417,7 @@ def test_domain_return_ok(self):
416417
if ok: self.assertTrue(r)
417418
else: self.assertFalse(r)
418419

420+
@skip26
419421
def test_missing_value(self):
420422
# missing = sign in Cookie: header is regarded by Mozilla as a missing
421423
# name, and by http.cookiejar as a missing value
@@ -448,6 +450,7 @@ def test_missing_value(self):
448450
self.assertEqual(interact_netscape(c, "http://www.acme.com/foo/"),
449451
'"spam"; eggs')
450452

453+
@expectedFailurePY26
451454
def test_rfc2109_handling(self):
452455
# RFC 2109 cookies are handled as RFC 2965 or Netscape cookies,
453456
# dependent on policy settings
@@ -479,6 +482,7 @@ def test_rfc2109_handling(self):
479482
cookie2965 = c._cookies["www.example.com"]["/"]["foo"]
480483
self.assertEqual(cookie2965.version, 1)
481484

485+
@skip26
482486
def test_ns_parser(self):
483487
c = CookieJar()
484488
interact_netscape(c, "http://www.acme.com/",
@@ -514,6 +518,7 @@ def test_ns_parser(self):
514518
self.assertIsNone(foo.expires)
515519
self.assertIsNone(spam.expires)
516520

521+
@skip26
517522
def test_ns_parser_special_names(self):
518523
# names such as 'expires' are not special in first name=value pair
519524
# of Set-Cookie: header
@@ -525,6 +530,7 @@ def test_ns_parser_special_names(self):
525530
self.assertIn('expires', cookies)
526531
self.assertIn('version', cookies)
527532

533+
@expectedFailurePY26
528534
def test_expires(self):
529535
# if expires is in future, keep cookie...
530536
c = CookieJar()
@@ -564,6 +570,7 @@ def test_expires(self):
564570

565571
# XXX RFC 2965 expiry rules (some apply to V0 too)
566572

573+
@skip26
567574
def test_default_path(self):
568575
# RFC 2965
569576
pol = DefaultCookiePolicy(rfc2965=True)
@@ -604,6 +611,7 @@ def test_default_path(self):
604611
interact_netscape(c, "http://www.acme.com/blah/rhubarb/", 'eggs="bar"')
605612
self.assertIn("/blah/rhubarb", c._cookies["www.acme.com"])
606613

614+
@skip26
607615
def test_default_path_with_query(self):
608616
cj = CookieJar()
609617
uri = "http://example.com/?spam/eggs"
@@ -745,6 +753,7 @@ def test_wrong_domain(self):
745753
'foo=bar; domain=friendly.org; Version="1"')
746754
self.assertEqual(len(c), 0)
747755

756+
@expectedFailurePY26
748757
def test_strict_domain(self):
749758
# Cookies whose domain is a country-code tld like .co.uk should
750759
# not be set if CookiePolicy.strict_domain is true.
@@ -759,6 +768,7 @@ def test_strict_domain(self):
759768
'spam=eggs; Domain=.co.uk')
760769
self.assertEqual(len(cj), 2)
761770

771+
@expectedFailurePY26
762772
def test_two_component_domain_ns(self):
763773
# Netscape: .www.bar.com, www.bar.com, .bar.com, bar.com, no domain
764774
# should all get accepted, as should .acme.com, acme.com and no domain
@@ -807,6 +817,7 @@ def test_two_component_domain_ns(self):
807817
## self.assertEqual(len(c), 2)
808818
self.assertEqual(len(c), 4)
809819

820+
@expectedFailurePY26
810821
def test_two_component_domain_rfc2965(self):
811822
pol = DefaultCookiePolicy(rfc2965=True)
812823
c = CookieJar(pol)
@@ -851,6 +862,7 @@ def test_two_component_domain_rfc2965(self):
851862
'nasty=trick; domain=.co.uk; Version="1"')
852863
self.assertEqual(len(c), 3)
853864

865+
@expectedFailurePY26
854866
def test_domain_allow(self):
855867
c = CookieJar(policy=DefaultCookiePolicy(
856868
blocked_domains=["acme.com"],
@@ -882,6 +894,7 @@ def test_domain_allow(self):
882894
c.add_cookie_header(req)
883895
self.assertFalse(req.has_header("Cookie"))
884896

897+
@expectedFailurePY26
885898
def test_domain_block(self):
886899
pol = DefaultCookiePolicy(
887900
rfc2965=True, blocked_domains=[".acme.com"])
@@ -922,6 +935,7 @@ def test_domain_block(self):
922935
c.add_cookie_header(req)
923936
self.assertFalse(req.has_header("Cookie"))
924937

938+
@skip26
925939
def test_secure(self):
926940
for ns in True, False:
927941
for whitespace in " ", "":
@@ -945,12 +959,14 @@ def test_secure(self):
945959
c._cookies["www.acme.com"]["/"]["foo2"].secure,
946960
"secure cookie registered non-secure")
947961

962+
@expectedFailurePY26
948963
def test_quote_cookie_value(self):
949964
c = CookieJar(policy=DefaultCookiePolicy(rfc2965=True))
950965
interact_2965(c, "http://www.acme.com/", r'foo=\b"a"r; Version=1')
951966
h = interact_2965(c, "http://www.acme.com/")
952967
self.assertEqual(h, r'$Version=1; foo=\\b\"a\"r')
953968

969+
@expectedFailurePY26
954970
def test_missing_final_slash(self):
955971
# Missing slash from request URL's abs_path should be assumed present.
956972
url = "http://www.acme.com"
@@ -961,6 +977,7 @@ def test_missing_final_slash(self):
961977
c.add_cookie_header(req)
962978
self.assertTrue(req.has_header("Cookie"))
963979

980+
@expectedFailurePY26
964981
def test_domain_mirror(self):
965982
pol = DefaultCookiePolicy(rfc2965=True)
966983

@@ -984,6 +1001,7 @@ def test_domain_mirror(self):
9841001
h = interact_2965(c, url)
9851002
self.assertIn('$Domain="bar.com"', h, "domain not returned")
9861003

1004+
@expectedFailurePY26
9871005
def test_path_mirror(self):
9881006
pol = DefaultCookiePolicy(rfc2965=True)
9891007

@@ -999,6 +1017,7 @@ def test_path_mirror(self):
9991017
h = interact_2965(c, url)
10001018
self.assertIn('$Path="/"', h, "path not returned")
10011019

1020+
@expectedFailurePY26
10021021
def test_port_mirror(self):
10031022
pol = DefaultCookiePolicy(rfc2965=True)
10041023

@@ -1092,6 +1111,7 @@ def test_parse_ns_headers(self):
10921111
# shouldn't add version if header is empty
10931112
self.assertEqual(parse_ns_headers([""]), [])
10941113

1114+
@skip26
10951115
def test_bad_cookie_header(self):
10961116

10971117
def cookiejar_from_cookie_headers(headers):
@@ -1126,6 +1146,7 @@ def cookiejar_from_cookie_headers(headers):
11261146
class LWPCookieTests(unittest.TestCase):
11271147
# Tests taken from libwww-perl, with a few modifications and additions.
11281148

1149+
@expectedFailurePY26
11291150
def test_netscape_example_1(self):
11301151
#-------------------------------------------------------------------
11311152
# First we check that it works for the original example at
@@ -1217,6 +1238,7 @@ def test_netscape_example_1(self):
12171238
self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
12181239
self.assertTrue(h.startswith("SHIPPING=FEDEX;"))
12191240

1241+
@expectedFailurePY26
12201242
def test_netscape_example_2(self):
12211243
# Second Example transaction sequence:
12221244
#
@@ -1268,6 +1290,7 @@ def test_netscape_example_2(self):
12681290
r"PART_NUMBER=RIDING_ROCKET_0023;\s*"
12691291
"PART_NUMBER=ROCKET_LAUNCHER_0001")
12701292

1293+
@expectedFailurePY26
12711294
def test_ietf_example_1(self):
12721295
#-------------------------------------------------------------------
12731296
# Then we test with the examples from draft-ietf-http-state-man-mec-03.txt
@@ -1380,6 +1403,7 @@ def test_ietf_example_1(self):
13801403
# /acme as a prefix, and that matches the Path attribute, each request
13811404
# contains all the cookies received so far.
13821405

1406+
@expectedFailurePY26
13831407
def test_ietf_example_2(self):
13841408
# 5.2 Example 2
13851409
#
@@ -1433,6 +1457,7 @@ def test_ietf_example_2(self):
14331457
self.assertIn("Rocket_Launcher_0001", cookie)
14341458
self.assertNotIn("Riding_Rocket_0023", cookie)
14351459

1460+
@expectedFailurePY26
14361461
def test_rejection(self):
14371462
# Test rejection of Set-Cookie2 responses based on domain, path, port.
14381463
pol = DefaultCookiePolicy(rfc2965=True)
@@ -1524,6 +1549,7 @@ def test_rejection(self):
15241549

15251550
self.assertEqual(old, repr(c))
15261551

1552+
@expectedFailurePY26
15271553
def test_url_encoding(self):
15281554
# Try some URL encodings of the PATHs.
15291555
# (the behaviour here has changed from libwww-perl)
@@ -1546,6 +1572,7 @@ def test_url_encoding(self):
15461572
# unicode URL doesn't raise exception
15471573
cookie = interact_2965(c, "http://www.acme.com/\xfc")
15481574

1575+
@expectedFailurePY26
15491576
def test_mozilla(self):
15501577
# Save / load Mozilla/Netscape cookie file format.
15511578
year_plus_one = time.localtime()[0] + 1
@@ -1587,6 +1614,7 @@ def save_and_restore(cj, ignore_discard):
15871614
self.assertEqual(len(new_c), 4) # 2 of them discarded on save
15881615
self.assertIn("name='foo1', value='bar'", repr(new_c))
15891616

1617+
@skip26
15901618
def test_netscape_misc(self):
15911619
# Some additional Netscape cookies tests.
15921620
c = CookieJar()
@@ -1610,6 +1638,7 @@ def test_netscape_misc(self):
16101638
self.assertIn("PART_NUMBER=3,4", req.get_header("Cookie"))
16111639
self.assertIn("Customer=WILE_E_COYOTE",req.get_header("Cookie"))
16121640

1641+
@expectedFailurePY26
16131642
def test_intranet_domains_2965(self):
16141643
# Test handling of local intranet hostnames without a dot.
16151644
c = CookieJar(DefaultCookiePolicy(rfc2965=True))
@@ -1624,6 +1653,7 @@ def test_intranet_domains_2965(self):
16241653
self.assertIn("foo2=bar", cookie)
16251654
self.assertEqual(len(c), 3)
16261655

1656+
@expectedFailurePY26
16271657
def test_intranet_domains_ns(self):
16281658
c = CookieJar(DefaultCookiePolicy(rfc2965 = False))
16291659
interact_netscape(c, "http://example/", "foo1=bar")
@@ -1636,6 +1666,7 @@ def test_intranet_domains_ns(self):
16361666
self.assertIn("foo2=bar", cookie)
16371667
self.assertEqual(len(c), 2)
16381668

1669+
@expectedFailurePY26
16391670
def test_empty_path(self):
16401671
# Test for empty path
16411672
# Broken web-server ORION/1.3.38 returns to the client response like
@@ -1667,6 +1698,7 @@ def test_empty_path(self):
16671698
"JSESSIONID=ABCDERANDOM123")
16681699
self.assertEqual(req.get_header("Cookie2"), '$Version="1"')
16691700

1701+
@expectedFailurePY26
16701702
def test_session_cookies(self):
16711703
year_plus_one = time.localtime()[0] + 1
16721704

future/tests/test_super.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import absolute_import, division, unicode_literals
44
import sys
55

6-
from future.tests.base import unittest, expectedFailurePY2
6+
from future.tests.base import unittest, skip26, expectedFailurePY2
77
from future import utils
88
from future.builtins import super
99

@@ -155,6 +155,7 @@ class TestSuperFromTestDescrDotPy(unittest.TestCase):
155155
"""
156156
These are from Python 3.3.5/Lib/test/test_descr.py
157157
"""
158+
@skip26
158159
def test_classmethods(self):
159160
# Testing class methods...
160161
class C(object):

future/tests/test_urllib.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from future.backports.http import client as http_client
1717
from future.backports.test import support
1818
from future.backports.email import message as email_message
19-
from future.tests.base import unittest
19+
from future.tests.base import unittest, skip26, expectedFailurePY26
2020

2121

2222
def hexescape(char):
@@ -229,14 +229,17 @@ def test_willclose(self):
229229
finally:
230230
self.unfakehttp()
231231

232+
@expectedFailurePY26
232233
def test_read_0_9(self):
233234
# "0.9" response accepted (but not "simple responses" without
234235
# a status line)
235236
self.check_read(b"0.9")
236237

238+
@expectedFailurePY26
237239
def test_read_1_0(self):
238240
self.check_read(b"1.0")
239241

242+
@expectedFailurePY26
240243
def test_read_1_1(self):
241244
self.check_read(b"1.1")
242245

@@ -310,6 +313,7 @@ def test_ftp_nonexisting(self):
310313
urlopen('ftp://localhost/a/file/which/doesnot/exists.py')
311314

312315

316+
@expectedFailurePY26
313317
def test_userpass_inurl(self):
314318
self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
315319
try:
@@ -321,6 +325,7 @@ def test_userpass_inurl(self):
321325
finally:
322326
self.unfakehttp()
323327

328+
@expectedFailurePY26
324329
def test_userpass_inurl_w_spaces(self):
325330
self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
326331
try:
@@ -487,6 +492,7 @@ def hooktester(block_count, block_read_size, file_size, _report=report):
487492
class urlretrieve_HttpTests(unittest.TestCase, FakeHTTPMixin):
488493
"""Test urllib.urlretrieve() using fake http connections"""
489494

495+
@skip26
490496
def test_short_content_raises_ContentTooShortError(self):
491497
self.fakehttp(b'''HTTP/1.1 200 OK
492498
Date: Wed, 02 Jan 2008 03:03:54 GMT
@@ -508,6 +514,7 @@ def _reporthook(par1, par2, par3):
508514
finally:
509515
self.unfakehttp()
510516

517+
@skip26
511518
def test_short_content_raises_ContentTooShortError_without_reporthook(self):
512519
self.fakehttp(b'''HTTP/1.1 200 OK
513520
Date: Wed, 02 Jan 2008 03:03:54 GMT
@@ -1320,6 +1327,7 @@ def test_with_method_arg(self):
13201327

13211328
class URL2PathNameTests(unittest.TestCase):
13221329

1330+
@expectedFailurePY26
13231331
def test_converting_drive_letter(self):
13241332
self.assertEqual(url2pathname("///C|"), 'C:')
13251333
self.assertEqual(url2pathname("///C:"), 'C:')

future/tests/test_urllib2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# proxy config data structure but is testable on all platforms.
1313
from future.backports.urllib.request import Request, OpenerDirector, _proxy_bypass_macosx_sysconf
1414
import future.backports.urllib.error as urllib_error
15-
from future.tests.base import unittest
15+
from future.tests.base import unittest, skip26
1616
from future.builtins import bytes, dict, int, open, str, zip
1717
from future.utils import text_to_native_str
1818

@@ -792,6 +792,7 @@ def test_file(self):
792792
self.assertEqual(req.type, "ftp")
793793
self.assertEqual(req.type == "ftp", ftp)
794794

795+
@skip26
795796
def test_http(self):
796797

797798
h = urllib_request.AbstractHTTPHandler()
@@ -901,6 +902,7 @@ def iterable_body():
901902
newreq = h.do_request_(req)
902903
self.assertEqual(int(newreq.get_header('Content-length')),16)
903904

905+
@skip26
904906
def test_http_doubleslash(self):
905907
# Checks the presence of any unnecessary double slash in url does not
906908
# break anything. Previously, a double slash directly after the host

0 commit comments

Comments
 (0)