Skip to content

Commit

Permalink
Merge pull request #12 from M157q/issue-8
Browse files Browse the repository at this point in the history
[#8] Test with multiple versions Python
  • Loading branch information
Frank Jheng committed Oct 14, 2018
2 parents 932934c + 3387a55 commit 7b6b670
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 36 deletions.
60 changes: 24 additions & 36 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,44 @@
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
workflows:
version: 2
test:
jobs:
- test-3.7
- test-3.6
- test-3.5
- test-3.4
jobs:
build:
test-3.7: &test-template
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.6.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

# Available CircleCI Python images: https://hub.docker.com/r/circleci/python/tags/
- image: circleci/python:3.7
working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "test-requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r test-requirements.txt
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "test-requirements.txt" }}

# run tests!
# this example uses Django's built-in test-runner
# other common Python testing frameworks include pytest and nose
# https://pytest.org
# https://nose.readthedocs.io
sudo pip install -r test-requirements.txt
- run:
name: run tests
command: |
. venv/bin/activate
make test
coveralls
- store_test_results:
path: htmlcov

- store_artifacts:
path: htmlcov
test-3.6:
<<: *test-template
docker:
- image: circleci/python:3.6
test-3.5:
<<: *test-template
docker:
- image: circleci/python:3.5
test-3.4:
<<: *test-template
docker:
- image: circleci/python:3.4
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ coveralls==1.3.0
pytest==3.1.3
pytest-cov==2.5.1
flake8==3.3.0
tox-pyenv==1.1.0
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tox]
envlist = py30,py31,py32,py33,py34,py35,py36,py37
skipsdist = True

[testenv]
deps=-rtest-requirements.txt
commands = python -m pytest -vv --cov hor2vec/ --cov-report html --cov-report term

0 comments on commit 7b6b670

Please sign in to comment.