Commit fe94ea82 authored by Guido Günther's avatar Guido Günther

Python3: Fix doctest exception names

Python3 prefixes the module names
parent 3c47611c
......@@ -179,7 +179,7 @@ class Command(object):
>>> Command("/foo/bar")(quiet=True)
Traceback (most recent call last):
...
CommandExecFailed: '/foo/bar' failed: execution failed: [Errno 2] No such file or directory
gbp.command_wrappers.CommandExecFailed: '/foo/bar' failed: execution failed: [Errno 2] No such file or directory: '/foo/bar'
"""
try:
ret = self.__call(args)
......@@ -212,7 +212,7 @@ class Command(object):
>>> Command("/foo/bar").call(["foo", "bar"]) # doctest:+ELLIPSIS
Traceback (most recent call last):
...
CommandExecFailed: execution failed: ...
gbp.command_wrappers.CommandExecFailed: execution failed: ...
>>> c = Command("/bin/true", capture_stdout=True,
... extra_env={'LC_ALL': 'C'})
>>> c.call(["--version"])
......
......@@ -458,7 +458,7 @@ class GbpOptionParser(OptionParser):
>>> GbpOptionParser._listify('[')
Traceback (most recent call last):
...
Error: [ is not a proper list
configparser.Error: [ is not a proper list
"""
# filter can be either a list or a string, always build a list:
if value:
......
......@@ -40,7 +40,7 @@ class DebianSourceFormat(object):
>>> d = DebianSourceFormat("1.0 broken")
Traceback (most recent call last):
...
DebianSourceFormatError: Cannot get source format from '1.0 broken'
gbp.deb.format.DebianSourceFormatError: Cannot get source format from '1.0 broken'
"""
format_file = 'debian/source/format'
......
......@@ -57,7 +57,7 @@ class Uscan(object):
>>> u._parse('')
Traceback (most recent call last):
...
UscanError: Couldn't find 'upstream-url' in uscan output
gbp.deb.uscan.UscanError: Couldn't find 'upstream-url' in uscan output
"""
source = None
self._uptodate = False
......@@ -146,17 +146,17 @@ class Uscan(object):
... "to example.com:80 (Bad hostname)</warnings>")
Traceback (most recent call last):
...
UscanError: Uscan failed: uscan warning: In watchfile debian/watch, reading webpage
gbp.deb.uscan.UscanError: Uscan failed: uscan warning: In watchfile debian/watch, reading webpage
http://a.b/ failed: 500 Cant connect to example.com:80 (Bad hostname)
>>> u._raise_error("<errors>uscan: Can't use --verbose if "
... "you're using --dehs!</errors>")
Traceback (most recent call last):
...
UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
gbp.deb.uscan.UscanError: Uscan failed: uscan: Can't use --verbose if you're using --dehs!
>>> u = u._raise_error('')
Traceback (most recent call last):
...
UscanError: Uscan failed - debug by running 'uscan --verbose'
gbp.deb.uscan.UscanError: Uscan failed - debug by running 'uscan --verbose'
"""
msg = None
......
......@@ -27,11 +27,11 @@ def format_str(msg, args):
>>> format_str("%(foo)", {})
Traceback (most recent call last):
...
GbpError: Failed to format %(foo): Missing value 'foo' in {}
gbp.errors.GbpError: Failed to format %(foo): Missing value 'foo' in {}
>>> format_str("%(foo)", {'foo': 'bar'})
Traceback (most recent call last):
...
GbpError: Failed to format %(foo) with {'foo': 'bar'}: incomplete format
gbp.errors.GbpError: Failed to format %(foo) with {'foo': 'bar'}: incomplete format
>>> format_str("A %(foo)s is a %(bar)s", {'foo': 'dog', 'bar': 'mamal'})
'A dog is a mamal'
"""
......
......@@ -273,15 +273,15 @@ def find_source(use_uscan, args):
>>> find_source(False, ['too', 'many'])
Traceback (most recent call last):
...
GbpError: More than one archive specified. Try --help.
gbp.errors.GbpError: More than one archive specified. Try --help.
>>> find_source(False, [])
Traceback (most recent call last):
...
GbpError: No archive to import specified. Try --help.
gbp.errors.GbpError: No archive to import specified. Try --help.
>>> find_source(True, ['tarball'])
Traceback (most recent call last):
...
GbpError: you can't pass both --uscan and a filename.
gbp.errors.GbpError: you can't pass both --uscan and a filename.
>>> find_source(False, ['tarball']).path
'tarball'
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment