summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2023-02-27 17:33:58 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2023-02-27 20:15:12 +0000
commitd00068423f9cc3fd9c12d89842662fadf3f6421d (patch)
tree84f3bfaad6b47d3b597fa4251ebbf9cb13cdd955
parent7336877928559c8b5ef6d8c5a9cb9fdc521bbed6 (diff)
downloaddeluge-d00068423f9cc3fd9c12d89842662fadf3f6421d.tar.gz
deluge-d00068423f9cc3fd9c12d89842662fadf3f6421d.tar.bz2
deluge-d00068423f9cc3fd9c12d89842662fadf3f6421d.zip
[Tests] Ignore 3rd-party deprecation warnings in pytest
Move pytest config from tox to pyproject and ignore deprecation warning generated in 3rd-party libraries. Fixed GObject deprecation warning
-rw-r--r--deluge/ui/gtk3/listview.py2
-rw-r--r--pyproject.toml17
-rw-r--r--tox.ini11
3 files changed, 18 insertions, 12 deletions
diff --git a/deluge/ui/gtk3/listview.py b/deluge/ui/gtk3/listview.py
index e9f6b1084..a80d79507 100644
--- a/deluge/ui/gtk3/listview.py
+++ b/deluge/ui/gtk3/listview.py
@@ -72,7 +72,7 @@ class ListView:
"""
__gsignals__ = {
- 'button-press-event': (GObject.SIGNAL_RUN_LAST, None, (object,))
+ 'button-press-event': (GObject.SignalFlags.RUN_LAST, None, (object,))
}
def __init__(self, title=None, cell_renderer=None, **args):
diff --git a/pyproject.toml b/pyproject.toml
index 67ebe0a0c..500b285e4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,3 +9,20 @@ skip-string-normalization = true
[tool.isort]
profile = "black"
+
+[tool.pytest.ini_options]
+# Hide logged warnings and errors in test output.
+log_cli_level = "CRITICAL"
+addopts = "--basetemp=_pytest_temp"
+markers = [
+ "todo: Tests that are yet to be written",
+ "gtkui: Tests for GTK code",
+ "security: Security related tests",
+ "slow: Tests that are particularly slow",
+ "internet: Tests that require internet connectivity",
+]
+filterwarnings = [
+ "ignore::DeprecationWarning:gi",
+ "ignore::DeprecationWarning:twisted.internet.gireactor:43",
+ "ignore:twisted.web.resource.*:DeprecationWarning",
+]
diff --git a/tox.ini b/tox.ini
index 7f241b043..3756a5406 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,17 +7,6 @@
envlist = py3, lint, docs
minversion=3.0
-[pytest]
-# Hide logged warnings and errors in test output.
-log_cli_level = CRITICAL
-addopts = -p no:warnings --basetemp=_pytest_temp
-markers =
- todo: Tests that are yet to be written
- gtkui: Tests for GTK code
- security: Security related tests
- slow: Tests that are particularly slow
- internet: Tests that require internet connectivity
-
# =================
# Base dependencies
# =================