Commit ce04e0dd authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Fix compatibility with PyTest 8.0. (Closes: #365)



@tool_required(foo) modifies global state (specifically, it adds "foo" to
a set), and we need to ensure that is unwound after we exit this function.
Thanks, FC Stegerman!

Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent c09d0a9e
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -219,6 +219,11 @@ def test_with_compare_details_and_tool_not_found(monkeypatch):
        },
    )

    # @tool_required(foo) below modifies global state (specifically, it adds
    # "foo" to a set), and we need to ensure that is unwound after we exit this
    # function. (Re: #365)
    monkeypatch.setattr(tool_required, "all", set())

    class MockFile(FilesystemFile):
        @tool_required("nonexistent")
        def compare_details(self, other, source=None):