Bug 1496032 [wpt PR 13330] - Python 3: Update some test expectations in test_pipes.py., a=testonly
authorMs2ger <Ms2ger@gmail.com>
Tue, 09 Oct 2018 04:12:59 +0000
changeset 495926 a0fed4d8d7d675b7f0a07da253dbe231ddd3f2ff
parent 495925 9b8801e6847081c654913f71fb0bd75e18239173
child 495927 ba2032222ac865ff5f16d3af88f7e43d20b7c0d8
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1496032, 13330
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496032 [wpt PR 13330] - Python 3: Update some test expectations in test_pipes.py., a=testonly Automatic update from web-platform-testsPython 3: Update some test expectations in test_pipes.py. -- wpt-commits: 97615176b59ada5216db3425d7c642be0e1e0f8d wpt-pr: 13330
testing/web-platform/tests/tools/wptserve/tests/functional/test_pipes.py
--- a/testing/web-platform/tests/tools/wptserve/tests/functional/test_pipes.py
+++ b/testing/web-platform/tests/tools/wptserve/tests/functional/test_pipes.py
@@ -154,69 +154,64 @@ class TestPipesWithVariousHandlers(TestU
         @wptserve.handlers.handler
         def handler(request, response):
             return "PASS"
         route = ("GET", "/test/test_pipes_1/", handler)
         self.server.router.register(*route)
         resp = self.request(route[1], query="pipe=slice(null,2)")
         self.assertEqual(resp.read(), "PA")
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_with_python_func_handler_using_response_writer(self):
         @wptserve.handlers.handler
         def handler(request, response):
             response.writer.write_content("PASS")
         route = ("GET", "/test/test_pipes_1/", handler)
         self.server.router.register(*route)
         resp = self.request(route[1], query="pipe=slice(null,2)")
         # slice has not been applied to the response, because response.writer was used.
-        self.assertEqual(resp.read(), "PASS")
+        self.assertEqual(resp.read(), b"PASS")
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_header_pipe_with_python_func_using_response_writer(self):
         @wptserve.handlers.handler
         def handler(request, response):
             response.writer.write_content("CONTENT")
         route = ("GET", "/test/test_pipes_1/", handler)
         self.server.router.register(*route)
         resp = self.request(route[1], query="pipe=header(X-TEST,FAIL)")
         # header pipe was ignored, because response.writer was used.
         self.assertFalse(resp.info().get("X-TEST"))
-        self.assertEqual(resp.read(), "CONTENT")
+        self.assertEqual(resp.read(), b"CONTENT")
 
     @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_with_json_handler(self):
         @wptserve.handlers.json_handler
         def handler(request, response):
             return json.dumps({'data': 'PASS'})
         route = ("GET", "/test/test_pipes_2/", handler)
         self.server.router.register(*route)
         resp = self.request(route[1], query="pipe=slice(null,2)")
         self.assertEqual(resp.read(), '"{')
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_slice_with_as_is_handler(self):
         resp = self.request("/test.asis", query="pipe=slice(null,2)")
         self.assertEqual(202, resp.getcode())
         self.assertEqual("Giraffe", resp.msg)
         self.assertEqual("PASS", resp.info()["X-Test"])
         # slice has not been applied to the response, because response.writer was used.
-        self.assertEqual("Content", resp.read())
+        self.assertEqual(b"Content", resp.read())
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_headers_with_as_is_handler(self):
         resp = self.request("/test.asis", query="pipe=header(X-TEST,FAIL)")
         self.assertEqual(202, resp.getcode())
         self.assertEqual("Giraffe", resp.msg)
         # header pipe was ignored.
         self.assertEqual("PASS", resp.info()["X-TEST"])
-        self.assertEqual("Content", resp.read())
+        self.assertEqual(b"Content", resp.read())
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_trickle_with_as_is_handler(self):
         t0 = time.time()
         resp = self.request("/test.asis", query="pipe=trickle(1:d2:5:d1:r2)")
         t1 = time.time()
-        self.assertTrue('Content' in resp.read())
+        self.assertTrue(b'Content' in resp.read())
         self.assertGreater(6, t1-t0)
 
 if __name__ == '__main__':
     unittest.main()