Skip to content
/ gym Public

체육관 대관 신청 공지가 올라오면 카카오톡으로 알림을 주는 프로젝트

Notifications You must be signed in to change notification settings

sc303030/gym

Repository files navigation

codecov python python

대관 알리미

  • 학교 체육관 대관 공지사항이 올라오면 카카오톡으로 알림을 보내주는 app입니다.

poetry 설치

  • window 기준
  • WSL
curl -sSL https://install.python-poetry.org | python3 -
  • Powershell
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

poetry 설치하기

poetry install

pytest 실행하기

poetry run pytest
  • print 같이 출력하기
    • poetry run pytest -s
  • 특정 파일만 테스트 하기
    • pyproject.toml 파일에서 tool.pytest.ini_options > addopts을 addopts = "--reuse-db으로 변경
    • poetry run pytest reminder/tests/test_model.py
    • 특정 파일 안에 있는 특정 함수만 테스트
    • poetry run pytest reminder/tests/test_model.py::test_create_school

pre-commit, pre-push git hooks 설치

  • pre-commit hook
pre-commit install
  • pre-push hook
$ touch .git/hooks/pre-push
$ chmod +x .git/hooks/pre-push
$ cat <<EOF >> .git/hooks/pre-push
#!/bin/sh
poetry run pytest
status=$?

if [ $status  != 0 ]; then
    echo 'TEST FAILED! GIT PUSH REJECTED' && exit 1
else
    exit 0
fi
EOF
  • 테스트가 0개면 에거가 발생하기 때문에 적어도 1개의 테스트를 만들어서 진행하기

About

체육관 대관 신청 공지가 올라오면 카카오톡으로 알림을 주는 프로젝트

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published