replace assert statement by raise statement in aboutcode-org/scancode-toolkit · src/packagedcode/opam.py#4115
Closed
Shivam11702 wants to merge 2 commits intoaboutcode-org:developfrom
Shivam11702:develop
Closed
replace assert statement by raise statement in aboutcode-org/scancode-toolkit · src/packagedcode/opam.py#4115Shivam11702 wants to merge 2 commits intoaboutcode-org:developfrom Shivam11702:develop
Shivam11702 wants to merge 2 commits intoaboutcode-org:developfrom
Shivam11702:develop
Conversation
…-toolkit · src/packagedcode/opam.py Signed-off-by: Shivam11702 <shivam.singh.05.09.03@gmail.com>
pombredanne
requested changes
Jan 23, 2025
Member
pombredanne
left a comment
There was a problem hiding this comment.
Thanks. But this set of comments are NOT a docstring and not executed as doctest, which is a nice thing you helped discover, so your change have no effect. Also these should be tests and we want to keep asserts in tests.
Could you instead transform the whole comment block in a test function in https://github.com/aboutcode-org/scancode-toolkit/blob/develop/tests/packagedcode/test_opam.py
This block:
"""
Example:
>>> p = parse_file_line('authors: "BAP Team"')
>>> assert p.group('key') == ('authors')
>>> assert p.group('value') == ('"BAP Team"')
>>> p = parse_file_line('md5=b7a7b7cce64eabf224d05ed9f2b9d471')
>>> assert p.group('key') == ('md5')
>>> assert p.group('value') == ('b7a7b7cce64eabf224d05ed9f2b9d471')
>>> p = parse_dep('"bap-std" {= "1.0.0"}')
>>> assert p.group('name') == ('bap-std')
>>> assert p.group('version') == ('{= "1.0.0"}')
"""
…rg/scancode-toolkit/blob/develop/tests/packagedcode/test_opam.py in test function Signed-off-by: Shivam11702 <shivam.singh.05.09.03@gmail.com>
Author
|
@pombredanne hey there I have transformed the comment block into a test function and created a pull request . Please review that and let me know is it correct or not. |
Author
|
@pombredanne hello will you check my new pull request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #175 link-aboutcode-org/aboutcode#175
Fixes file #3888
Tasks
Run tests locally to check for errors.