bobber6467 / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

selftest without install (better developer documentation) #413

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to test nose without installing it first.

What is the expected output?
    Ran 336 tests in 4.563s

    OK (SKIP=4)

What do you see instead?
    Traceback (most recent call last):
      File "selftest.py", line 51, in <module>
        assert len(distributions) == 1
    AssertionError

What version of the product are you using?

> hg parents
changeset:   786:5aff24d4331d
tag:         tip
user:        kumar <kumar.mcmillan@gmail.com>
date:        Tue Apr 19 15:36:38 2011 -0500
summary:     Skipping pickle test because it gets stuck in an infinite loop 
(see Issue 399)

On what operating system?

> lsb_release -a
LSB Version:    
:core-3.0-amd64:core-3.0-ia32:core-3.0-noarch:graphics-3.0-amd64:graphics-3.0-ia
32:graphics-3.0-noarch
Distributor ID: RedHatEnterpriseAS
Description:    Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
Release:        4
Codename:       NahantUpdate8

I've attached a patch that makes it "work for me", but I completely uncertain 
if it's the right way to do it.

The patch also includes usability fixes for the test.sh, which I think should 
be uncontroversial.

Original issue reported on code.google.com by workitha...@gmail.com on 25 Apr 2011 at 5:10

Attachments:

GoogleCodeExporter commented 8 years ago
Hi, sorry for the confusion and thanks for the patch.  Some of those files were 
outdated though.  I added a developer readme here 
http://code.google.com/p/python-nose/source/detail?r=2d26612db10dc405527013cb988
0115a560c873f#

The best way to run the tests is with tox

Original comment by kumar.mcmillan on 25 Apr 2011 at 7:10

GoogleCodeExporter commented 8 years ago
Thanks for the guidance.
tox is fully resolving symlinks, which causes problems in my environment.

Is that something I can fix?
It should just be running 'python2.6' and not worrying about the symlinks, 
similar to what the test.sh was doing.

Original comment by workitha...@gmail.com on 25 Apr 2011 at 10:46

GoogleCodeExporter commented 8 years ago
I've never seen that as a problem, could you provide an example of how the 
symlinks cause problems?  Is there an exception?

Without tox you'll need setuptools installed globally or within a virtualenv.  
Then type this once:

python2.6 setup.py egg_info

And then you can run selftest:

python2.6 selftest.py

If you can get tox working that would be better since it will allow you to run 
in Python 3 using the 2to3 build step.

Original comment by kumar.mcmillan on 26 Apr 2011 at 3:03

GoogleCodeExporter commented 8 years ago
We do some very nonstandard wrapping with a symlink to a binary which calls our 
wrapper shell script.
This allows the wrapper to be used without complaint in script headers.

The binary relies on its $0 argument to find the shell script, but tox seems to 
be running realpath on the python path before calling it.

I realize that this is specific to our setup, but it works in every other 
situation I've encountered till now.
It's extremely unusual (and in this case improper) for a caller to read 
symlinks after it's found the command it's looking for.

This is low priority, but I was wondering if there was any way that I could 
alter tox or its settings to get this working.

Original comment by workitha...@gmail.com on 26 Apr 2011 at 3:28

GoogleCodeExporter commented 8 years ago
you shouldn't need a custom python binary for use with tox -- it uses 
virtualenv to isolate your python environments and this is tried and true 
across many OSes and versions.

As for fixing it, you could take a look at the tox source or submit a ticket 
over there http://codespeak.net/tox/

Original comment by kumar.mcmillan on 26 Apr 2011 at 3:53