Description: Skip tests requiring root Author: Stephen Kitt Forwarded: not-needed --- a/tests/test_uinput.py +++ b/tests/test_uinput.py @@ -5,7 +5,7 @@ from unittest.mock import patch import pytest -from pytest import raises, fixture +from pytest import raises, fixture, mark from evdev import uinput, ecodes, device, UInputError @@ -36,6 +36,7 @@ # ----------------------------------------------------------------------------- +@mark.skip(reason="Requires root") def test_open(c): ui = uinput.UInput(**c) args = (c["bustype"], c["vendor"], c["product"], c["version"]) @@ -44,6 +45,7 @@ assert not device_exists(*args) +@mark.skip(reason="Requires root") def test_open_context(c): args = (c["bustype"], c["vendor"], c["product"], c["version"]) with uinput.UInput(**c): @@ -57,6 +59,7 @@ uinput.UInput(**c) +@mark.skip(reason="Requires root") def test_enable_events(c): e = ecodes c["events"] = {e.EV_KEY: [e.KEY_A, e.KEY_B, e.KEY_C]} @@ -67,6 +70,7 @@ assert sorted(cap[e.EV_KEY]) == sorted(c["events"][e.EV_KEY]) +@mark.skip(reason="Requires root") def test_enable_event_type_without_codes(c): e = ecodes c["events"] = {e.EV_KEY: [e.KEY_A], e.EV_REP: []} @@ -77,6 +81,7 @@ assert repeat.repeat > 0 +@mark.skip(reason="Requires root") def test_abs_values(c): e = ecodes c = { @@ -100,6 +105,7 @@ assert c[e.EV_ABS] == list((0, 1)) +@mark.skip(reason="Requires root") def test_write(c): with uinput.UInput(**c) as ui: d = ui.device