CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
792 stars 75 forks source link

Consider creating 'Parameterized tests' #38

Closed marek-mazur closed 9 years ago

marek-mazur commented 9 years ago

Parameterized tests are the only one feature that i miss in green.

@params(1, 2, 3)
def test_nums(num):
    assert num < 4

or

@params((1, 2), (2, 3), (4, 5))
    def test_less_than(self, a, b):
        assert a < b

http://nose2.readthedocs.org/en/latest/params.html https://github.com/nose-devs/nose2/blob/master/nose2/tools/params.py

CleanCut commented 9 years ago

That looks pretty cool!

marek-mazur commented 9 years ago

Any plans?

CleanCut commented 9 years ago

I don't have any current plans, no. I have lots of other things going on at the moment.

I'd be happy to review a pull request if you or someone else would like to take a stab at it!

marek-mazur commented 9 years ago

Ok. I will try to do it, when i find some time. ;)

Julian commented 9 years ago

I'm not the author obviously :), but green is a test runner. It's annoying when things reinvent this sort of thing -- there are libraries that do this, and they should (I expect) work with green.

https://pypi.python.org/pypi/testscenarios is one, and I'm fairly sure I've ran green on test suites that use it successfully (although I use a fork of testscenarios which is even more likely to work with green).

CleanCut commented 9 years ago

Okay, we now support nose's parameterized tests in theory. Give it a try and let me know how it actually goes in practice. I'll consider this fixed unless I hear otherwise.