dirtywords

portable text interface framework  https://pypi.python.org/pypi/dirtywords
git clone https://git.ce9e.org/dirtywords.git

commit
d0c680b0280e599cd2c4473e258bc7d79b5a5018
parent
e9d8f9b1b6d2f3c95eed1ff5117df76be46e6ed0
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2018-08-03 11:39
cleanup tests

Diffstat

D tests/shared.py 11 -----------
M tests/shared_core.py 5 ++---
M tests/test_curses.py 5 ++---
M tests/test_pygame.py 5 ++---
M tests/test_stupid.py 12 ++----------
M tox.ini 20 +++-----------------

6 files changed, 11 insertions, 47 deletions


diff --git a/tests/shared.py b/tests/shared.py

@@ -1,11 +0,0 @@
    1    -1 # flake8: noqa
    2    -1 
    3    -1 try:
    4    -1     import unittest2 as unittest
    5    -1 except ImportError:
    6    -1     import unittest
    7    -1 
    8    -1 try:
    9    -1     from pykeyboard import PyKeyboard
   10    -1 except ImportError:
   11    -1     PyKeyboard = None

diff --git a/tests/shared_core.py b/tests/shared_core.py

@@ -1,10 +1,10 @@
    1     1 from __future__ import absolute_import
    2     2 
    3     3 import threading
   -1     4 import unittest
    4     5 from time import sleep
    5     6 
    6    -1 from .shared import unittest
    7    -1 from .shared import PyKeyboard
   -1     7 from pykeyboard import PyKeyboard
    8     8 
    9     9 from dirtywords.constants import KEYS
   10    10 
@@ -25,7 +25,6 @@ class KeyboardUser(threading.Thread):
   25    25             self.k.tap_key(key)
   26    26 
   27    27 
   28    -1 @unittest.skipIf(PyKeyboard is None, 'PyUserInput not available')
   29    28 class TestCore(unittest.TestCase):
   30    29     def setUp(self):
   31    30         self.k = PyKeyboard()

diff --git a/tests/test_curses.py b/tests/test_curses.py

@@ -1,7 +1,7 @@
    1     1 from __future__ import absolute_import
    2     2 
    3    -1 from .shared import unittest
    4    -1 from .shared import PyKeyboard
   -1     3 import unittest
   -1     4 
    5     5 from . import shared_core
    6     6 
    7     7 try:
@@ -12,7 +12,6 @@ except ImportError:
   12    12 
   13    13 
   14    14 @unittest.skipIf(curses is None, 'curses not available')
   15    -1 @unittest.skipIf(PyKeyboard is None, 'PyUserInput not available')
   16    15 class TestCurses(shared_core.TestCore):
   17    16     def setUp(self):
   18    17         super(TestCurses, self).setUp()

diff --git a/tests/test_pygame.py b/tests/test_pygame.py

@@ -1,7 +1,7 @@
    1     1 from __future__ import absolute_import
    2     2 
    3    -1 from .shared import unittest
    4    -1 from .shared import PyKeyboard
   -1     3 import unittest
   -1     4 
    5     5 from . import shared_core
    6     6 
    7     7 try:
@@ -12,7 +12,6 @@ except ImportError:
   12    12 
   13    13 
   14    14 @unittest.skipIf(pygame is None, 'pygame not available')
   15    -1 @unittest.skipIf(PyKeyboard is None, 'PyUserInput not available')
   16    15 class TestPygame(shared_core.TestCore):
   17    16     def setUp(self):
   18    17         super(TestPygame, self).setUp()

diff --git a/tests/test_stupid.py b/tests/test_stupid.py

@@ -1,18 +1,10 @@
    1     1 from __future__ import absolute_import
    2     2 
    3    -1 from .shared import unittest
    4    -1 from .shared import PyKeyboard
    5    -1 from . import shared_core
   -1     3 from dirtywords.stupid import Screen
    6     4 
    7    -1 try:
    8    -1     from dirtywords.stupid import Screen
    9    -1     stupid = True
   10    -1 except ImportError:
   11    -1     stupid = None
   -1     5 from . import shared_core
   12     6 
   13     7 
   14    -1 @unittest.skipIf(stupid is None, 'stupid not available')
   15    -1 @unittest.skipIf(PyKeyboard is None, 'PyUserInput not available')
   16     8 class TestStupid(shared_core.TestCore):
   17     9     def setUp(self):
   18    10         super(TestStupid, self).setUp()

diff --git a/tox.ini b/tox.ini

@@ -4,29 +4,15 @@
    4     4 # and then run "tox" from this directory.
    5     5 
    6     6 [tox]
    7    -1 envlist = py26, py27, py34
   -1     7 envlist = py27, py3
    8     8 
    9     9 [testenv]
   10    10 commands =
   11    11     flake8
   12    -1     python /usr/bin/nosetests
   -1    12     nosetests
   13    13 deps =
   14    14     PyUserInput
   15    15     flake8
   16    16     nose
   17    17     coverage
   18    -1 
   19    -1 [testenv:py26]
   20    -1 deps =
   21    -1     flake8
   22    -1     nose
   23    -1     coverage
   24    -1     unittest2
   25    -1 
   26    -1 [testenv:py34]
   27    -1 deps =
   28    -1     python3-xlib
   29    -1     PyUserInput
   30    -1     flake8
   31    -1     nose
   32    -1     coverage
   -1    18     pygame