Skip to content

Commit b44d087

Browse files
committed
Annotated failing tests
1 parent de58e3a commit b44d087

7 files changed

Lines changed: 21 additions & 15 deletions

File tree

Lib/test/test_http_cookiejar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ def test_http2time_formats(self):
126126
def test_http2time_garbage(self, test):
127127
self.assertIsNone(http2time(test))
128128

129-
@unittest.skip('TODO: RUSTPYTHON; regressed to cubic complexity')
130129
def test_http2time_redos_regression_actually_completes(self):
131130
# LOOSE_HTTP_DATE_RE was vulnerable to malicious input which caused catastrophic backtracking (REDoS).
132131
# If we regress to cubic complexity, this test will take a very long time to succeed.

Lib/test/test_httpservers.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ def test_get_dir_redirect_location_domain_injection_bug(self):
618618
# follows that isn't important in this Location: header.
619619
self.assertStartsWith(location, 'https://pypi.org/')
620620

621+
@unittest.expectedFailure # TODO: RUSTPYTHON
621622
def test_get(self):
622623
#constructs the path relative to the root directory of the HTTPServer
623624
response = self.request(self.base_url + '/test')
@@ -1004,7 +1005,7 @@ def test_url_collapse_path(self):
10041005
msg='path = %r\nGot: %r\nWanted: %r' %
10051006
(path, actual, expected))
10061007

