-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix mark.it titles when used with mark.parametrize #23
Conversation
@cartertinney could you please test if this will do the job for the cases you're working on? You can test using @renanivo I've marked as a draft pull request until you or @cartertinney can confirm that it work as expected. Here the output for some tests I did: @pytest.mark.parametrize('a_param', [
'String',
1234,
[],
{}
])
@pytest.mark.it('It should display a nice name')
def test_foobar(self, a_param):
assert True
Without using
|
Codecov Report
@@ Coverage Diff @@
## master #23 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 185 193 +8
=====================================
+ Hits 185 193 +8
Continue to review full report at Codecov.
|
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.
Looks Great! 👏
Yeah, just tried it out, working great here. Thanks a bunch. 💯 |
Allow use of custom titles using
pytest.mark.it
along with parametrized tests. Fixes #22.When
mark.parametrize
is used, pytest includes the parameters in the last part ofnodeid
(e.g.test_module_name.py::test_a_passing_test[this is a param]
).I used the fact that function names cannot contain brackets to safely extract parameters. Parameters may include brackets, though.
I think function names and arguments I wrote may need a more thorough review.