Listing 5-2. test_module02.py
class TestClass01:
def test_case01(self):
assert 'python'.upper() == 'PYTHON'
def test_case02(self):
assert 'PYTHON'.lower() == 'python'
Also create an __init__.py file, as shown in Listing
5-3
.
Listing 5-3. __init__.py
all = ["test_module01", "test_module02"]
Now navigate to the chapter05 directory:
cd /home/pi/book/code/chapter05
And run the test package, as follows:
py.test test
You can see the output by running the previous command. You can also use the
following command to run a test package in verbose mode.
py.test -v test
You can run a single test module within a package with the following command:
py.test -v test/test_module01.py
Do'stlaringiz bilan baham: |