--gen-kata

3 views
Skip to first unread message

Olof Bjarnason

unread,
Feb 4, 2014, 9:01:07 PM2/4/14
to pytd...@googlegroups.com
To scratch an itch I have with Pythons unittest framework, I've added the --gen-kata command line argument to the latest version of pytddmon (v1.0.4).

The itch is that some boilerplate code is always necessary to have to get started writing TestCase based unit tests.  So typical kata use case: you want to write tests for some new stuff immediately, and not fiddle around with unittests' wordy syntax.

So why not generate that boilerplate, I thought?

This is what it looks like in action:

(pytddmon2014)~/kata| pytddmon.py --gen-kata 'some kata'
Writing kata unit test template to test_some_kata.py.
(pytddmon2014)~/kata| cat test_some_kata.py 
import unittest
# Unit tests for kata 'some kata'.

class SomeKataTests(unittest.TestCase):

    def test_something(self):
        self.assertTrue(True)

    def test_another_thing(self):
        self.assertEqual([1, 2], range(1, 3))

(pytddmon2014)~/kata| 


/Olof
Reply all
Reply to author
Forward
0 new messages