File: skip-root-tests.patch

package info (click to toggle)
python-evdev 1.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 416 kB
  • sloc: python: 1,400; ansic: 739; makefile: 144; sh: 14
file content (55 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Skip tests requiring root
Author: Stephen Kitt <skitt@debian.org>
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_abs_values(c):
     e = ecodes
     c = {
@@ -90,6 +94,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