[Django] Travis CI 적용

James Jung·2021년 7월 15일
0
post-thumbnail
  1. Travis CI에서 연결할 Repository activate

  2. Project root 경로에 .travis.yml을 추가

language: python
python:
  - "3.8"
install:
  - pip install -r requirements.txt
script:
  - pytest test.py
  1. Pytest를 활용하기 위해 pytest 설치, requirements에 반영
pip install pytest
pip freeze > requirements.txt
  1. test.py에 test할 내용을 작성 (예시)
def hello():
    return "Hello"


def test_hello():
    assert "Hello" == hello()
  1. Git push하면 test 결과 확인 가능

0개의 댓글