bin:testing progprim$ ls -l total 24 drwxr-xr-x 5 progprim staff 170 29 Sep 11:43 __pycache__ -rw-r--r-- 1 progprim staff 1236 29 Sep 11:37 factorial.py -rw-r--r-- 1 progprim staff 1045 20 Sep 08:56 mixstrings-pytest.py -rw-r--r-- 1 progprim staff 1080 29 Sep 14:24 mixstrings.py bin:testing progprim$ less mixstrings.py bin:testing progprim$ python mixstrings.py bin:testing progprim$ python mixstrings.py Traceback (most recent call last): File "mixstrings.py", line 39, in test_mixstrings_basics() File "mixstrings.py", line 26, in test_mixstrings_basics assert mixstrings("hello", "world") == "hweolrllod" AssertionError bin:testing progprim$ py.test mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 3 items mixstrings.py ... =========================== 3 passed in 0.01 seconds =========================== bin:testing progprim$ py.test -v mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 3 items mixstrings.py::test_mixstrings_basics PASSED mixstrings.py::test_mixstrings_empty PASSED mixstrings.py::test_mixstrings_different_length PASSED =========================== 3 passed in 0.01 seconds =========================== bin:testing progprim$ py.test -v mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 3 items mixstrings.py::test_mixstrings_basics FAILED mixstrings.py::test_mixstrings_empty FAILED mixstrings.py::test_mixstrings_different_length FAILED =================================== FAILURES =================================== ____________________________ test_mixstrings_basics ____________________________ def test_mixstrings_basics(): > assert mixstrings("hello", "world") == "hweolrllod" E assert 'bhweolrllod' == 'hweolrllod' E - bhweolrllod E ? - E + hweolrllod mixstrings.py:26: AssertionError ____________________________ test_mixstrings_empty _____________________________ def test_mixstrings_empty(): > assert mixstrings("", "") == "" E assert 'b' == '' E - b mixstrings.py:31: AssertionError _______________________ test_mixstrings_different_length _______________________ def test_mixstrings_different_length(): > assert mixstrings("12345", "123") == "112233" E assert 'b112233' == '112233' E - b112233 E ? - E + 112233 mixstrings.py:35: AssertionError =========================== 3 failed in 0.06 seconds =========================== bin:testing progprim$ py.test -v mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 3 items mixstrings.py::test_mixstrings_basics PASSED mixstrings.py::test_mixstrings_empty PASSED mixstrings.py::test_mixstrings_different_length PASSED =========================== 3 passed in 0.02 seconds =========================== bin:testing progprim$ py.test -v mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 3 items mixstrings.py::test_mixstrings_basics PASSED mixstrings.py::test_mixstrings_empty PASSED mixstrings.py::test_mixstrings_different_length FAILED =================================== FAILURES =================================== _______________________ test_mixstrings_different_length _______________________ def test_mixstrings_different_length(): assert mixstrings("12345", "123") == "112233" > assert mixstrings("", "hello") == "hello" E assert '' == 'hello' E + hello mixstrings.py:36: AssertionError ====================== 1 failed, 2 passed in 0.02 seconds ====================== bin:testing progprim$ python mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 3 items mixstrings.py::test_mixstrings_basics PASSED mixstrings.py::test_mixstrings_empty PASSED mixstrings.py::test_mixstrings_different_length PASSED =========================== 3 passed in 0.01 seconds =========================== bin:testing progprim$ py.test -v factorial.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 4 items factorial.py::test_basics PASSED factorial.py::test_against_standard_lib PASSED factorial.py::test_negative_number_raises_error PASSED factorial.py::test_noninteger_number_raises_error PASSED =========================== 4 passed in 0.01 seconds =========================== bin:testing progprim$ py.test -v factorial.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 4 items factorial.py::test_basics PASSED factorial.py::test_against_standard_lib PASSED factorial.py::test_negative_number_raises_error PASSED factorial.py::test_noninteger_number_raises_error FAILED =================================== FAILURES =================================== _____________________ test_noninteger_number_raises_error ______________________ def test_noninteger_number_raises_error(): with pytest.raises(ValueError): # factorial(0.5) > pass E Failed: DID NOT RAISE factorial.py:51: Failed ====================== 1 failed, 3 passed in 0.01 seconds ====================== bin:testing progprim$ ls __pycache__ mixstrings-pytest.py factorial.py mixstrings.py bin:testing progprim$ py.test -v factorial.py mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 7 items factorial.py::test_basics PASSED factorial.py::test_against_standard_lib PASSED factorial.py::test_negative_number_raises_error PASSED factorial.py::test_noninteger_number_raises_error FAILED mixstrings.py::test_mixstrings_basics PASSED mixstrings.py::test_mixstrings_empty PASSED mixstrings.py::test_mixstrings_different_length PASSED =================================== FAILURES =================================== _____________________ test_noninteger_number_raises_error ______________________ def test_noninteger_number_raises_error(): with pytest.raises(ValueError): # factorial(0.5) > pass E Failed: DID NOT RAISE factorial.py:51: Failed ====================== 1 failed, 6 passed in 0.01 seconds ====================== bin:testing progprim$ py.test -v factorial.py mixstrings.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 7 items factorial.py::test_basics PASSED factorial.py::test_against_standard_lib PASSED factorial.py::test_negative_number_raises_error PASSED factorial.py::test_noninteger_number_raises_error PASSED mixstrings.py::test_mixstrings_basics PASSED mixstrings.py::test_mixstrings_empty PASSED mixstrings.py::test_mixstrings_different_length PASSED =========================== 7 passed in 0.02 seconds =========================== bin:testing progprim$ ls -l total 32 drwxr-xr-x 5 progprim staff 170 29 Sep 14:39 __pycache__ -rw-r--r-- 1 progprim staff 675 29 Sep 14:40 factorial.py -rw-r--r-- 1 progprim staff 1045 20 Sep 08:56 mixstrings-pytest.py -rw-r--r-- 1 progprim staff 1136 29 Sep 14:31 mixstrings.py -rw-r--r-- 1 progprim staff 719 29 Sep 14:40 test_factorial.py bin:testing progprim$ py.test -v . ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 4 items test_factorial.py::test_basics PASSED test_factorial.py::test_against_standard_lib FAILED test_factorial.py::test_negative_number_raises_error FAILED test_factorial.py::test_noninteger_number_raises_error FAILED =================================== FAILURES =================================== __________________________ test_against_standard_lib ___________________________ def test_against_standard_lib(): for i in range(20): > assert math.factorial(i) == factorial(i) E NameError: name 'math' is not defined test_factorial.py:17: NameError ______________________ test_negative_number_raises_error _______________________ def test_negative_number_raises_error(): > with pytest.raises(ValueError): # this will pass if E NameError: name 'pytest' is not defined test_factorial.py:21: NameError _____________________ test_noninteger_number_raises_error ______________________ def test_noninteger_number_raises_error(): > with pytest.raises(ValueError): E NameError: name 'pytest' is not defined test_factorial.py:26: NameError ====================== 3 failed, 1 passed in 0.02 seconds ====================== bin:testing progprim$ py.test -v . ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 4 items test_factorial.py::test_basics PASSED test_factorial.py::test_against_standard_lib PASSED test_factorial.py::test_negative_number_raises_error PASSED test_factorial.py::test_noninteger_number_raises_error PASSED =========================== 4 passed in 0.01 seconds =========================== bin:testing progprim$ dir -bash: dir: command not found bin:testing progprim$ ls __pycache__ mixstrings-pytest.py test_factorial.py factorial.py mixstrings.py bin:testing progprim$ py.test -v test_factorial.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 4 items test_factorial.py::test_basics PASSED test_factorial.py::test_against_standard_lib PASSED test_factorial.py::test_negative_number_raises_error PASSED test_factorial.py::test_noninteger_number_raises_error xfail ===================== 3 passed, 1 xfailed in 0.02 seconds ====================== bin:testing progprim$ py.test -v test_factorial.py ============================= test session starts ============================== platform darwin -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/progprim/anaconda/bin/python cachedir: .cache rootdir: /Users/progprim/Desktop/code/testing, inifile: collected 4 items test_factorial.py::test_basics PASSED test_factorial.py::test_against_standard_lib PASSED test_factorial.py::test_negative_number_raises_error PASSED test_factorial.py::test_noninteger_number_raises_error XPASS ===================== 3 passed, 1 xpassed in 0.01 seconds ====================== bin:testing progprim$