Closed att14 closed 10 years ago
I renamed it to _testify_bucket
and ran your example code and got a different error:
[tyler@toaster:~/Testify]$ PYTHONPATH=~/Testify ~/Testify/bin/testify -v tmp2.py --bucket=1
HERE
Traceback (most recent call last):
File "/Users/tyler/Testify/bin/testify", line 25, in <module>
test_program.TestProgram()
File "/Users/tyler/Testify/testify/test_program.py", line 222, in __init__
self.run()
File "/Users/tyler/Testify/testify/test_program.py", line 299, in run
result = runner.run()
File "/Users/tyler/Testify/testify/test_runner.py", line 133, in run
for test_case in self.discover():
File "/Users/tyler/Testify/testify/test_runner.py", line 108, in discover
discovered_tests = list(discover_inner())
File "/Users/tyler/Testify/testify/test_runner.py", line 93, in discover_inner
or (override_bucket is None and test_case_class._testify_bucket(self.bucket_count, self.bucket_salt) == self.bucket)
File "/Users/tyler/Testify/testify/test_case.py", line 81, in _testify_bucket
return hash(MetaTestCase._cmp_str(cls)) % bucket_count
TypeError: unsupported operand type(s) for %: 'int' and 'NoneType'
But this appears to be an unrelated error, which I have filed as #209.
Since, as we discussed in person, the main thing is to not have a magic internal variable clash in public namespace with a common english word ("bucket"), I'm filing a pull request for the change even though your test case doesn't actually pass :).
The name should be changed to something like
testify_bucket
orbucket_
.