[spambayes-dev] test_storage.py failing

Tim Peters tim.one at comcast.net
Wed Dec 24 12:35:33 EST 2003


[spambayes-dev-bounces at python.org]
[Skip]
> I ran the spambayes/test/test_storage.py this morning for the first
> time (on a fresh CVS checkout) and got several instances of the same
> error.

How many is several?  Note that there are only 5 tests here, so if several
means more than 2, it's possible that *all* the tests died this way for you.
That would be a clue.

>  Here's one example:
>
>     ERROR: testHapax (__main__.DBStorageTestCase)
>
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test_storage.py", line 137, in setUp
>      return _StorageTestBase.setUp(self)
> File "test_storage.py", line 20, in setUp
>      self.classifier = self.__class__.StorageClass(self.db_name)
> TypeError: __init__() takes exactly 1 argument (2 given)
>
> I inserted
>
>     print self.__class__.StorageClass
>
> right above the class call and in the error case it's always
> instantiating DBDictClassifier which does take a db_name argument, so
> I'm a bit confused about why this is generating an error.

I expect you need to run python with -v to see how the imports are getting
satisfied -- the only guess I have is that you're not getting the classes
the test expects to get.

Here are runs on my box (Pythons 2.3.3 and 2.2.3):

C:\Code\spambayes>echo %PYTHONPATH%
\code\spambayes

C:\Code\spambayes>\python23\python spambayes/test/test_storage.py -v
testHapax (__main__.PickleStorageTestCase) ... ok
test_bug777026 (__main__.PickleStorageTestCase) ... ok
testHapax (__main__.DBStorageTestCase) ... ok
testNoDBMAvailable (__main__.DBStorageTestCase) ... ok
test_bug777026 (__main__.DBStorageTestCase) ... ok

----------------------------------------------------------------------
Ran 5 tests in 0.050s

OK

C:\Code\spambayes>\python22\python spambayes/test/test_storage.py -v
testHapax (__main__.PickleStorageTestCase) ... ok
test_bug777026 (__main__.PickleStorageTestCase) ... ok
testHapax (__main__.DBStorageTestCase) ... ok
testNoDBMAvailable (__main__.DBStorageTestCase) ... ok
test_bug777026 (__main__.DBStorageTestCase) ... ok

----------------------------------------------------------------------
Ran 5 tests in 0.110s

Note that I checked in some code cleanup for test_storage.py right before
typing this msg, but I got the same results before too.




More information about the spambayes-dev mailing list