Skip to content

Commit

Permalink
Tests: add project directory to PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
bbugyi200 committed Nov 27, 2018
1 parent 32ea742 commit b9f2aa5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[run]
source =
funky
tests
scripts
include =
scripts/post_install.py
scripts/shell/funky.sh
branch = true
omit =
funky/__main__.py
Expand Down
2 changes: 1 addition & 1 deletion .funky
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"a": "source ~/projects/funky/venv/bin/activate \"$@\"", "SS": "find ./scripts -type f \\( -name \"*.py\" -not -name \"*__.py\" \\) -o -name \"*.sh\" \"$@\"", "C": "echo \"Makefile setup.py setup.cfg tox.ini .travis.yml MANIFEST.in .coveragerc\" \"$@\"", "D": "echo \"README.md CHANGELOG.md CONTRIBUTING.md\" \"$@\"", "0": "cd /home/bryan/projects/funky/ || return 1", "I": "get funky \"$@\"", "LL": "ls -a && task project:Dev.localalias -BLOCKED next \"$@\"", "M": "find . -type f -name \"*__.py\" \"$@\"", "T": "find ./tests -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "p": "d && eval \"$@\"; a", "S": "find ./funky -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "r": "python -m funky \"$@\"", "t": "python -m pytest tests \"$@\"", "d": "deactivate \"$@\""}
{"a": "source ~/projects/funky/venv/bin/activate \"$@\"", "SS": "find ./scripts -type f \\( -name \"*.py\" -not -name \"*__.py\" \\) -o -name \"*.sh\" \"$@\"", "C": "echo \"Makefile setup.py setup.cfg tox.ini .travis.yml MANIFEST.in .coveragerc .codecov.yaml\" \"$@\"", "D": "echo \"README.md CHANGELOG.md CONTRIBUTING.md\" \"$@\"", "0": "cd /home/bryan/projects/funky/ || return 1", "I": "get funky \"$@\"", "LL": "ls -a && task project:Dev.localalias -BLOCKED next \"$@\"", "M": "find . -type f -name \"*__.py\" \"$@\"", "T": "find ./tests -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "p": "d && eval \"$@\"; a", "S": "find ./funky -type f -name \"*.py\" -not -name \"*__.py\" \"$@\"", "r": "python -m funky \"$@\"", "t": "python -m pytest tests \"$@\"", "d": "deactivate \"$@\""}
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ python:
- 3.6
- 3.5
- 3.4
sudo: required
install:
- pip install -U tox-travis
- pip install codecov
- pip install -r requirements_dev.txt
- ./scripts/install-deps
script:
- ./tests/runtests.py
Expand All @@ -19,10 +21,11 @@ addons:
- libdw-dev
- cmake
after_success: |
# Run Python Tests
coverage run ./tests/runtests.py &&
# ------- Run Python Tests
coverage run --rcfile=.coveragerc ./tests/runtests.py &&
bash <(curl -s https://codecov.io/bash) -cF python &&
# Run Bash Tests
# ------- Run Bash Tests
deactivate &&
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
Expand All @@ -32,9 +35,9 @@ after_success: |
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
rm -rf kcov-master coverage &&
mkdir -p coverage &&
kcov coverage ./tests/scripts/shell/test_funky.sh &&
kcov coverage ./tests/scripts/shell/runtests.sh &&
bash <(curl -s https://codecov.io/bash) -cF bash
deploy:
provider: pypi
Expand Down
10 changes: 8 additions & 2 deletions tests/runtests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/usr/bin/env python

import pytest
import os
import sys

project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, project_dir)

import pytest # noqa


if __name__ == "__main__":
pytest.main()
sys.exit(pytest.main())

0 comments on commit b9f2aa5

Please sign in to comment.