Skip to content

Commit 146bbc7

Browse files
authored
Merge pull request #82 from jkonecny12/master-improve-tests
Improve test structure
2 parents a173864 + 2cc1be2 commit 146bbc7

25 files changed

+38
-19
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
include LICENSE.md Makefile ChangeLog README.md
22
recursive-include simpleline *.py
33
recursive-include po *.po *.pot Makefile
4-
recursive-include tests *.py
4+
recursive-include tests *.py *.sh

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ clean:
5151
.PHONY: test
5252
test:
5353
@echo "*** Running unittests ***"
54-
PYTHONPATH=. $(PYTHON) -m unittest discover -v -s tests/ -p '*_test.py'
54+
./tests/units/run_test.sh
5555

5656
.PHONY: coverage
5757
coverage:
5858
@echo "*** Running unittests with coverage ***"
59-
PYTHONPATH=. $(COVERAGE) run --branch -m unittest discover -v -s tests/ -p '*_test.py'
59+
PYTHON="$(COVERAGE) run --branch" ./tests/units/run_test.sh
6060
$(COVERAGE) report -m --include="simpleline/*" | tee tests/coverage-report.log
6161

6262
.PHONY: check
6363
check:
6464
@echo "*** Running pylint ***"
65-
$(PYTHON) -m pylint simpleline/ examples/*/*.py tests/
65+
$(PYTHON) -m pylint simpleline/ examples/*/*.py tests/units/
6666

6767
.PHONY: install
6868
install:
File renamed without changes.

tests/simpleline_tests/glib_tests/event_loop_glib_test.py renamed to tests/units/glib/event_loop_glib_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# along with Simpleline. If not, see <https://www.gnu.org/licenses/>.
1919
#
2020

21-
from tests.simpleline_tests.event_loop_test import ProcessEvents_TestCase
22-
from tests.simpleline_tests.glib_tests import GLibUtilityMixin
21+
from . import GLibUtilityMixin
22+
from ..main.event_loop_test import ProcessEvents_TestCase
2323

2424

2525
class GLibProcessEvents_TestCase(ProcessEvents_TestCase, GLibUtilityMixin):

tests/simpleline_tests/glib_tests/input_handler_glib_test.py renamed to tests/units/glib/input_handler_glib_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#
2020

2121

22-
from tests.simpleline_tests.input_handler_test import InputHandler_TestCase
23-
from tests.simpleline_tests.glib_tests import GLibUtilityMixin
22+
from . import GLibUtilityMixin
23+
from ..main.input_handler_test import InputHandler_TestCase
2424

2525

2626
class GLibInputHandler_TestCase(InputHandler_TestCase, GLibUtilityMixin):

tests/simpleline_tests/glib_tests/render_screen_glib_test.py renamed to tests/units/glib/render_screen_glib_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#
2020

2121

22-
from tests.simpleline_tests.glib_tests import GLibUtilityMixin
23-
from tests.simpleline_tests.render_screen_test import SimpleUIScreenProcessing_TestCase, \
22+
from . import GLibUtilityMixin
23+
from ..main.render_screen_test import SimpleUIScreenProcessing_TestCase, \
2424
InputProcessing_TestCase, ScreenException_TestCase
2525

2626

tests/simpleline_tests/glib_tests/screen_scheduler_glib_test.py renamed to tests/units/glib/screen_scheduler_glib_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#
2020

2121

22-
from tests.simpleline_tests.glib_tests import GLibUtilityMixin
23-
from tests.simpleline_tests.screen_scheduler_test import ScreenScheduler_TestCase
22+
from . import GLibUtilityMixin
23+
from ..main.screen_scheduler_test import ScreenScheduler_TestCase
2424

2525

2626
class GLibScreenScheduler_TestCase(ScreenScheduler_TestCase, GLibUtilityMixin):

tests/simpleline_tests/adv_widgets_test.py renamed to tests/units/main/adv_widgets_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
#
2020

2121
import unittest
22-
from unittest.mock import patch
2322

23+
from unittest.mock import patch
2424
from io import StringIO
2525

26-
from tests.simpleline_tests import UtilityMixin
27-
2826
from simpleline.render.adv_widgets import GetInputScreen, GetPasswordInputScreen
2927

28+
from .. import UtilityMixin
29+
3030

3131
@patch('simpleline.input.input_handler.InputHandlerRequest._get_input')
3232
@patch('sys.stdout', new_callable=StringIO)

0 commit comments

Comments
 (0)