Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Withers Newsgroups: comp.lang.python Subject: testfixtures 4.8.0 Released! Date: Tue, 2 Feb 2016 15:44:20 +0000 Lines: 50 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de krpNkiReT4h/w699dR5Ihg+nVJ1IFaTbR0wg4BpcjJlw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'warnings': 0.03; 'context': 0.05; 'from:name:chris withers': 0.07; 'list...': 0.07; 'pypi': 0.07; 'from:addr:simplistix.co.uk': 0.09; 'message- id:@simplistix.co.uk': 0.09; 'received:server1.simplistix.co.uk': 0.09; 'received:simplistix.co.uk': 0.09; 'url:github': 0.09; 'python': 0.10; 'def': 0.13; 'received:io': 0.16; 'received:psf.io': 0.16; 'setup(self):': 0.16; 'simplistix': 0.16; 'succinct': 0.16; 'to:name:python list': 0.16; 'url:simplistix': 0.16; 'all,': 0.20; 'from:addr:chris': 0.22; 'cheers,': 0.22; 'testing': 0.25; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'to:no real name:2**1': 0.27; 'raise': 0.29; "i'm": 0.30; 'code': 0.30; 'skip:s 30': 0.31; 'announce': 0.32; 'class': 0.33; 'source': 0.33; 'open': 0.33; 'list': 0.34; 'replace': 0.35; 'should': 0.36; 'to:addr:python-list': 0.36; 'two': 0.37; 'release': 0.37; 'mailing': 0.38; 'to:addr:python.org': 0.40; 'received:uk': 0.61; 'charset:windows-1252': 0.62; 'more': 0.63; 'managers': 0.63; 'here:': 0.63; 'pleased': 0.64; 'url:co': 0.65 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102408 Hi All, I'm pleased to announce the release of testfixtures 4.8.0 featuring the following: - More succinct mocking with Replacer: For setUp usage: class MyTests(TestCase): def setUp(self): replace = Replacer() replace('x.y.z', Mock()) self.addCleanup(replace.restore) For one-shot context manager usage: with Replace('x.y.z', Mock()) as the_mock: ... Multi-replace context manager usage: with Replacer() as replace: dt = replace('x.y.z.datetime', test_datetime()) mock = replace('x.y.do_it', Mock()) - Two context managers for testing warnings: with ShouldWarn(UserWarning("foo")): warnings.warn('foo') with ShouldNotWarn(): ... code that should raise no warnings ... The package is on PyPI and a full list of all the links to docs, issue trackers and the like can be found here: https://github.com/Simplistix/testfixtures Any questions, please do ask on the Testing in Python list or on the Simplistix open source mailing list... cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk