mirror of
https://github.com/getsolus/packages.git
synced 2025-04-29 14:20:25 +03:00
54 lines
2.1 KiB
Diff
54 lines
2.1 KiB
Diff
From 655c4d498350f1051eafb67bdf05a07888d1c6d1 Mon Sep 17 00:00:00 2001
|
|
From: Steve Kowalik <steven@wedontsleep.org>
|
|
Date: Wed, 15 May 2024 14:51:13 +1000
|
|
Subject: [PATCH] Support pytest 8 changes.
|
|
|
|
pytest 8 removed the hook that was calling nose-specific methods, such
|
|
as setup and teardown. However, there is still support for that, the
|
|
methods just have _method on the end, so change them both. Also stop
|
|
pinning pytest to 7 in CI.
|
|
---
|
|
.github/workflows/main.yml | 6 +++---
|
|
tests/test_monitor.py | 4 ++--
|
|
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
|
|
index 8ade29c0..dc6c2e11 100644
|
|
--- a/.github/workflows/main.yml
|
|
+++ b/.github/workflows/main.yml
|
|
@@ -19,15 +19,15 @@ jobs:
|
|
include:
|
|
# MANDATORY CHECKS USING CURRENT DEVELOPMENT INTERPRETER
|
|
- python-version: "3.12"
|
|
- dependencies: pytest=="7" hypothesis
|
|
+ dependencies: pytest hypothesis
|
|
task: PYTHONPATH=./src make -f Makefile test-travis
|
|
# MANDATORY CHECKS USING LOWEST SUPPORTED INTERPRETER
|
|
- python-version: "3.10"
|
|
- dependencies: pytest=="7" hypothesis
|
|
+ dependencies: pytest hypothesis
|
|
task: PYTHONPATH=./src make -f Makefile test-travis
|
|
# MANDATORY CHECKS USING PYPY INTERPRETER
|
|
- python-version: pypy-3.9
|
|
- dependencies: pytest=="7" hypothesis
|
|
+ dependencies: pytest hypothesis
|
|
task: PYTHONPATH=./src make -f Makefile test-travis
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
diff --git a/tests/test_monitor.py b/tests/test_monitor.py
|
|
index cacd5040..4b49d094 100644
|
|
--- a/tests/test_monitor.py
|
|
+++ b/tests/test_monitor.py
|
|
@@ -277,10 +277,10 @@ def make_observer(self, monitor, use_deprecated=False):
|
|
self.observer = MonitorObserver(monitor, callback=self.callback)
|
|
return self.observer
|
|
|
|
- def setup(self):
|
|
+ def setup_method(self):
|
|
self.events = []
|
|
|
|
- def teardown(self):
|
|
+ def teardown_method(self):
|
|
self.events = None
|
|
|
|
def test_deprecated_handler(self, fake_monitor, fake_monitor_device):
|