Better test stubs

7 views
Skip to first unread message

Michał Kwiatkowski

unread,
Jan 23, 2009, 7:15:26 AM1/23/09
to pytho...@googlegroups.com
Following Chuck Esterbrook's suggestions (see
http://groups.google.com/group/pythoscope/browse_thread/thread/140f75f6e304b9cf)
I improved test stubs generation. As an example, sample output from
the Pythoscope homepage now looks like this:

import unittest

class TestOldPython(unittest.TestCase):
def test_hiss(self):
# old_python = OldPython(age)
# self.assertEqual(expected, old_python.hiss())
assert False # TODO: implement your test here

def test_object_initialization(self):
# old_python = OldPython(age)
assert False # TODO: implement your test here

if __name__ == '__main__':
unittest.main()

Failing assertion is accompanied with proper object setup and a sample
assertion over function/method return value. Names of arguments are
also present, taken from the function/method signature. If you want to
play more with this feature, you're welcome to do so - changes has
been already merged into trunk. I plan on doing a release soon, so the
feature will be available to a wider audience. Comments?

Cheers,
mk

Chuck Esterbrook

unread,
Jan 23, 2009, 7:19:29 AM1/23/09
to pytho...@googlegroups.com
Looks good.

-Chuck
--
http://cobra-language.com/

Reply all
Reply to author
Forward
0 new messages