[TIP] Sclara is a Python testing DSL
andrea.crotti.0 at gmail.com
Mon Mar 26 06:10:51 PDT 2012
On 03/26/2012 01:48 PM, Ned Batchelder wrote:
> On 3/26/2012 8:28 AM, Staple, Danny (BSKYB) wrote:
>> Hmm -- I am thinking that a python dsl similar to JS's Jasmine with
>> matchers would be doable.
>> with describe("foo"):
>> It("should throw bar"):
>> expect( lambda : foo.doStuff()).toRaise(BarException);
> I've never seen the value in ladling English all over my test cases.
> How is your code better than what you can currently do with unittest?:
> def test_should_throw_bar(self):
> """foo should throw bar"""
> with self.assertRaises(BarException):
> Not to mention, the snippet you presented isn't valid Python, yet
> involves a lambda...
Agreed, in this way you throw away the help given from your editor to
check your syntax validity,
writing the same code (if not harder).
I like the idea of hierarchical context, but it also looks like that
every time you have to do that probably
the code smells bad already..
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python