HAT tests are not run (Follow-up from "Tests for Sony PS4 controllers")
The following discussion from !90 (merged) should be addressed:
-
@bentiss started a discussion: (+14 comments)
BTW one other thing I noticed (outside of this review) is that the HAT tests are not working. It seems to rely on checking for "Hat switch" in uhdev.fields in test_gamepad.py. None of this is set as BaseGamepad during init assumes the 'application' is Joystick. It is 'Game Pad' for DualShock 4. I wonder if we should pass application in to BaseGamepad.init() or do something else.
Hmm, well, the 'Game Pad' in the Sony PS4 controllers still creates a 'Joystick' application evdev. There is something fishy I can't figure out right now.
But what is even worse:
sudo pytest -k 'hat' -v ================================================================================================== test session starts ================================================================================================== platform linux -- Python 3.8.5, pytest-4.6.11, py-1.8.2, pluggy-0.13.1 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /home/btissoir/Src/hid-tools plugins: xdist-1.31.0, flake8-1.0.4, forked-1.1.1 collected 1163 items / 1151 deselected / 12 selected tests/test_gamepad.py::TestSaitekGamepad::test_hat_switch[0-ABS_HAT0Y--1] SKIPPED [ 8%] tests/test_gamepad.py::TestSaitekGamepad::test_hat_switch[2-ABS_HAT0X-1] SKIPPED [ 16%] tests/test_gamepad.py::TestSaitekGamepad::test_hat_switch[4-ABS_HAT0Y-1] SKIPPED [ 25%] tests/test_gamepad.py::TestSaitekGamepad::test_hat_switch[6-ABS_HAT0X--1] SKIPPED [ 33%] tests/test_gamepad.py::TestAsusGamepad::test_hat_switch[0-ABS_HAT0Y--1] SKIPPED [ 41%] tests/test_gamepad.py::TestAsusGamepad::test_hat_switch[2-ABS_HAT0X-1] SKIPPED [ 50%] tests/test_gamepad.py::TestAsusGamepad::test_hat_switch[4-ABS_HAT0Y-1] SKIPPED [ 58%] tests/test_gamepad.py::TestAsusGamepad::test_hat_switch[6-ABS_HAT0X--1] SKIPPED [ 66%] tests/test_sony.py::TestPS3Controller::test_hat_switch[0-ABS_HAT0Y--1] SKIPPED [ 75%] tests/test_sony.py::TestPS3Controller::test_hat_switch[2-ABS_HAT0X-1] SKIPPED [ 83%] tests/test_sony.py::TestPS3Controller::test_hat_switch[4-ABS_HAT0Y-1] SKIPPED [ 91%] tests/test_sony.py::TestPS3Controller::test_hat_switch[6-ABS_HAT0X--1] SKIPPED [100%] ====================================================================================== 12 skipped, 1151 deselected in 1.58 seconds ======================================================================================
None of the HAT tests are actually run on any gamepads, and that's on the master branch :/
Let's create an issue and deal with that in a separate MR I think.