DominikKoller / aima-python

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

Unit Tests Fail 'out-of-the-box' #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download and install code from /trunk and get test /data:

 svn checkout http://aima-python.googlecode.com/svn/trunk/ python svn checkout http://aima-data.googlecode.com/svn/trunk/ data

2. Run the unit tests from the shell: $ python doctests.py -v *.py
  ...
  /python/csp.py
  Failed example: len(min_conflicts(NQueensCSP(8)))
  ...

3. Run the code analysis tool from the shell: $ pylint csp.py
  ...

Messages shows lots of errors. 35 occurrences of error id E1101 - 
http://www.logilab.org/card/pylintfeatures - Used when a variable is accessed 
for an unexistent member. 1 occurrence of error id E1121 - Used when a function 
call passes too many positional arguments.

4. Download and installed code snapshot (instead of taking directly from /trunk 
which is usually under active - unstable - development!) to see if that is more 
stable - 
http://code.google.com/p/aima-python/downloads/detail?name=aima-python.2007.06.1
5.zip

5. Download and installed data snapshot (and not from data /trunk) just in case 
this test data is meant to be stable against python.2001.06.15.zip code base - 
http://code.google.com/p/aima-data/downloads/detail?name=aima-data.2008.08.24.zi
p&can=2&q=

6. Run test cases relating to these 2 snapshots above: /python.2007.06.15$ 
python doctests.py -v *.py ... Get lots of different errors (e.g. missing file 
../data/wordlist), so this snapshot does not pass the test cases either.

7. Also ran the above snapshot test against latest trunk /data and same errors.

What is the expected output? What do you see instead?
The last line printed should be "Test passed."

What version of the product are you using? On what operating system?
1. Latest code & data from respective /trunks, Python 2.7.1+, Ubuntu 11.04

Please provide any additional information below.

Original issue reported on code.google.com by andrew.d...@gmail.com on 25 Aug 2011 at 3:07

GoogleCodeExporter commented 9 years ago
Thanks. In the trunk the doctests now succeed for me, except sometimes csp.py 
fails when min_conflicts search makes bad random choices. I've tested on OS X 
and Ubuntu and back to Python 2.5 (though not on both), but there could be more 
unportable doctests still.

The pylint run turned up a bug in unused code (which I just fixed in r43) and a 
few style problems.

I'm leaving this open because of the intermittent csp failure and lack of 
Windows testing.

Original comment by wit...@gmail.com on 28 Aug 2011 at 9:52

GoogleCodeExporter commented 9 years ago
Wow, thanks for the lightning fast turn-around! All working ("0 failed out of 
387" on Python 2.7.1+, Ubuntu 11.04) after doing "svn update ./" then 
re-running the doctests. Cheers. Andrew

Original comment by andrew.d...@gmail.com on 29 Aug 2011 at 12:07

GoogleCodeExporter commented 9 years ago
r30 using the downloaded data from aima-data failed with numerous errors using 
Python 2.7.2 (on Windows 7). 

Confirming that r43 in conjunction with latest checkout of aima-data passes all 
387 tests (0 failures) using Python 2.7.2 on Windows 7.

Thanks!

Original comment by ego...@gmail.com on 30 Aug 2011 at 5:41

GoogleCodeExporter commented 9 years ago
Great! Closing because of the reported success on Windows, plus r48 for the csp 
failure.

Original comment by wit...@gmail.com on 1 Sep 2011 at 9:07