[Python-Dev] [Python-checkins] cpython: Issue #11049: adding some tests to test.support

Éric Araujo merwok at netwok.org
Tue Jul 26 15:20:55 CEST 2011


Hi,

> changeset:   71465:be558ad15789
> user:        Eli Bendersky <eliben at gmail.com>
> summary:
>   Issue #11049: adding some tests to test.support
> Based on original patch by Giampaolo Rodola with contributions from R. David Murray
> 
> files:
>   Lib/test/support.py      |   21 +-
>   Lib/test/test_support.py |  178 +++++++++++++++++++++++++++
>   2 files changed, 189 insertions(+), 10 deletions(-)
> 
> diff --git a/Lib/test/support.py b/Lib/test/support.py
> --- a/Lib/test/support.py
> +++ b/Lib/test/support.py
> @@ -170,7 +170,7 @@
>          attribute = getattr(obj, name)
>      except AttributeError:
>          raise unittest.SkipTest("module %s has no attribute %s" % (
> -            obj.__name__, name))
> +            repr(obj), name))

I would use %r instead of %s for both fields here.  Non-ASCII characters
and unseen whitespace are at least two reasons to overuse %r in
debug/error messages instead of %s.

Regards


More information about the Python-Dev mailing list