A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-January/123586.html below:

[Python-Dev] cpython (3.3): #16919: test_crypt now works with unittest test discovery. Patch by Zachary

[Python-Dev] cpython (3.3): #16919: test_crypt now works with unittest test discovery. Patch by Zachary [Python-Dev] cpython (3.3): #16919: test_crypt now works with unittest test discovery. Patch by ZacharyAntoine Pitrou solipsis at pitrou.net
Fri Jan 11 08:11:00 CET 2013
On Fri, 11 Jan 2013 04:20:21 +0100 (CET)
ezio.melotti <python-checkins at 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.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4