Skip to content

Instantly share code, notes, and snippets.

@aodag
Created April 22, 2014 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aodag/11184454 to your computer and use it in GitHub Desktop.
Save aodag/11184454 to your computer and use it in GitHub Desktop.
テストケースをもっと明示的にできないかと考えた書き方。こんなデコレータはまだ存在しない。
from testfixtures import compare
from inspirated import testcase_config, test_config
@testcase_config(target='your.product.Foo')
class TestFoo(object):
@test_config(params=[({'var': 1}, 4)])
def test_it(self, target, var, expected):
foo = target()
result = foo.some_method(var)
compare(result, expected)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment