Skip to content

refactor: remove repeated extractor instances in test_extractor.py #2168

@terriko

Description

@terriko

In order to resolve the mypy errors in test_extractor.py, we've added a bunch of instances of extractor / tempdir :
https://github.com/intel/cve-bin-tool/pull/2124/files

This works and gets us a step closer to me being able to enable automatic type checking in our CI, but it feels like maybe we could be more efficient somehow and use object inheritance or something to make it work with fewer lines. I don't have time to mess around with it today, so I'm opening this up as a bug in case someone sees a way to streamline this file.

I don't think this requires deep understanding of our code base, but I don't actually know the best way to do this so, uh, surprise me? I'll mark it as hacktoberfest and a good first issue but it may require some reading (see links below) to figure out the best solution if you're not already an object inheritance + python types wizard. Make sure that whatever you propose passes checks in mypy by doing pip install mypy and then mypy test/test_extractor.py.

Helpful resources 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 PR. (the title of this issue should be close to what you need to use as a title for your PR)
  • 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.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomershacktoberfestgood issue for hacktoberfest participation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions