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/2011-March/110075.html below:

[Python-Dev] [Python-checkins] cpython: Remove test_importable(). Couldn't see how to make this reliable across all

[Python-Dev] [Python-checkins] cpython: Remove test_importable(). Couldn't see how to make this reliable across allNick Coghlan ncoghlan at gmail.com
Fri Mar 25 12:37:09 CET 2011
On Fri, Mar 25, 2011 at 3:51 AM, raymond.hettinger
<python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/5adddc6be3c1
> changeset:   68902:5adddc6be3c1
> user:        Raymond Hettinger <python at rcn.com>
> date:        Thu Mar 24 10:51:06 2011 -0700
> summary:
>  Remove test_importable().  Couldn't see how to make this reliable across all platforms.

For this particular use case, a temporary directory added to sys,path,
then some subsequent cleanup of sys.modules, sys.path and
sys.path_importer_cache would likely do the trick.

I've actually never been a fan of using TESTFN in tests - the tempfile
module always struck me as being significantly more useful. It also
makes tidying up the files afterwards really easy - the temporary
directory context manager will blow everything away for you.

Then again, quite a few of the tests I've written involved convoluted
module hierarchies, so I'm likely a little biased by my typical use
cases :)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
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