On Fri, 11 Jan 2013 04:20:21 +0100 (CET)
ezio.melotti <python-check...@python.org> wrote:
> 
> diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py
> --- a/Lib/test/test_crypt.py
> +++ b/Lib/test/test_crypt.py
> @@ -1,7 +1,11 @@
>  from test import support
>  import unittest
>  
> -crypt = support.import_module('crypt')
> +def setUpModule():
> +    # this import will raise unittest.SkipTest if _crypt doesn't exist,
> +    # so it has to be done in setUpModule for test discovery to work
> +    global crypt
> +    crypt = support.import_module('crypt')

Yikes.
Couldn't unittest support SkipTest being raised at import instead?
setUpModule is an ugly way to do this.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to