spurious reset before tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testresources |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
The following test script shows a spurious reset. It is due to the resource being always dirty, and getResource called from the test case. I'm not sure how to fix this, and it should be relatively cheap - if folk are overriding reset its because they can tune it.
import unittest
import testresources
resource_value = object()
class Resource(
def make(self, dependency_
print "Making resource"
return resource_value
def reset(self, old_resource, result=None):
print "Resetting resource"
assert old_resource is resource_value
return resource_value
def clean(self, resource):
print "Cleaning resource"
assert resource is resource_value
# This doesn't seem to work.
def isDirty(self):
return True
some_resource = Resource()
class ResetTests(
resources = [('foo', some_resource)]
def test_one(self):
print "Test one"
def test_two(self):
print "Test two"
def suite():
result = testresources.
return result
if __name__ == '__main__':
unittest.
Changed in testresources: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |