[Django]Travis CIの適用



  • Travis CIで接続するRepositoryをアクティブにする

  • プロジェクトrootパスにあります.travis.ymlの追加
  • language: python
    python:
      - "3.8"
    install:
      - pip install -r requirements.txt
    script:
      - pytest test.py
  • Pytestを使用してpytestインストールを行い、要求
  • に合致する.
    pip install pytest
    pip freeze > requirements.txt
  • test.pyでテストするコンテンツを作成する(例)
  • def hello():
        return "Hello"
    
    
    def test_hello():
        assert "Hello" == hello()
  • Git Push検証テスト結果