[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.
This commit is contained in:
parent
8867da94f8
commit
9d802b2a91
|
@ -53,6 +53,7 @@ def mock_callback():
|
||||||
mock.deferred = deferred
|
mock.deferred = deferred
|
||||||
|
|
||||||
mock = Mock()
|
mock = Mock()
|
||||||
|
mock.__qualname__ = 'mock'
|
||||||
original_reset_mock = mock.reset_mock
|
original_reset_mock = mock.reset_mock
|
||||||
mock.reset_mock = reset
|
mock.reset_mock = reset
|
||||||
mock.reset_mock()
|
mock.reset_mock()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
libtorrent
|
libtorrent
|
||||||
twisted[tls]>=17.1; sys_platform != 'win32'
|
twisted[tls]>=17.1
|
||||||
twisted[tls]<23,>=17.1; sys_platform == 'win32'
|
|
||||||
rencode
|
rencode
|
||||||
pyopenssl
|
pyopenssl
|
||||||
pyxdg
|
pyxdg
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -538,8 +538,7 @@ _package_data['deluge.ui.gtk3'] = ['glade/*.ui']
|
||||||
|
|
||||||
setup_requires = ['setuptools', 'wheel']
|
setup_requires = ['setuptools', 'wheel']
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"twisted[tls]>=17.1; sys_platform != 'win32'",
|
'twisted[tls]>=17.1',
|
||||||
"twisted[tls]<23,>=17.1; sys_platform == 'win32'",
|
|
||||||
# Add pyasn1 for setuptools workaround:
|
# Add pyasn1 for setuptools workaround:
|
||||||
# https://github.com/pypa/setuptools/issues/1510
|
# https://github.com/pypa/setuptools/issues/1510
|
||||||
'pyasn1',
|
'pyasn1',
|
||||||
|
|
Loading…
Reference in New Issue