Skip to content

fix: address warnings in test_available_fix.py #4684

Open
@terriko

Description

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).

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions