ol-iver / denonavr

Automation Library for Denon AVR receivers.
MIT License
176 stars 67 forks source link

Test failures in test_monkeypatch.py with Python 3.9 #179

Closed mweinelt closed 3 years ago

mweinelt commented 3 years ago

Hi,

we've updated denonavr to 0.9.9 in nixpkgs and noticed the tests to be failing on python 3.9.

running install tests
/nix/store/sabbshvff0hfmd1wnk5vwy2mma3l0m40-python3-3.9.1/lib/python3.9/runpy.py:127: RuntimeWarning: 'testtools.run' found in sys.modules after import of package 'testtools', but prior to execution of 'testtools.run'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
Tests running...
======================================================================
ERROR: fixtures.tests._fixtures.test_monkeypatch.TestMonkeyPatch.test_patch_classmethod_with_boundmethod
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/fixtures-3.0.0/fixtures/tests/_fixtures/test_monkeypatch.py", line 223, in test_patch_classmethod_with_boundmethod
    slf, cls = C.foo_cls()
TypeError: bar_two_args() missing 1 required positional argument: 'arg'
======================================================================
ERROR: fixtures.tests._fixtures.test_monkeypatch.TestMonkeyPatch.test_patch_classmethod_with_classmethod
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/fixtures-3.0.0/fixtures/tests/_fixtures/test_monkeypatch.py", line 191, in test_patch_classmethod_with_classmethod
    cls, target_class = C.foo_cls()
ValueError: not enough values to unpack (expected 2, got 1)

Ran 128 tests in 2.118s
FAILED (failures=2)
ol-iver commented 3 years ago

testtools seems to use parts of unittest2 which are deprecated and removed in python 3.9. I replaced it by standard unittest package in denonavr 0.9.10, that tests run with python 3.9.

Please reopen if this does work for you.