Conversation
| @@ -0,0 +1,234 @@ | |||
| # ------------------------------------------------------------------------- | |||
Check warning
Code scanning / lintrunner
RUFF-FORMAT/format Warning test
|
|
||
|
|
||
| def _create_source_dir(tmp_path, name, model_attributes, model_type="ONNXModel"): | ||
| """Helper to create a fake context binary output directory with model_config.json.""" |
Check warning
Code scanning / lintrunner
RUFF/D401 Warning test
|
|
||
| class TestMergeContextBinaryCommand: | ||
| def _run_command(self, args): | ||
| """Helper to parse args and run the command.""" |
Check warning
Code scanning / lintrunner
RUFF/D401 Warning test
|
|
||
| p = self._create_packager() | ||
| output_path = str(tmp_path / "output.onnx") | ||
| result = p.run(mt, output_path) |
Check notice
Code scanning / CodeQL
Unused local variable Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 hours ago
To fix the problem, remove the unused local variable while preserving the side-effecting call to p.run. We should not delete the call itself because it is what generates the manifest file the test inspects. The minimal change is to replace result = p.run(mt, output_path) with p.run(mt, output_path), eliminating the unused variable.
Concretely, in test/passes/onnx/test_multi_target_context_binary.py, within TestEPContextBinaryPackager.test_packager_with_sdk_version, change line 182 so that it calls p.run(mt, output_path) without assigning its result to any variable. No new imports, methods, or definitions are required.
| @@ -179,7 +179,7 @@ | ||
|
|
||
| p = self._create_packager() | ||
| output_path = str(tmp_path / "output.onnx") | ||
| result = p.run(mt, output_path) | ||
| p.run(mt, output_path) | ||
|
|
||
| manifest_path = tmp_path / "output" / "manifest.json" | ||
| with open(manifest_path) as f: |
|
|
||
|
|
||
| try: | ||
| import onnxruntime |
Check notice
Code scanning / CodeQL
Unused import Note test
Copilot Autofix
AI about 2 hours ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| @@ -0,0 +1,496 @@ | |||
| # ------------------------------------------------------------------------- | |||
Check warning
Code scanning / lintrunner
RUFF/format Warning test
| @@ -0,0 +1,496 @@ | |||
| # ------------------------------------------------------------------------- | |||
Check warning
Code scanning / lintrunner
RUFF-FORMAT/format Warning test
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
| # -------------------------------------------------------------------------- | ||
| import json |
Check warning
Code scanning / lintrunner
RUFF/I001 Warning test
|
|
||
| p = self._create_packager() | ||
| output_path = str(tmp_path / "output.onnx") | ||
| result = p.run(mt, output_path) |
Check warning
Code scanning / lintrunner
PYLINT/W0612 Warning test
|
|
||
| p = self._create_packager() | ||
| output_path = str(tmp_path / "output.onnx") | ||
| result = p.run(mt, output_path) |
Check warning
Code scanning / lintrunner
RUFF/F841 Warning test
|
|
||
|
|
||
| try: | ||
| import onnxruntime |
Check warning
Code scanning / lintrunner
PYLINT/W0611 Warning test
|
|
||
|
|
||
| try: | ||
| import onnxruntime |
Check warning
Code scanning / lintrunner
RUFF/F401 Warning test
| assert mock_single.call_count == 2 | ||
|
|
||
| # Check model_attributes on targets | ||
| for name, target in result.get_target_models(): |
Check warning
Code scanning / lintrunner
PYLINT/W0612 Warning test
| assert mock_single.call_count == 2 | ||
|
|
||
| # Check model_attributes on targets | ||
| for name, target in result.get_target_models(): |
Check warning
Code scanning / lintrunner
RUFF/B007 Warning test
Describe your changes
Checklist before requesting a review
lintrunner -a(Optional) Issue link