Skip to content

Enables unit tests in tox #1379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ services:

before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq python-tox
- sudo apt-get install -qq python2.7 python3
- sudo pip install tox>=2.0

env:
- COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2.py apk --sdk-dir /opt/android/android-sdk --ndk-dir /opt/android/android-ndk'
Expand Down
5 changes: 1 addition & 4 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from pythonforandroid.build import Context
from pythonforandroid.graph import get_recipe_order_and_bootstrap
from pythonforandroid.bootstrap import Bootstrap
Expand All @@ -18,15 +17,13 @@
valid_combinations.extend(
[(['python3crystax'], Bootstrap.get_bootstrap('sdl2', ctx)),
(['kivy', 'python3crystax'], Bootstrap.get_bootstrap('sdl2', ctx))])
invalid_combinations = [[['python2', 'python3crystax'], None]]


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

invalid_combinations = [[['python2', 'python3crystax'], None],
[['python3'], Bootstrap.get_bootstrap('pygame', ctx)]]


@pytest.mark.parametrize('names,bootstrap', invalid_combinations)
def test_invalid_recipe_order_and_bootstrap(names, bootstrap):
Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[tox]
envlist = pep8
# no setup.py to be ran
skipsdist = True
envlist = pep8,py27,py3

[testenv]
deps = pytest
commands = pytest tests/

[testenv:pep8]
deps = flake8
commands = flake8 pythonforandroid/
commands = flake8 pythonforandroid/ tests/

[flake8]
ignore =
Expand Down