1007-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1008+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10081009
def test_headers_and_content(self):
10091010
res = self.request('/cgi-bin/file1.py')
10101011
self.assertEqual(
@@ -1015,8 +1016,7 @@ def test_issue19435(self):
10151016
res = self.request('///////////nocgi.py/../cgi-bin/nothere.sh')
10161017
self.assertEqual(res.status, HTTPStatus.NOT_FOUND)
10171018

1018-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1019-
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows")
1019+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10201020
def test_post(self):
10211021
params = urllib.parse.urlencode(
10221022
{'spam' : 1, 'eggs' : 'python', 'bacon' : 123456})
@@ -1048,7 +1048,7 @@ def test_invaliduri(self):
10481048
res.read()
10491049
self.assertEqual(res.status, HTTPStatus.NOT_FOUND)
10501050

1051-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1051+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10521052
def test_authorization(self):
10531053
headers = {b'Authorization' : b'Basic ' +
10541054
base64.b64encode(b'username:pass')}
@@ -1057,15 +1057,15 @@ def test_authorization(self):
10571057
(b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
10581058
(res.read(), res.getheader('Content-type'), res.status))
10591059

1060-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1060+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10611061
def test_no_leading_slash(self):
10621062
# http://bugs.python.org/issue2254
10631063
res = self.request('cgi-bin/file1.py')
10641064
self.assertEqual(
10651065
(b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
10661066
(res.read(), res.getheader('Content-type'), res.status))
10671067

1068-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1068+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10691069
def test_os_environ_is_not_altered(self):
10701070
signature = "Test CGI Server"
10711071
os.environ['SERVER_SOFTWARE'] = signature
@@ -1075,36 +1075,36 @@ def test_os_environ_is_not_altered(self):
10751075
(res.read(), res.getheader('Content-type'), res.status))
10761076
self.assertEqual(os.environ['SERVER_SOFTWARE'], signature)
10771077

1078-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1078+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10791079
def test_urlquote_decoding_in_cgi_check(self):
10801080
res = self.request('/cgi-bin%2ffile1.py')
10811081
self.assertEqual(
10821082
(b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
10831083
(res.read(), res.getheader('Content-type'), res.status))
10841084

1085-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1085+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10861086
def test_nested_cgi_path_issue21323(self):
10871087
res = self.request('/cgi-bin/child-dir/file3.py')
10881088
self.assertEqual(
10891089
(b'Hello World' + self.linesep, 'text/html', HTTPStatus.OK),
10901090
(res.read(), res.getheader('Content-type'), res.status))
10911091

1092-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1092+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
10931093
def test_query_with_multiple_question_mark(self):
10941094
res = self.request('/cgi-bin/file4.py?a=b?c=d')
10951095
self.assertEqual(
10961096
(b'a=b?c=d' + self.linesep, 'text/html', HTTPStatus.OK),
10971097
(res.read(), res.getheader('Content-type'), res.status))
10981098

1099-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1099+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
11001100
def test_query_with_continuous_slashes(self):
11011101
res = self.request('/cgi-bin/file4.py?k=aa%2F%2Fbb&//q//p//=//a//b//')
11021102
self.assertEqual(
11031103
(b'k=aa%2F%2Fbb&//q//p//=//a//b//' + self.linesep,
11041104
'text/html', HTTPStatus.OK),
11051105
(res.read(), res.getheader('Content-type'), res.status))
11061106

1107-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1107+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
11081108
def test_cgi_path_in_sub_directories(self):
11091109
try:
11101110
CGIHTTPRequestHandler.cgi_directories.append('/sub/dir/cgi-bin')
@@ -1115,7 +1115,7 @@ def test_cgi_path_in_sub_directories(self):
11151115
finally:
11161116
CGIHTTPRequestHandler.cgi_directories.remove('/sub/dir/cgi-bin')
11171117

1118-
@unittest.skipIf(sys.platform != 'win32', 'TODO: RUSTPYTHON; works only on windows')
1118+
@unittest.expectedFailure # TODO: RUSTPYTHON; works only on windows
11191119
def test_accept(self):
11201120
browser_accept = \
11211121
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

Lib/test/test_robotparser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ class EmptyQueryStringTest(BaseRobotTest, unittest.TestCase):
259259
good = ['/some/path?']
260260
bad = ['/another/path?']
261261

262+
@unittest.expectedFailure # TODO: RUSTPYTHON
263+
def test_bad_urls(self):
264+
super().test_bad_urls()
265+
262266

263267
class DefaultEntryTest(BaseRequestRateTest, unittest.TestCase):
264268
robots_txt = """\

Lib/test/test_ssl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3524,6 +3524,7 @@ def test_starttls(self):
35243524
else:
35253525
s.close()
35263526

3527+
@unittest.expectedFailure # TODO: RUSTPYTHON
35273528
def test_socketserver(self):
35283529
"""Using socketserver to create and manage SSL connections."""
35293530
server = make_https_server(self, certfile=SIGNED_CERTFILE)
@@ -4595,7 +4596,7 @@ def server_callback(identity):
45954596
with client_context.wrap_socket(socket.socket()) as s:
45964597
s.connect((HOST, server.port))
45974598

4598-
@unittest.skip("TODO: rustpython")
4599+
@unittest.skip("TODO: RUSTPYTHON; Hangs")
45994600
def test_thread_recv_while_main_thread_sends(self):
46004601
# GH-137583: Locking was added to calls to send() and recv() on SSL
46014602
# socket objects. This seemed fine at the surface level because those

Lib/test/test_urllib2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ def sanepathname2url(path):
727727

728728
class HandlerTests(unittest.TestCase, ExtraAssertions):
729729

730+
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: None != 'image/gif'
730731
def test_ftp(self):
731732
class MockFTPWrapper:
732733
def __init__(self, data):

Lib/test/test_urllib2_localnet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,12 @@ def test_issue16464(self):
687687
self.assertEqual("10", request.get_header("Content-length"))
688688

689689
@unittest.skipIf(os.name == 'nt', 'TODO: RUSTPYTHON; ValueError: illegal environment variable name')
690+
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'super' object has no attribute 'test_https_with_cadefault'
690691
def test_https_with_cadefault(self):
691692
return super().test_https_with_cadefault()
692693

693694
@unittest.skipIf(os.name == 'nt', 'TODO: RUSTPYTHON; ValueError: illegal environment variable name')
695+
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'super' object has no attribute 'test_https_with_cafile'
694696
def test_https_with_cafile(self):
695697
return super().test_https_with_cafile()
696698

Lib/test/test_wsgiref.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def test_environ(self):
134134
b"Python test,Python test 2;query=test;/path/"
135135
)
136136

137-
@unittest.expectedFailure # TODO: RUSTPYTHON; http library needs to be updated
138137
def test_request_length(self):
139138
out, err = run_amock(data=b"GET " + (b"x" * 65537) + b" HTTP/1.0\n\n")
140139
self.assertEqual(out.splitlines()[0],

0 commit comments

Comments
 (0)