8000 Merge pull request #1379 from AndreMiras/feature/run_unit_tests_on_tox · bb33bb/python-for-android@99475fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 99475fc

Browse files
authored
Merge pull request kivy#1379 from AndreMiras/feature/run_unit_tests_on_tox
Enables unit tests in tox
2 parents b1f7033 + bf94fb5 commit 99475fc

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ services:
77

88
before_install:
99
- sudo apt-get update -qq
10-
- sudo apt-get install -qq python-tox
10+
- sudo apt-get install -qq python2.7 python3
11+
- sudo pip install tox>=2.0
1112

1213
env:
1314
- COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2.py apk --sdk-dir /opt/android/android-sdk --ndk-dir /opt/android/android-ndk'

tests/test_graph.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
from pythonforandroid.build import Context
32
from pythonforandroid.graph import get_recipe_order_and_bootstrap
43
from pythonforandroid.bootstrap import Bootstrap
@@ -18,15 +17,13 @@
1817
valid_combinations.extend(
1918
[(['python3crystax'], Bootstrap.get_bootstrap('sdl2', ctx)),
2019
(['kivy', 'python3crystax'], Bootstrap.get_bootstrap('sdl2', ctx))])
20+
invalid_combinations = [[['python2', 'python3crystax'], None]]
2121

2222

2323
@pytest.mark.parametrize('names,bootstrap', valid_combinations)
2424
def test_valid_recipe_order_and_bootstrap(names, bootstrap):
2525
get_recipe_order_and_bootstrap(ctx, names, bootstrap)
2626

27-
invalid_combinations = [[['python2', 'python3crystax'], None],
28-
[['python3'], Bootstrap.get_bootstrap('pygame', ctx)]]
29-
3027

3128
@pytest.mark.parametrize('names,bootstrap', invalid_combinations)
3229
def test_invalid_recipe_order_and_bootstrap(names, bootstrap):

tox.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[tox]
2-
envlist = pep8
3-
# no setup.py to be ran
4-
skipsdist = True
2+
envlist = pep8,py27,py3
3+
4+
[testenv]
5+
deps = pytest
6+
commands = pytest tests/
57

68
[testenv:pep8]
79
deps = flake8
8-
commands = flake8 pythonforandroid/
10+
commands = flake8 pythonforandroid/ tests/
911

1012
[flake8]
1113
ignore =

0 commit comments

Comments
 (0)
0