Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pytest-deadfixtures for 
openSUSE:Factory checked in at 2026-01-27 16:07:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-deadfixtures (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-deadfixtures.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-deadfixtures"

Tue Jan 27 16:07:02 2026 rev:2 rq:1329203 version:3.1.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-deadfixtures/python-pytest-deadfixtures.changes
    2025-12-19 16:46:08.130598496 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-deadfixtures.new.1928/python-pytest-deadfixtures.changes
  2026-01-27 16:07:29.997984574 +0100
@@ -1,0 +2,7 @@
+Mon Jan 26 09:03:03 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 3.1.0:
+  * Add deadfixtures_ignore decorator to ignore specific fixtures
+    from being reported as unused
+
+-------------------------------------------------------------------

Old:
----
  pytest_deadfixtures-3.0.0.tar.gz

New:
----
  pytest_deadfixtures-3.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pytest-deadfixtures.spec ++++++
--- /var/tmp/diff_new_pack.KxGVXQ/_old  2026-01-27 16:07:33.102115480 +0100
+++ /var/tmp/diff_new_pack.KxGVXQ/_new  2026-01-27 16:07:33.110115817 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           python-pytest-deadfixtures
-Version:        3.0.0
+Version:        3.1.0
 Release:        0
 Summary:        A simple plugin to list unused fixtures in pytest
 License:        MIT

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.KxGVXQ/_old  2026-01-27 16:07:33.166118179 +0100
+++ /var/tmp/diff_new_pack.KxGVXQ/_new  2026-01-27 16:07:33.182118853 +0100
@@ -1,6 +1,6 @@
-mtime: 1766114730
-commit: f13ee49e61eea34e11cb2e9036ac87695417e9b355954f62a7d175de4d4f7a8f
+mtime: 1769418189
+commit: ec2c44a227e5568dd503d3a60127e3e4b1d86371224c8d352cf2bbb7d150089f
 url: https://src.opensuse.org/python-pytest/python-pytest-deadfixtures
-revision: f13ee49e61eea34e11cb2e9036ac87695417e9b355954f62a7d175de4d4f7a8f
+revision: ec2c44a227e5568dd503d3a60127e3e4b1d86371224c8d352cf2bbb7d150089f
 projectscmsync: https://src.opensuse.org/python-pytest/_ObsPrj.git
 

++++++ pytest_deadfixtures-3.0.0.tar.gz -> pytest_deadfixtures-3.1.0.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-deadfixtures-3.0.0/CHANGES.rst 
new/pytest-deadfixtures-3.1.0/CHANGES.rst
--- old/pytest-deadfixtures-3.0.0/CHANGES.rst   2025-10-23 13:35:47.000000000 
+0200
+++ new/pytest-deadfixtures-3.1.0/CHANGES.rst   2026-01-15 21:05:17.000000000 
+0100
@@ -1,6 +1,11 @@
 Changelog
 ---------
 
+3.1.0
+~~~~~
+
+* Add `deadfixtures_ignore` decorator to ignore specific fixtures from being 
reported as unused
+
 3.0.0
 ~~~~~
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-deadfixtures-3.0.0/Makefile 
new/pytest-deadfixtures-3.1.0/Makefile
--- old/pytest-deadfixtures-3.0.0/Makefile      2025-10-23 13:35:47.000000000 
+0200
+++ new/pytest-deadfixtures-3.1.0/Makefile      2026-01-15 21:05:17.000000000 
+0100
@@ -13,12 +13,14 @@
        pytest
 
 test-release: clear
-       python setup.py sdist bdist_wheel upload -r pypitest
+       python setup.py sdist bdist_wheel
+       twine upload dist/* -r testpypi
 
 release: clear
        git tag `python setup.py -q version`
        git push origin `python setup.py -q version`
-       python setup.py sdist bdist_wheel upload -r pypi
+       python setup.py sdist bdist_wheel
+       twine upload dist/* -r pypi
 
 setup:
        pip install -U -r requirements-dev.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-deadfixtures-3.0.0/README.rst 
new/pytest-deadfixtures-3.1.0/README.rst
--- old/pytest-deadfixtures-3.0.0/README.rst    2025-10-23 13:35:47.000000000 
+0200
+++ new/pytest-deadfixtures-3.1.0/README.rst    2026-01-15 21:05:17.000000000 
+0100
@@ -19,6 +19,7 @@
 
 * List unused fixtures in your tests
 * List duplicated fixtures
+* Ignore specific fixtures from analysis with @deadfixtures_ignore
 
 
 Installation
@@ -92,6 +93,32 @@
     Fixture name: someclass_samefixture, location: test_repeated_fixtures.py:17
 
 
+Ignoring specific fixtures
+**************************
+
+You can use the `@deadfixtures_ignore` decorator to exclude specific fixtures 
from the analysis::
+
+    from pytest_deadfixtures import deadfixtures_ignore
+
+    @pytest.fixture
+    @deadfixtures_ignore
+    def intentionally_unused_fixture():
+        """This fixture won't be reported as unused."""
+        return "something"
+
+To see which fixtures are being ignored, use the `--show-ignored-fixtures` 
option::
+
+    $ pytest --dead-fixtures --show-ignored-fixtures
+    ============================= test session starts 
==============================
+    (hidden for brevity)
+
+    No unused fixtures found. Great job!
+
+    Ignored fixtures (1):
+    Fixture name: intentionally_unused_fixture, location: conftest.py:10
+
+    ========================= no tests ran in 0.00 seconds 
=========================
+
 Projects using it
 -----------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-deadfixtures-3.0.0/pytest_deadfixtures.py 
new/pytest-deadfixtures-3.1.0/pytest_deadfixtures.py
--- old/pytest-deadfixtures-3.0.0/pytest_deadfixtures.py        2025-10-23 
13:35:47.000000000 +0200
+++ new/pytest-deadfixtures-3.1.0/pytest_deadfixtures.py        2026-01-15 
21:05:17.000000000 +0100
@@ -17,6 +17,9 @@
 )
 UNUSED_FIXTURES_NOT_FOUND_HEADLINE = "Cool, every declared fixture is being 
used."
 
+IGNORED_FIXTURES_HEADLINE = "Ignored fixture(s) {count}:"
+IGNORED_FIXTURES_ATTR = "_deadfixtures_ignore"
+
 EXIT_CODE_ERROR = 11
 EXIT_CODE_SUCCESS = 0
 
@@ -41,6 +44,12 @@
         default=False,
         help="Show duplicated fixtures",
     )
+    group.addoption(
+        "--show-ignored-fixtures",
+        action="store_true",
+        default=False,
+        help="Show fixtures ignored with `deadfixtures_ignore` mark",
+    )
 
 
 def pytest_cmdline_main(config):
@@ -63,6 +72,17 @@
     return curdir.bestrelpath(loc)
 
 
+def deadfixtures_ignore(func):
+    """Decorator to mark fixtures that should be ignored by the plugin."""
+    setattr(func, IGNORED_FIXTURES_ATTR, True)
+    return func
+
+
+def is_ignored_fixture(fixturedef):
+    """Check if a fixture is marked as ignored."""
+    return getattr(fixturedef.func, IGNORED_FIXTURES_ATTR, False)
+
+
 def get_fixtures(session):
     available = []
     seen = set()
@@ -214,16 +234,25 @@
     session.perform_collect()
     tw = _pytest.config.create_terminal_writer(config)
     show_fixture_doc = config.getvalue("show_fixture_doc")
+    show_ignored = config.getvalue("show_ignored_fixtures")
 
     used_fixtures = get_used_fixturesdefs(session)
     available_fixtures = get_fixtures(session)
     param_fixtures = get_parametrized_fixtures(session, available_fixtures)
 
+    # Separate ignored and unused fixtures
+    ignored_fixtures = [
+        fixture
+        for fixture in available_fixtures
+        if is_ignored_fixture(fixture.fixturedef)
+    ]
+
     unused_fixtures = [
         fixture
         for fixture in available_fixtures
         if fixture.fixturedef not in used_fixtures
         and fixture.fixturedef not in param_fixtures
+        and not is_ignored_fixture(fixture.fixturedef)
     ]
 
     tw.line()
@@ -234,4 +263,11 @@
         write_fixtures(tw, unused_fixtures, show_fixture_doc)
     else:
         tw.line(UNUSED_FIXTURES_NOT_FOUND_HEADLINE, green=True)
+
+    # Show ignored fixtures if requested
+    if show_ignored and ignored_fixtures:
+        tw.line()
+        tw.line(IGNORED_FIXTURES_HEADLINE.format(count=len(ignored_fixtures)), 
yellow=True)
+        write_fixtures(tw, ignored_fixtures, show_fixture_doc)
+
     return unused_fixtures
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-deadfixtures-3.0.0/setup.py 
new/pytest-deadfixtures-3.1.0/setup.py
--- old/pytest-deadfixtures-3.0.0/setup.py      2025-10-23 13:35:47.000000000 
+0200
+++ new/pytest-deadfixtures-3.1.0/setup.py      2026-01-15 21:05:17.000000000 
+0100
@@ -68,7 +68,6 @@
         "Programming Language :: Python :: Implementation :: CPython",
         "Programming Language :: Python :: Implementation :: PyPy",
         "Operating System :: OS Independent",
-        "License :: OSI Approved :: MIT License",
     ],
     cmdclass={"version": VersionCommand},
     entry_points={"pytest11": ["deadfixtures = pytest_deadfixtures"]},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-deadfixtures-3.0.0/tests/test_deadfixtures.py 
new/pytest-deadfixtures-3.1.0/tests/test_deadfixtures.py
--- old/pytest-deadfixtures-3.0.0/tests/test_deadfixtures.py    2025-10-23 
13:35:47.000000000 +0200
+++ new/pytest-deadfixtures-3.1.0/tests/test_deadfixtures.py    2026-01-15 
21:05:17.000000000 +0100
@@ -613,3 +613,51 @@
     # Currently these cases are recognized as a false positive, whereas they 
shouldn't be.
     # Due to the dynamic lookup of the fixture, this is going to be hard to 
recognize.
     assert "some_common_fixture" not in result.stdout.str()
+
+
+def test_ignored_unused_fixture(pytester):
+    pytester.makepyfile(
+        """
+        import pytest
+        from pytest_deadfixtures import deadfixtures_ignore
+
+
+        @pytest.fixture()
+        @deadfixtures_ignore
+        def some_fixture():
+            return 1
+
+
+        def test_simple():
+            assert 1 == 1
+    """
+    )
+
+    result = pytester.runpytest("--dead-fixtures")
+
+    assert "some_fixture" not in result.stdout.str()
+
+
+def test_list_ignored_unused_fixture_when_flagged(pytester, message_template):
+    pytester.makepyfile(
+        """
+        import pytest
+        from pytest_deadfixtures import deadfixtures_ignore
+
+
+        @pytest.fixture()
+        @deadfixtures_ignore
+        def some_fixture():
+            return 1
+
+
+        def test_simple():
+            assert 1 == 1
+    """
+    )
+
+    result = pytester.runpytest("--dead-fixtures", "--show-ignored-fixtures")
+    message = message_template.format(
+        "some_fixture", "test_list_ignored_unused_fixture_when_flagged"
+    )
+    assert message in result.stdout.str()

Reply via email to