Ben Finney wrote:
> Ben Finney <[EMAIL PROTECTED]> wrote:
>> Summary: I'm looking for idioms in unit tests for factoring out
>> repetitive iteration over test data.
>
> Thanks to those who've offered suggestions, especially those who
> suggested I look at generator functions. This leads to::
Here
Ben Finney <[EMAIL PROTECTED]> wrote:
> Summary: I'm looking for idioms in unit tests for factoring out
> repetitive iteration over test data.
Thanks to those who've offered suggestions, especially those who
suggested I look at generator functions. This leads to::
import unittest
import
Ben Finney wrote:
> Maybe I need to factor out the iteration into a generic iteration
> function, taking the actual test as a function object. That way, the
> dataset iterator doesn't need to know about the test function, and
> vice versa.
>
> def iterate_test(self, test_func, test_params=
On Tue, 6 Dec 2005 12:19:40 +1100 (EST), Ben Finney <[EMAIL PROTECTED]> wrote:
>Howdy all,
>
>Summary: I'm looking for idioms in unit tests for factoring out
>repetitive iteration over test data. I explain my current practice,
>and why it's unsatisfactory.
>
Does this do what you want?
http:/
Scott David Daniels <[EMAIL PROTECTED]> wrote:
> Ben Finney wrote:
> > Summary: I'm looking for idioms in unit tests for factoring out
> > repetitive iteration over test data
>
> How about something like:
>
> > class Test_Game(unittest.TestCase):
[...]
>def runs(self, throws):
Ben Finney wrote:
> Summary: I'm looking for idioms in unit tests for factoring out
> repetitive iteration over test data
How about something like:
> import unittest, bowling
> class Test_Game(unittest.TestCase):
> def setUp(self):
> """ Set up test fixtures """
>