[Git][reproducible-builds/diffoscope][master] Fix compatibility with PyTest 8.0. (Closes: reproducible-builds/diffoscope#365)

Chris Lamb (@lamby) gitlab at salsa.debian.org
Wed Feb 28 10:21:32 UTC 2024



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
ce04e0dd by Chris Lamb at 2024-02-28T10:21:06+00:00
Fix compatibility with PyTest 8.0. (Closes: reproducible-builds/diffoscope#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 <lamby at debian.org>

- - - - -


1 changed file:

- tests/comparators/test_binary.py


Changes:

=====================================
tests/comparators/test_binary.py
=====================================
@@ -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):



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/ce04e0dd4462f9bcfc226fdc0d1c02dbffc139df

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/ce04e0dd4462f9bcfc226fdc0d1c02dbffc139df
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240228/4f3b8a98/attachment.htm>


More information about the rb-commits mailing list