tests/test-url.py
changeset 37874 0dcd03637d36
parent 29452 26a5d605b868
child 37875 078c3eec2d5c
--- a/tests/test-url.py	Fri Apr 27 00:06:08 2018 -0400
+++ b/tests/test-url.py	Fri Apr 27 00:08:21 2018 -0400
@@ -236,7 +236,8 @@
 
 def test_url():
     """
-    >>> from mercurial.util import url
+    >>> from mercurial import error, pycompat
+    >>> from mercurial.util import forcebytestr, url
 
     This tests for edge cases in url.URL's parsing algorithm. Most of
     these aren't useful for documentation purposes, so they aren't
@@ -349,10 +350,11 @@
 
     Non-localhost file URL:
 
-    >>> u = url('file://mercurial-scm.org/foo')
-    Traceback (most recent call last):
-      File "<stdin>", line 1, in ?
-    Abort: file:// URLs can only refer to localhost
+    >>> try:
+    ...   u = url(b'file://mercurial-scm.org/foo')
+    ... except error.Abort as e:
+    ...   forcebytestr(e)
+    'file:// URLs can only refer to localhost'
 
     Empty URL: