nltk/nltk — Issue #71: Problem with final test in corpus.doctest
Author: alexrudnick
Created: 2012-01-17 06:25:23+00:00
State: open

$ cd trunk/nltk/test; make corpus.errs

File "...nltk/test/corpus.doctest", line 2118, in corpus.doctest
Failed example:
for i, string in enumerate(strings):
print 'String %d: %s' % (i, `string[:45]`[:-1]+'...')
for encoding in encodings:
print (' - test for %-10s [%s]' %
(encoding, reader_test(string, encoding)))
Exception raised:
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/doctest.py",
line 1228, in __run
compileflags, 1) in test.globs
File "<doctest corpus.doctest[402]>", line 5, in <module>
(encoding, reader_test(string, encoding)))
File "<doctest corpus.doctest[399]>", line 35, in reader_test
size = random.randint(0, strlen/6)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/random.py", line
215, in randint
return self.randrange(a, b+1)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/random.py", line
171, in randrange
raise ValueError, "non-integer stop for randrange()"
ValueError: non-integer stop for randrange()

Migrated from http://code.google.com/p/nltk/issues/detail?id=406