Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Test
run: uv run pytest -v tests/

- name: Test deprecated features
run: uv run --group=deprecated pytest -v tests/test_deprecated_package_name.py

check:
name: check all unit tests pass
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ version-file = "src/pytest_artifacts/_version.py"
dev = [
"ruff>=0.14.13",
]
deprecated = [
"pytest-artifact >= 0.2.0.post2"
Comment thread
ketozhang marked this conversation as resolved.
]
24 changes: 24 additions & 0 deletions tests/test_deprecated_package_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Test that the former name of this package `pytest-artifact` (without the 's')
is deprecated and raises a warning when used.
"""

import pytest

pytest_artifact = pytest.importorskip("pytest_artifact")


def test_pytest_artifact_raises_deprecation_warning(pytester):
"""Test that importing pytest_artifact raises a deprecation warning."""
Comment thread
ketozhang marked this conversation as resolved.
pytester.makepyfile("""
def test_something(artifacts):
Comment thread
ketozhang marked this conversation as resolved.
assert artifacts.__module__.split(".")[0] == "pytest_artifact"
""")

result = pytester.runpytest("-v")
assert result.parseoutcomes() == {"passed": 1, "warnings": 1}
Comment thread
ketozhang marked this conversation as resolved.
result.stdout.fnmatch_lines(
[
"*::test_something PASSED*",
"*DeprecationWarning*`pytest-artifact`*deprecated*`pytest-artifacts`*",
]
)
Loading