summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2010-01-24 15:45:19 +1100
committerRobert Collins <robertc@robertcollins.net>2010-01-24 15:45:19 +1100
commit56749c91f15daa348dc95333bd948b39461c2123 (patch)
treebf2911578fcecaf420f474f4148a5cac3f3fad4a
parent5a04cbba11f97a7db1057b602b0fd09d59e7b0ca (diff)
downloadtestresources-56749c91f15daa348dc95333bd948b39461c2123.tar.gz
Release 0.2.3.
-rw-r--r--MANIFEST.in1
-rw-r--r--Makefile3
-rw-r--r--NEWS5
-rw-r--r--README13
-rw-r--r--doc/example.py2
-rwxr-xr-xsetup.py2
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
diff --git a/Makefile b/Makefile
index 0b76456..5192b16 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/NEWS b/NEWS
index 52ad2a6..aae6183 100644
--- a/NEWS
+++ b/NEWS
@@ -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.
diff --git a/README b/README
index cb6437d..89e9927 100644
--- a/README
+++ b/README
@@ -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()
diff --git a/setup.py b/setup.py
index dede515..cb6dd2d 100755
--- a/setup.py
+++ b/setup.py
@@ -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",