-
Notifications
You must be signed in to change notification settings - Fork 11
Implement group parametrization #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
86a1646
to
ac26e0b
Compare
fea8bae
to
8681bf0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about command-line arguments parsing? We discussed it orally. Are you going to implement it in a different PR?
We also discussed restricting types of parameters values. Because group name formatting a.b_1.c_3
doesn't look pretty, and in the case of a table it would be even worse. You can take a look at pytest which luatest was inspired by.
README.rst
Outdated
@@ -73,6 +73,18 @@ Define tests. | |||
g.test_example_2 = function() ... end | |||
g.test_example_m = function() ... end | |||
|
|||
-- Define parametrized groups | |||
local pg = t.group('pgroup', {param_1 = {1, 2}, param_2 = {3, 4}}) | |||
-- type(cg.params.param_1) == 'number' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- type(cg.params.param_1) == 'number' | |
-- type(pg.params.param_1) == 'number' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it's ok
test/parametrization_test.lua
Outdated
t.assert_error_msg_contains( | ||
'Parameter values should be table, got number', | ||
function() t.group('parametrized', {['name'] = 1}) end | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about key-value tables instead of an array? Is it ever legal?
t.group('parametrized', {param = {key = 'value'}})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Illegal and banned
6186e40
to
edd4eb3
Compare
In PR's description checkbox "Documentation" is checked. But commit doesn't contain any feature description. Could you add a couple of words to the README? |
edd4eb3
to
72602fb
Compare
I have added a new section about parametrization to README. There were some examples already, but it wasn't comprehensive |
fa87476
to
007750a
Compare
0d58bc5
to
18891e3
Compare
18891e3
to
7c34981
Compare
4f7baa6
to
62d0eb6
Compare
Implement group parametrization
Test with specified params can be started from command line
I didn't forget about
Close #116