summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2024-09-06 21:20:55 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2024-09-06 22:02:50 +0200
commit9d802b2a912aa0e459cf9ad0e9ec2fb51832b59e (patch)
tree1a019d44e4834f33e64253a3f1eda4b3cb3433f7
parent[Console] endwin() not needed when using wrapper (diff)
downloaddeluge-9d802b2a912aa0e459cf9ad0e9ec2fb51832b59e.tar.xz
deluge-9d802b2a912aa0e459cf9ad0e9ec2fb51832b59e.zip
[Tests] Fix missing __qualname__ for mock callback
test_pop_alerts raised the following error: File "/home/runner/work/deluge/deluge/deluge/core/alertmanager.py", line 177, in handle_alerts handler=handler.__qualname__, File "lib/python3.10/unittest/mock.py", line 645, in __getattr__ raise AttributeError(name) AttributeError: __qualname__ Mocks don't generate dunder methods like `__qualname__` attribute so we need to manually specify it.
-rw-r--r--deluge/conftest.py1
-rw-r--r--requirements.txt3
-rwxr-xr-xsetup.py3
3 files changed, 3 insertions, 4 deletions
diff --git a/deluge/conftest.py b/deluge/conftest.py
index c3070140d..19a0cff57 100644
--- a/deluge/conftest.py
+++ b/deluge/conftest.py
@@ -53,6 +53,7 @@ def mock_callback():
mock.deferred = deferred
mock = Mock()
+ mock.__qualname__ = 'mock'
original_reset_mock = mock.reset_mock
mock.reset_mock = reset
mock.reset_mock()
diff --git a/requirements.txt b/requirements.txt
index 3b2a4080d..a26ec758d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,5 @@
libtorrent
-twisted[tls]>=17.1; sys_platform != 'win32'
-twisted[tls]<23,>=17.1; sys_platform == 'win32'
+twisted[tls]>=17.1
rencode
pyopenssl
pyxdg
diff --git a/setup.py b/setup.py
index 509d383e4..ef70f20b0 100755
--- a/setup.py
+++ b/setup.py
@@ -538,8 +538,7 @@ _package_data['deluge.ui.gtk3'] = ['glade/*.ui']
setup_requires = ['setuptools', 'wheel']
install_requires = [
- "twisted[tls]>=17.1; sys_platform != 'win32'",
- "twisted[tls]<23,>=17.1; sys_platform == 'win32'",
+ 'twisted[tls]>=17.1',
# Add pyasn1 for setuptools workaround:
# https://github.com/pypa/setuptools/issues/1510
'pyasn1',