Skip to content

Potential fix for code scanning alert no. 11: Unused import#164

Merged
awvwgk merged 1 commit intomainfrom
alert-autofix-11
Feb 6, 2026
Merged

Potential fix for code scanning alert no. 11: Unused import#164
awvwgk merged 1 commit intomainfrom
alert-autofix-11

Conversation

@awvwgk
Copy link
Copy Markdown
Member

@awvwgk awvwgk commented Feb 6, 2026

Potential fix for https://github.com/dftd3/simple-dftd3/security/code-scanning/11

To fix an unused import, remove the unused name from the import statement (or delete the whole import if none of its names are used). This reduces unnecessary dependencies and keeps the module clean.

In this file, the problematic line is from pytest import approx, raises, mark. According to CodeQL, only mark is unused. The best minimal fix that preserves all existing functionality is to keep approx and raises (which are presumably used elsewhere in the file) and drop mark from the import list. No other changes are required.

Concretely:

  • In python/dftd3/test_interface.py, at line 28, change from pytest import approx, raises, mark to from pytest import approx, raises.
  • No new methods, imports, or definitions are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@awvwgk awvwgk requested a review from Copilot February 6, 2026 14:35
@awvwgk awvwgk marked this pull request as ready for review February 6, 2026 14:35
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.34%. Comparing base (80b548d) to head (80fbe44).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #164   +/-   ##
=======================================
  Coverage   66.34%   66.34%           
=======================================
  Files          33       33           
  Lines        4627     4627           
  Branches     1608     1608           
=======================================
  Hits         3070     3070           
  Misses        637      637           
  Partials      920      920           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@awvwgk awvwgk merged commit fa26c41 into main Feb 6, 2026
40 checks passed
@awvwgk awvwgk deleted the alert-autofix-11 branch February 6, 2026 14:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CodeQL code scanning alert #11 (“Unused import”) in the Python test suite by removing an unused pytest import while keeping the test behavior unchanged.

Changes:

  • Removed the unused mark name from from pytest import approx, raises, mark.
  • Kept approx and raises, which are used in the file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants