diff options
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | README | 13 | ||||
-rw-r--r-- | doc/example.py | 2 | ||||
-rwxr-xr-x | setup.py | 2 |
6 files changed, 19 insertions, 7 deletions
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..e0c915f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include doc/*.py @@ -14,4 +14,7 @@ TAGS: lib/testresources/*.py lib/testresources/tests/*.py tags: lib/testresources/*.py lib/testresources/tests/*.py ctags -R lib/testresources/ +release: + python setup.py sdist upload --sign + .PHONY: all check clean @@ -5,12 +5,17 @@ testresources release notes IN DEVELOPMENT -------------- +0.2.2 +----- + CHANGES ~~~~~~~ IMPROVEMENTS ~~~~~~~~~~~~ +* Distribute doc/*.py in the source tarball. + * New helper testresources.GenericResource which should remove the need for much boilerplate when using testresources with existing test fixtures. @@ -41,10 +41,9 @@ These are the main components to make testresources work: 1) testresources.TestResource A TestResource is an object that tests can use. Usually a subclass of -testresources.TestResource, with the getResource method overridden. This method -should return an object providing the resource that the client needs (which can -Optionally, the clean() method can be overridden if the resource needs to take -action to clean up external resources (e.g. threads, disk files, ...). +testresources.TestResource, with the make and possibly the clean and isDirty +methods overridden. These methods create, decide on reuse and free resources. + The 'resources' list on the TestResource object is used to declare dependencies. For instance, a DataBaseResource that needs a TemporaryDirectory might be declared with a resources list:: @@ -57,8 +56,10 @@ Most importantly, two getResources to the same TestResource with no finishedWith call in the middle, will return the same object as long as it has not been marked dirty. -The goals for TestResources that cannot finish properly are not yet clear, so -for now the behaviour will to silently continue. +When a Test has a dependency and that dependency successfully completes but +returns None, the framework does *not* consider this an error: be sure to always +return a valid resource, or raise an error. Error handling hasn't been heavily +exercised, but any bugs in this area will be promptly dealt with. A sample TestResource can be found in the doc/ folder. diff --git a/doc/example.py b/doc/example.py index d7c0187..b656364 100644 --- a/doc/example.py +++ b/doc/example.py @@ -40,4 +40,6 @@ class SampleWithDependencies(TestResource): resources = [('foo', SampleTestResource()), ('bar', SampleTestResource())] def make(self, dependency_resources): + # dependency_resources will be {'foo': result_of_make_in_foo, 'bar': + # result_of_make_in_bar} return MyResource() @@ -3,7 +3,7 @@ from distutils.core import setup setup(name="testresources", - version="0.2.2", + version="0.2.3", description="Testresources, a pyunit extension for managing expensive " "test resources", maintainer="Test Resources developers", |