| 1 |
Description: Skip tests requiring root |
| 2 |
Author: Stephen Kitt <[email protected]> |
| 3 |
Forwarded: not-needed |
| 4 |
|
| 5 |
--- a/tests/test_uinput.py |
| 6 |
+++ b/tests/test_uinput.py |
| 7 |
@@ -5,7 +5,7 @@ |
| 8 |
from unittest.mock import patch |
| 9 |
|
| 10 |
import pytest |
| 11 |
-from pytest import raises, fixture |
| 12 |
+from pytest import raises, fixture, mark |
| 13 |
|
| 14 |
from evdev import uinput, ecodes, device, UInputError |
| 15 |
|
| 16 |
@@ -36,6 +36,7 @@ |
| 17 |
|
| 18 |
|
| 19 |
# ----------------------------------------------------------------------------- |
| 20 |
[email protected](reason="Requires root") |
| 21 |
def test_open(c): |
| 22 |
ui = uinput.UInput(**c) |
| 23 |
args = (c["bustype"], c["vendor"], c["product"], c["version"]) |
| 24 |
@@ -44,6 +45,7 @@ |
| 25 |
assert not device_exists(*args) |
| 26 |
|
| 27 |
|
| 28 |
[email protected](reason="Requires root") |
| 29 |
def test_open_context(c): |
| 30 |
args = (c["bustype"], c["vendor"], c["product"], c["version"]) |
| 31 |
with uinput.UInput(**c): |
| 32 |
@@ -57,6 +59,7 @@ |
| 33 |
uinput.UInput(**c) |
| 34 |
|
| 35 |
|
| 36 |
[email protected](reason="Requires root") |
| 37 |
def test_enable_events(c): |
| 38 |
e = ecodes |
| 39 |
c["events"] = {e.EV_KEY: [e.KEY_A, e.KEY_B, e.KEY_C]} |
| 40 |
@@ -67,6 +70,7 @@ |
| 41 |
assert sorted(cap[e.EV_KEY]) == sorted(c["events"][e.EV_KEY]) |
| 42 |
|
| 43 |
|
| 44 |
[email protected](reason="Requires root") |
| 45 |
def test_enable_event_type_without_codes(c): |
| 46 |
e = ecodes |
| 47 |
c["events"] = {e.EV_KEY: [e.KEY_A], e.EV_REP: []} |
| 48 |
@@ -77,6 +81,7 @@ |
| 49 |
assert repeat.repeat > 0 |
| 50 |
|
| 51 |
|
| 52 |
[email protected](reason="Requires root") |
| 53 |
def test_abs_values(c): |
| 54 |
e = ecodes |
| 55 |
c = { |
| 56 |
@@ -100,6 +105,7 @@ |
| 57 |
assert c[e.EV_ABS] == list((0, 1)) |
| 58 |
|
| 59 |
|
| 60 |
[email protected](reason="Requires root") |
| 61 |
def test_write(c): |
| 62 |
with uinput.UInput(**c) as ui: |
| 63 |
d = ui.device |