ofanoyi / pygr

Automatically exported from code.google.com/p/pygr
0 stars 0 forks source link

sys.path problems in our test framework #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. python setup.py build
2. set PYTHONPATH=/path/to/your/pygrdir
3. python setup.py build_ext -i
4. change some .py code to fix a broken test
5. cd tests
6. python protest.py

What is the expected output? What do you see instead?
The test will still fail, even though you fixed it in /path/to/your/pygr

Cause: tests/pygrtest_common.py fiddles with the sys.path to add the
build/lib.PLATFORM-VERSION directory, which is where setup.py build
normally places a copy of your code.  This could cause the test to use old,
obsolete code during your test, even though your PYTHONPATH points to the
current code that you just edited.

Original issue reported on code.google.com by cjlee...@gmail.com on 12 Dec 2008 at 9:34

GoogleCodeExporter commented 8 years ago
We could easily swap the sys.path modification around so that it pays attention 
to
the source directory first, and the build directory second, but then that might 
trip
up someone else!

The real purpose of the path modification is just to make sure that the latest
developer version does get loaded for the tests.

Original comment by the.good...@gmail.com on 17 Dec 2008 at 2:02

GoogleCodeExporter commented 8 years ago
Another little problem.  I think the XMLRPC server test doesn't use 
pygrtest_common
properly.  At any rate, I ran the test suite without setting PYTHONPATH to 
include my
pygr source, expecting that pygrtest_common would take care of this anyway, but 
I got
one error (from the XMLRPC server test).  This error went away when I set my
PYTHONPATH.  The XMLRPC server test runs a subprocess that actually runs the 
server,
so I guess it's not surprising that the sys.path setting from pygrtest_common 
isn't
propagating correctly.  Probably easy to fix...

Original comment by cjlee...@gmail.com on 18 Dec 2008 at 9:58

GoogleCodeExporter commented 8 years ago
protest.py has been rendered obsolete by the new test framework so there is no 
longer need for this issue to be fixed.

Original comment by mare...@gmail.com on 21 May 2009 at 1:12