Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
add test on chpater 2
Browse files Browse the repository at this point in the history
  • Loading branch information
keon committed Aug 25, 2019
1 parent 0cd5643 commit abac583
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ cache:
- $HOME/.cache/pip
matrix:
include:
- python: 3.5
env: TOX_ENV=py35
- python: 3.6
env: TOX_ENV=py36
- python: 3.7
env: TOX_ENV=py37
install:
- pip install -r test_requirements.txt
before_script:
# before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E9,F63,F7,F82,W293 --show-source --statistics
# - flake8 . --count --select=E9,F63,F7,F82,W293 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
pytest .
# Check python install package
- pip install -e .
- tox -e $TOX_ENV
# - pip install -e .
# - tox -e $TOX_ENV
# Check python uninstall package
- pip uninstall -y algorithms
# - pip uninstall -y algorithms
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down
1 change: 1 addition & 0 deletions 02-파이토치_시작하기/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import check_installation
6 changes: 4 additions & 2 deletions 02-파이토치_시작하기/check_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
installed_packages = []
uninstalled_packages = []

def check_dependencies():
def run():
is_ready = True
for package_name, korean_name in required_packages:
printed_name = "%s(%s)" % (korean_name, package_name)
Expand All @@ -37,4 +37,6 @@ def check_dependencies():
print(" * " + pkg)
return is_ready

check_dependencies()

if __name__ == "__main__":
run()
Empty file added __init__.py
Empty file.
7 changes: 0 additions & 7 deletions test/test_01.py

This file was deleted.

13 changes: 13 additions & 0 deletions test/test_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys
import os


# setup path
chapter_name = "02-파이토치_시작하기"
dir_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), ".." , chapter_name)
sys.path.append(dir_path)

import check_installation

def test_check_installation():
assert check_installation.run() == True

0 comments on commit abac583

Please sign in to comment.