diff options
author | Robert Collins <robertc@robertcollins.net> | 2012-12-17 11:48:58 +1300 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2012-12-17 11:48:58 +1300 |
commit | 4cbce7d3fa1fd3faec044868c9443bc24f391d67 (patch) | |
tree | 80e301e2a7392f081fd2ab626206dc5972c83e70 /README | |
parent | b9dac139cb0d92f3f72d64aff4486defbb59510f (diff) | |
parent | 08f31e951497aa600055bf7cb5f18acf4c6e1884 (diff) | |
download | fixtures-4cbce7d3fa1fd3faec044868c9443bc24f391d67.tar.gz |
* ``DetailStream`` was ambiguous about whether it handled bytes or characters,
which matters a lot for Python3. It now is deprecated with ByteStream and
StringStream replacing it. (Robert Collins)
* Fixtures is now Python3 compatible. (Robert Collins)
Diffstat (limited to 'README')
-rw-r--r-- | README | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -266,16 +266,16 @@ In addition to the Fixture, FunctionFixture and MethodFixture classes fixtures includes a number of precanned fixtures. The API docs for fixtures will list the complete set of these, should the dcs be out of date or not to hand. -DetailStream -++++++++++++ +ByteStream +++++++++++ -Trivial adapter to make a StringIO (though it may in future auto-spill to disk +Trivial adapter to make a BytesIO (though it may in future auto-spill to disk for large content) and expose that as a detail object, for automatic inclusion in test failure descriptions. Very useful in combination with MonkeyPatch. - >>> fixture = fixtures.DetailStream('stdout') + >>> fixture = fixtures.StringStream('my-content') >>> fixture.setUp() - >>> with fixtures.MonkeyPatch('sys.stdout', fixture.stream): + >>> with fixtures.MonkeyPatch('sys.something', fixture.stream): ... pass >>> fixture.cleanUp() @@ -349,6 +349,19 @@ nothing happens, if it isn't then it is added on setUp and removed on cleanUp. >>> fixture = fixtures.PythonPathEntry('/foo/bar') +StringStream +++++++++++++ + +Trivial adapter to make a StringIO (though it may in future auto-spill to disk +for large content) and expose that as a detail object, for automatic inclusion +in test failure descriptions. Very useful in combination with MonkeyPatch. + + >>> fixture = fixtures.StringStream('stdout') + >>> fixture.setUp() + >>> with fixtures.MonkeyPatch('sys.stdout', fixture.stream): + ... pass + >>> fixture.cleanUp() + TempDir +++++++ |