diff -ru testresources-0.2.4/lib/testresources/__init__.py testresources-0.2.4-patched/lib/testresources/__init__.py --- testresources-0.2.4/lib/testresources/__init__.py 2010-02-26 23:46:44.000000000 +0100 +++ testresources-0.2.4-patched/lib/testresources/__init__.py 2011-05-16 15:49:06.000000000 +0200 @@ -561,7 +561,7 @@ :return: The new resource. :param result: An optional TestResult to report resource changes to. """ - if self._dirty: + if self.isDirty(): self._clean_all(old_resource, result) resource = self._make_all(result) else: diff -ru testresources-0.2.4/lib/testresources/tests/test_test_resource.py testresources-0.2.4-patched/lib/testresources/tests/test_test_resource.py --- testresources-0.2.4/lib/testresources/tests/test_test_resource.py 2010-02-26 23:38:19.000000000 +0100 +++ testresources-0.2.4-patched/lib/testresources/tests/test_test_resource.py 2011-05-16 15:47:25.000000000 +0200 @@ -208,6 +208,17 @@ self.assertEqual(1, resource_manager.resets) resource_manager.finishedWith(resource) + def testIsResetIfDependenciesAreDirty(self): + resource_manager = MockResource() + dep1 = MockResource() + resource_manager.resources.append(("dep1", dep1)) + r = resource_manager.getResource() + dep1.dirtied(r.dep1) + # if we get the resource again, it should be clean + r = resource_manager.getResource() + self.assertFalse(resource_manager.isDirty()) + self.assertFalse(dep1.isDirty()) + def testUsedResourceResetBetweenUses(self): resource_manager = MockResettableResource() # take two refs; like happens with OptimisingTestSuite.