Skip to content
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: address warnings in test_available_fix.py #4684

Open
terriko opened this issue Jan 10, 2025 · 0 comments
Open

fix: address warnings in test_available_fix.py #4684

terriko opened this issue Jan 10, 2025 · 0 comments
Labels
good first issue Good for newcomers

Comments

@terriko
Copy link
Contributor

terriko commented Jan 10, 2025

Description

We're currently getting the following warning:

test/test_available_fix.py: 16 warnings
  /opt/actions-runner/_work/cve-bin-tool/cve-bin-tool/cve_bin_tool/available_fix/redhat_cve_tracker.py:98: DeprecationWarning: 'maxsplit' is passed as positional argument
    package_name = split(r"-\d", package_data, 1)[0]

Here's the python docs on positional vs keyword arguments:
https://docs.python.org/3/tutorial/controlflow.html#special-parameters

Feel free to do your own searches to find more examples if you want, then change our code to use keyword arguments, which should hopefully make the code more readable overall as well as removing the warnings.

To reproduce

  1. Run pytest on test/test_available_fix.py

Expected behaviour: no warnings
Actual behaviour: the warning above appears

Anything else?

Short tips for new contributors:

  • cve-bin-tool's contributor docs
  • If you've contributed to open source but not this project, you might just want our checklist for a great pull request
  • cve-bin-tool uses https://www.conventionalcommits.org/ style for commit messages, and we have a test that checks the title of your pull request (PR). A good potential title for this one is in the title of this issue.
  • You can make an issue auto close by including a comment "fixes #ISSUENUMBER" in your PR comments where ISSUENUMBER is the actual number of the issue. This "links" the issue to the pull request.

Claiming issues:

  • You do not need to have an issue assigned to you before you work on it. To "claim" an issue either make a linked pull request or comment on the issue saying you'll be working on it.
  • If someone else has already commented or opened a pull request, assume it is claimed and find another issue to work on.
  • If it's been more than 1 week without progress, you can ask in a comment if the claimant is still working on it before claiming it yourself (give them at least 3 days to respond before assuming they have moved on).
@terriko terriko added the good first issue Good for newcomers label Jan 10, 2025
@terriko terriko changed the title fix: set asyncio loop scope fix: address warnings in test_available_fix.py Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant