summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2012-08-04 18:23:42 +0100
committerJonathan Lange <jml@canonical.com>2012-08-04 18:23:42 +0100
commit8273c94ad26f711ccbb5f83adac3d10382ffac93 (patch)
tree088320c76429294ea6e47db9cd7fdb8e400b9fc5
parent2f036bbafe1cb6977d883d96604eac595fe92a95 (diff)
downloadfixtures-8273c94ad26f711ccbb5f83adac3d10382ffac93.tar.gz
Roll back properly.
-rw-r--r--NEWS6
-rw-r--r--README2
-rw-r--r--lib/fixtures/tests/_fixtures/test_tempdir.py6
-rw-r--r--lib/fixtures/tests/_fixtures/test_temphomedir.py5
-rw-r--r--lib/fixtures/tests/helpers.py21
5 files changed, 6 insertions, 34 deletions
diff --git a/NEWS b/NEWS
index 4d18674..7338b62 100644
--- a/NEWS
+++ b/NEWS
@@ -6,12 +6,6 @@ fixtures release notes
NEXT
~~~~
-CHANGES:
-
-* New method ``make_tree`` on ``TempDir``. Easily creates a structure of
- files and directories underneath a temporary directory.
- (Jonathan Lange)
-
0.3.9
~~~~~
diff --git a/README b/README
index a3ceda1..be3a589 100644
--- a/README
+++ b/README
@@ -28,7 +28,7 @@ Dependencies
* Python 2.4+
This is the base language fixtures is written in and for.
-* testtools <https://launchpad.net/testtools> 0.9.13 or newer.
+* testtools <https://launchpad.net/testtools> 0.9.12 or newer.
testtools provides helpful glue functions for the details API used to report
information about a fixture (whether its used in a testing or production
environment).
diff --git a/lib/fixtures/tests/_fixtures/test_tempdir.py b/lib/fixtures/tests/_fixtures/test_tempdir.py
index cacebb5..7fc5d45 100644
--- a/lib/fixtures/tests/_fixtures/test_tempdir.py
+++ b/lib/fixtures/tests/_fixtures/test_tempdir.py
@@ -1,6 +1,6 @@
# fixtures: Fixtures with cleanups for testing and convenience.
#
-# Copyright (c) 2010, 2012 Robert Collins <robertc@robertcollins.net>
+# Copyright (c) 2010, Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
@@ -23,14 +23,14 @@ from fixtures import (
NestedTempfile,
TempDir,
)
-from fixtures.tests.helpers import HasNoAttribute
class TestTempDir(testtools.TestCase):
def test_basic(self):
fixture = TempDir()
- self.assertThat(fixture, HasNoAttribute('path'))
+ sentinel = object()
+ self.assertEqual(sentinel, getattr(fixture, 'path', sentinel))
fixture.setUp()
try:
path = fixture.path
diff --git a/lib/fixtures/tests/_fixtures/test_temphomedir.py b/lib/fixtures/tests/_fixtures/test_temphomedir.py
index 028ebbe..339ce2c 100644
--- a/lib/fixtures/tests/_fixtures/test_temphomedir.py
+++ b/lib/fixtures/tests/_fixtures/test_temphomedir.py
@@ -22,14 +22,13 @@ from fixtures import (
TempDir,
TempHomeDir,
)
-from fixtures.tests.helpers import HasNoAttribute
-
class TestTempDir(testtools.TestCase):
def test_basic(self):
fixture = TempHomeDir()
- self.assertThat(fixture, HasNoAttribute('path'))
+ sentinel = object()
+ self.assertEqual(sentinel, getattr(fixture, 'path', sentinel))
fixture.setUp()
try:
path = fixture.path
diff --git a/lib/fixtures/tests/helpers.py b/lib/fixtures/tests/helpers.py
index 6ae07cc..ae0d8d3 100644
--- a/lib/fixtures/tests/helpers.py
+++ b/lib/fixtures/tests/helpers.py
@@ -15,9 +15,6 @@
import fixtures
-from testtools.matchers import Mismatch
-
-
class LoggingFixture(fixtures.Fixture):
def __init__(self, suffix='', calls=None):
@@ -34,21 +31,3 @@ class LoggingFixture(fixtures.Fixture):
def reset(self):
self.calls.append('reset' + self.suffix)
-
-
-class HasNoAttribute(object):
- """For asserting that an object does not have a particular attribute."""
-
- def __init__(self, attr_name):
- self._attr_name = attr_name
-
- def __str__(self):
- return 'HasNoAttribute(%s)' % (self._attr_name,)
-
- def match(self, obj):
- sentinel = object()
- value = getattr(obj, self._attr_name, sentinel)
- if value is not sentinel:
- return Mismatch(
- "%s is an attribute of %r: %r" % (
- self._attr_name, obj, value))