タグ

ブックマーク / www.qoosky.io (1)

  • pytest の基本的な使い方

    概要 pytest の基的な使い方を記載します。 適宜参照するための公式ドキュメントページ Full pytest documentation API Reference インストール 適当なパッケージマネージャ等でインストールできます。 sudo apt install python-pip pip install pytest which pytest /home/vagrant/.local/bin/pytest 実行方法 test_sample.py #!/usr/bin/python # -*- coding: utf-8 -*- class TestClass(object): def test_one(self): x = "this" assert 'h' in x def test_two(self): self.y = "hello" assert hasattr(s

    pytest の基本的な使い方
  • 1