Skip to content

Installing and Getting Started

Griffin Austin edited this page Oct 14, 2019 · 1 revision

Install using pip: $ pip install pytesting

Create and run a simple test suite

from pytesting import testing

# Define test suite
class Testsuite(testing.Test):
    def test_foo(self):
        self.assert_equal("foo", 5)

    def test_bar(self):
        self.assert_equal(1, 1)

# Create and run test suite
test_suite = Testsuite()
test_suite.run_tests()

Note: each test case MUST begin with test_

Clone this wiki locally