some proper cleanup of pending_events

xkb
sezanzeb 4 years ago committed by sezanzeb
parent 6a35d7bcf9
commit a918829a47

@ -221,6 +221,7 @@ if __name__ == "__main__":
originalStartTest = unittest.TextTestResult.startTest
def startTest(self, test):
originalStartTest(self, test)
print()
unittest.TextTestResult.startTest = startTest
testrunner = unittest.TextTestRunner(verbosity=2).run(testsuite)

@ -53,7 +53,8 @@ class TestInjector(unittest.TestCase):
self.injector.stop_injecting()
self.injector = None
evdev.InputDevice.grab = self.grab
pending_events['device 2'] = []
if pending_events.get('device 2') is not None:
del pending_events['device 2']
def test_modify_capabilities(self):
class FakeDevice:

@ -36,6 +36,10 @@ CODE_3 = 102
class TestReader(unittest.TestCase):
def tearDown(self):
keycode_reader.clear()
if pending_events.get('device 1') is not None:
del pending_events['device 1']
if pending_events.get('device 2') is not None:
del pending_events['device 2']
def test_reading(self):
keycode_reader.start_reading('device 1')

Loading…
Cancel
Save