-
-
Notifications
You must be signed in to change notification settings - Fork 32
fix: trying some approaches #237
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,85 @@ | |||||||||||||||||
"""Pytest configuration for json2xml tests.""" | |||||||||||||||||
from __future__ import annotations | |||||||||||||||||
|
|||||||||||||||||
import json | |||||||||||||||||
import os | |||||||||||||||||
|
@@ -4,3 +4,2 @@ | ||
import json | ||
import os | ||
from pathlib import Path |
Fixed
Show fixed
Hide fixed
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the problem, we should remove the unused import statement from _pytest.capture import CaptureFixture
on line 12. This will eliminate the unnecessary dependency and improve code clarity without affecting the functionality of the code.
-
Copy modified line R12
@@ -11,3 +11,3 @@ | ||
if TYPE_CHECKING: | ||
from _pytest.capture import CaptureFixture | ||
|
||
from _pytest.fixtures import FixtureRequest |
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the problem, we should remove the unused import statement from _pytest.fixtures import FixtureRequest
on line 13. This will eliminate the unnecessary dependency and improve code readability without affecting the functionality of the code.
-
Copy modified line R13
@@ -12,3 +12,3 @@ | ||
from _pytest.capture import CaptureFixture | ||
from _pytest.fixtures import FixtureRequest | ||
|
||
from _pytest.logging import LogCaptureFixture |
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the problem, we will remove the unused import statement from _pytest.logging import LogCaptureFixture
on line 14. This will eliminate the unnecessary dependency and improve the code's clarity. No other changes are required, as this import is not used anywhere in the provided code.
-
Copy modified line R14
@@ -13,3 +13,3 @@ | ||
from _pytest.fixtures import FixtureRequest | ||
from _pytest.logging import LogCaptureFixture | ||
|
||
from _pytest.monkeypatch import MonkeyPatch |
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the issue, we should remove the unused import statement from _pytest.monkeypatch import MonkeyPatch
on line 15. This will eliminate the unnecessary dependency and improve the clarity of the code. No other changes are required since the import is not used anywhere in the provided code.
-
Copy modified line R15
@@ -14,3 +14,3 @@ | ||
from _pytest.logging import LogCaptureFixture | ||
from _pytest.monkeypatch import MonkeyPatch | ||
|
||
from pytest_mock.plugin import MockerFixture |
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the problem, we should remove the unused import statement from pytest_mock.plugin import MockerFixture
on line 16. This will eliminate the unnecessary dependency and improve code clarity. No other changes are required since this import is not used anywhere in the code.
-
Copy modified line R16
@@ -15,3 +15,3 @@ | ||
from _pytest.monkeypatch import MonkeyPatch | ||
from pytest_mock.plugin import MockerFixture | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,51 @@ | ||
[tox] | ||
envlist = py310, py311, py312, py313, pypy310, pypy311, py314-full | ||
isolated_build = True | ||
skip_missing_interpreters = True | ||
parallel_show_output = True | ||
|
||
[testenv] | ||
passenv = | ||
CI | ||
GITHUB_* | ||
PYTHONPATH | ||
deps = | ||
pytest>=8.0.0 | ||
pytest-cov>=6.0.0 | ||
pytest-xdist>=3.5.0 | ||
ruff>=0.3.0 | ||
mypy>=1.0.0 | ||
types-setuptools | ||
|
||
allowlist_externals = | ||
pytest | ||
pytest-cov | ||
ruff | ||
mypy | ||
|
||
allowlist_externals = pytest | ||
commands = | ||
pytest --cov=json2xml --cov-report=xml:coverage/reports/coverage.xml --cov-report=term -xvs {posargs:tests} -n auto | ||
|
||
[testenv:lint] | ||
deps = | ||
ruff>=0.3.0 | ||
commands = | ||
ruff check json2xml tests | ||
|
||
[testenv:typecheck] | ||
deps = | ||
mypy>=1.0.0 | ||
types-setuptools | ||
commands = | ||
pytest --cov --cov-report=xml | ||
mypy json2xml tests | ||
|
||
[testenv:py314-full] | ||
deps = | ||
{[testenv]deps} | ||
commands = | ||
{[testenv]commands} | ||
ruff check json2xml tests | ||
mypy json2xml tests | ||
|
||
[pytest] | ||
testpaths = tests | ||
python_files = test_*.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Consider pinning the action to a full semver or commit SHA
Loose tags (e.g.,
v6
) can pull in unexpected patch updates that break builds. Pin to a full semver (e.g.,v6.2.1
) or a commit SHA for reproducible workflows.