what is an assertion?


An assertion or assert statement is a way for me to tell Python, “DO NOT CONTINUE, if this statement is False”, or said a different way “GO TO THE NEXT LINE, ONLY if this statement is True”.

I use assertions in tests when making a program to make sure something is True about the program before I continue building. I use them to test ideas, without worrying about if I will remember the ideas later. I use them to test how programs behave, for example when given inputs.

Assertions can help catch things that make tests that were passing, start failing when I add new lines of code. They help me answer 2 questions

  • what is the same?

  • what is different?

The difference between my expectations (tests and ideas) and reality (what happens when the program runs), tells me what to change to make them match. The closer my program is to reality, the better.


preview

I have these tests by the end of the chapter

assertion_error/tests/test_assertion_error.py
1def test_assert_keyword():
2    assert 1 + 1 == 2
3
4    assert '1' + '1' == '11'
5
6    assert 'I am' + ' alive' == 'I am alive'
assertion_error/tests/test_assertion_error.py
 9def test_assertion_error_w_none():
10    assert None is None
11
12    assert False is not None
13
14    assert True is not None
15
16    assert 0 is not None
17
18    assert 0.0 is not None
19
20    assert '' is not None
21
22    assert () is not None
23
24    assert [] is not None
25
26    assert set() is not None
27
28    assert {} is not None
assertion_error/tests/test_assertion_error.py
31def test_assertion_error_w_false():
32    assert None is not False
33
34    assert False is False
35
36    assert True is not False
37
38    assert 0 is not False
39
40    assert 0.0 is not False
41
42    assert '' is not False
43
44    assert () is not False
45
46    assert [] is not False
47
48    assert set() is not False
49
50    assert {} is not False
assertion_error/tests/test_assertion_error.py
53def test_assertion_error_w_true():
54    assert None is not True
55
56    assert False is not True
57
58    assert True is True
59
60    assert 0 is not True
61
62    assert 0.0 is not True
63
64    assert '' is not True
65
66    assert () is not True
67
68    assert [] is not True
69
70    assert set() is not True
71
72    assert {} is not True
assertion_error/tests/test_assertion_error.py
75def test_assertion_error_w_equality():
76    assert None == None
77
78    assert False != None
79
80    assert False != True
81
82    assert False == False
83
84    assert True != None
85
86    assert True == True
assertion_error/tests/test_assertion_error.py
 89def test_assertion_error_w_is_vs_equal():
 90    assert 0 is not 0.0
 91
 92    assert 0 == 0.0
 93
 94
 95def will_not_run():
 96    # will not run because
 97    # the name does not start with test
 98    assert False == True
 99
100
101def test_failure():
102    # assert False == True
103    assert False != True
assertion_error/tests/test_assertion_error.py
106# NOTES
107# a dictionary is not the same object as True
108# a dictionary is not the same object as False
109# a dictionary is not the same object as None
110# a set is not the same object as True
111# a set is not the same object as False
112# a set is not the same object as None
113# a list is not the same object as True
114# a list is not the same object as False
115# a list is not the same object as None
116# a tuple is not the same object as True
117# a tuple is not the same object as False
118# a tuple is not the same object as None
assertion_error/tests/test_assertion_error.py
119# a string is not the same object as True
120# a string is not the same object as False
121# a string is not the same object as None
122# a float is not the same object as True
123# a float is not the same object as False
124# a float is not the same object as None
125# an integer is not the same object as True
126# an integer is not the same object as False
127# an integer is not the same object as None
assertion_error/tests/test_assertion_error.py
128# True is True and equal to True
129# True is not equal to False
130# True is not the same object as False
131# True is not equal to None
132# True is not the same object as None
133# False is not equal to True
134# False is not the same object as True
135# False is False and equal to False
136# False is not equal to None
137# False is not the same object as None
138# None is not equal to True
139# None is not the same object as True
140# None is not equal to False
141# None is not the same object as False
142# None is None and equal to None
143
144# Exceptions seen
145# AssertionError
146# IndentationError

questions about AssertionError


start the project

  • I name this project assertion_error

  • I open a terminal

  • I change directory to the assertion_error folder in the pumping_python folder

    terminal
    cd assertion_error
    

    the terminal shows

    cd: no such file or directory: assertion_error
    

    there is no folder with the name assertion_error in this folder.

  • I use uv to make a directory for the project and initialize it

    terminal
    uv init assertion_error
    

    the terminal shows

    Initialized project `assertion-error`
    at `.../pumping_python/assertion_error`
    

    then goes back to the command line.

  • I change directory to the project

    terminal
    cd assertion_error
    

    the terminal shows I am in the assertion_error folder

    .../pumping_python/assertion_error
    
  • I make a directory for the tests

    terminal
    mkdir tests
    

    the terminal goes back to the command line.

  • I make the tests directory a Python package

    Danger

    use 2 underscores (__) before and after init for __init__.py not _init_.py

    touch tests/__init__.py
    
    New-Item tests/__init__.py
    

    the terminal goes back to the command line.

  • I make an empty file for the tests in the tests folder

    touch tests/test_assertion_error.py
    
    New-Item tests/test_assertion_error.py
    

    the terminal goes back to the command line.

  • I open test_assertion_error.py from the tests folder

  • I add the first failing test to tests/test_assertion_error.py

    1assert False is True
    
  • I go back to the terminal

  • I use echo to add pytest to requirements.txt

    echo "pytest" > requirements.txt
    
  • I add pytest-watcher to the requirements file

    echo "pytest-watcher" >> requirements.txt
    

    the terminal goes back to the command line.

  • I use Out-File to add pytest to requirements.txt

    "pytest" | Out-File requirements.txt -Encoding UTF8
    
  • I add pytest-watcher to the requirements file

    "pytest-watcher" >> requirements.txt
    
  • I use uv to install pytest-watcher with the requirements file

    terminal
    uv add --requirement requirements.txt
    

    the terminal shows that it installed pytest-watcher and its dependencies.

  • I add the new files and folder to git for tracking

    terminal
    git add .
    

    the terminal goes back to the command line.

  • I add a git commit message

    terminal
    git commit --all --message 'setup project'
    

    the terminal shows a summary of the changes then goes back to the command line.

  • I use pytest-watcher to run the tests automatically

    terminal
    uv run pytest-watcher . --now --patterns "**/*.py"
    

    the terminal is my friend, and shows AssertionError

    ========================== ERRORS ==========================
    ______ ERROR collecting tests/test_assertion_error.py ______
    tests/test_assertion_error.py:2: in <module>
        assert False is True
    E   assert False is True
    ================= short test summary info ==================
    ERROR tests/test_assertion_error.py - assert False is True
    !!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!
    ===================== 1 error in I.JKs =====================
    

    because False is NOT True.

    if the terminal does not show the same error, then check if

    • your tests/__init__.py has two underscores (__) before and after init for __init__.py not _init_.py

    • you ran echo "pytest-watcher" >> requirements.txt, to add pytest-watcher to the requirements file

    and try uv run pytest-watcher . --now --patterns "**/*.py" again

  • I add AssertionError to the list of Exceptions seen, in test_assertion_error.py

    1assert False is True
    2
    3
    4# Exceptions seen
    5# AssertionError
    
  • I change True to False in the assertion

    1# assert False is True
    2assert False is False
    3
    4
    5# Exceptions seen
    6# AssertionError
    

    the test passes, the terminal shows no tests ran.


the assert keyword

We know that the result of 1 + 1 is 2. What if I said that the result of '1' + '1' is '11', would you agree?

I can use assertions to make the computer check if these statements are True.


RED: make it fail


  • I remove the first failing assertion then add the first of the two statements I am testing

    11 + 1 == 2
    2
    3
    4# Exceptions seen
    5# AssertionError
    

    == is two equal signs on the keyboard (=+=) and means is equal which makes this statement read as 1 + 1 is equal to 2

  • I change the result of the equation

    1# 1 + 1 == 2
    21 + 1 == 11
    3
    4
    5# Exceptions seen
    6# AssertionError
    

    nothing happens. Why is it still passing? 1 + 1 cannot be both 2 and 11, is Python broken?

  • I want the test to fail if I write a statement that is NOT True. I change it to an assert statement

    1# 1 + 1 == 2
    2# 1 + 1 == 11
    3assert 1 + 1 == 11
    4
    5
    6# Exceptions seen
    7# AssertionError
    

    the terminal is my friend, and shows

    E   assert (1 + 1) == 11
    

    because if there is no assert before the equation, Python does not care if the statement is False or True as long as it follows Python rules. Once I make the statement an assertion with the assert keyword it tells the computer DO NOT CONTINUE, if "1 + 1 == 11" is False.


GREEN: make it pass


I change the result back, to make the statement True

1# 1 + 1 == 2
2# 1 + 1 == 11
3# assert 1 + 1 == 11
4assert 1 + 1 == 2
5
6
7# Exceptions seen

the test passes.


REFACTOR: make it better


  • I add the other statement I am testing ('1' + '1' == '11')

    1# 1 + 1 == 2
    2# 1 + 1 == 11
    3# assert 1 + 1 == 11
    4assert 1 + 1 == 2
    5
    6'1' + '1' == '2'
    7
    8
    9# Exceptions seen
    

    the terminal still shows no tests ran because the statement is not an assertion.

  • I add assert before the statement to make it an assertion

     1# 1 + 1 == 2
     2# 1 + 1 == 11
     3# assert 1 + 1 == 11
     4assert 1 + 1 == 2
     5
     6# '1' + '1' == '2'
     7assert '1' + '1' == '2'
     8
     9
    10# Exceptions seen
    

    the terminal is my friend, and shows AssertionError

    E   AssertionError: assert ('1' + '1') == '2'
    

    because the assert before the statement makes it a command to Python - DO NOT CONTINUE if "'1' + '1' == '2'" is False


what causes AssertionError?

AssertionError is raised if the statement after the assert keyword is False. It was in the first failing assertion

assert False is True

With this statement, I tell Python - “DO NOT CONTINUE, if False is NOT the same object as True”, or said a different way “GO TO THE NEXT LINE, ONLY if False is the same object as True”.

  • I change the statement to make it True

    the test passes because the statement is now True, '1' + '1' is equal to '11'.

  • These two statements are similar and are NOT the same

    • assert 1 + 1 == 2 checks if the result of adding two numbers (1 + 1) is equal to the number on the right side (2) of the equality symbol (==).

    • assert '1' + '1' == '11' checks if the result of “adding” 2 strings ('1' + '1') is equal to the string on the right side ('11') of the equality symbol (==). A string is anything inside quotes.

    I add another statement to show the “addition” of two strings

    the test is still green because 'I am' + ' alive' == '11' is just a statement. Python does not care whether it is False or True and the statement follows Python rules.

  • I change the statement to an assertion with the assert keyword

    the terminal is my friend, and shows AssertionError

    E   AssertionError: assert ('I am' + ' alive') == '11'
    

    because the assert before the statement makes it a command to Python - DO NOT CONTINUE if "'I am' + ' alive' == '11'" is False

  • I change the statement to make it True

  • I remove the commented lines

    1assert 1 + 1 == 2
    2
    3assert '1' + '1' == '11'
    4
    5assert 'I am' + ' alive' == 'I am alive'
    6
    7
    8# Exceptions seen
    9# AssertionError
    
  • I open a new terminal then change directories to assertion_error

    terminal
    cd assertion_error
    

    the terminal shows I am in the assertion_error folder

    .../pumping_python/assertion_error
    
  • I add a git commit message

    terminal
    git commit --all --message \
    'test assert keyword'
    

    the terminal shows a summary of the changes then goes back to the command line.


test AssertionError with None

None is used when there is no value. I can use assertions to test if something is the same object as None, this is useful if I want to check what value I get from a process.

For example, if I have people fill a form and I want a test for when they leave something blank, I can use an assertion to make sure that the value is None.


RED: make it fail


  • I go back to the terminal where the tests are running

  • I add a new statement to test_assertion_error.py

    the test is still passing

  • I add the assert keyword

    the terminal is my friend, and shows AssertionError

    E       assert None is not None
    

    because None is not None is False.


GREEN: make it pass


I change the statement to make it True

 7  # None is not None
 8  # assert None is not None
 9  assert None is None
10
11  # Exceptions seen

the test passes.


REFACTOR: make it better


  • I add a note with what I learned from the experiment





  • I add an assert statement for a float (binary floating point decimal number)

    the terminal shows

    E       assert 0.0 is None
    
  • I change the statement to make it True

    the test passes.

  • I add a note about floats






  • I add an assert statement for a dictionary

    the terminal shows

    E   assert {} is None
    
  • I change the statement to make it True

    the test passes.

  • I add a note about dictionaries

  • I remove the commented lines

  • I add comments to group the assertions

     1# test assert keyword
     2assert 1 + 1 == 2
     3
     4assert '1' + '1' == '11'
     5
     6assert 'I am' + ' alive' == 'I am alive'
     7
     8
     9# test AssertionError with None
    10assert None is None
    
  • I add a git commit message in the other terminal

    terminal
    git commit --all --message \
    'test AssertionError with None'
    

    the terminal shows a summary of the changes then goes back to the command line.

I can use assertions to test if something is None.


test AssertionError with False

I can use assertions to test if something is the same object as False or not.

False is one of the two booleans and assert False is not None shows that False is NOT None.

Is None False?


RED: make it fail


  • I go back to the terminal where the tests are running

  • False is NOT the same object as None. Is None the same object as False? I add a new statement to test_assertion_error.py with a comment to group the new statements that will come after

    the test is still passing.

  • I add the assert keyword

    the terminal is my friend, and shows

    E       assert None is False
    

    because None is not the same object as False.


GREEN: make it pass


I change the assertion to make it True

31  # test AssertionError with False
32  # None is False
33  # assert None is False
34  assert None is not False
35
36
37  # NOTES

the test passes because None is not the same object as False.


REFACTOR: make it better


  • I add a note about None











test AssertionError with True

True is the other boolean and is NOT None. I can use assertions to test if something is the same object as True or not.


RED: make it fail


  • I go back to the terminal where the tests are running

  • I add a new statement to test_assertion_error.py with a comment to group these new statements

    the test is still passing.

  • I add the assert keyword

    the terminal is my friend, and shows

    E       assert None is True
    

    because None is not the same object as True.


GREEN: make it pass


I change the statement to make it True

53# test AssertionError with True
54# None is True
55# assert None is True
56assert None is not True
57
58
59# NOTES

the test passes because None is not the same object as True.


REFACTOR: make it better


  • I add a note about None










I can use assertions to test if something is the same object as True or NOT.


test AssertionError with equality

All the assertions I have typed so far show that True, False and None are different objects, which gives me a basic expectation of Python because I can compare things with those three.

I can also use assertions to test if two things are equal, like I did when I test assert keyword.


RED: make it fail


  • I go back to the terminal where the tests are running

  • I add a new statement to test_assertion_error.py with a comment to group these new statements

    • the test is still passing.

    • != is !+= on the keyboard and means is NOT equal which makes this statement read as None is NOT equal to None.

  • I add the assert keyword

    the terminal is my friend, and shows

    E   assert None != None
    

    because None is equal to None.


GREEN: make it pass


I change the statement to make it True

75# test AssertionError with equality
76# None != None
77# assert None != None
78assert None == None
79
80
81# NOTES
  • the test passes because None is equal to None

  • == is two equal signs on the keyboard (=+=) and means is equal which makes this statement read as None is equal to None.


REFACTOR: make it better



I can use assertions to test if two things are equal.


test AssertionError with is vs equal

Some of the tests I have written use is and some use ==, if they mean the same thing, why do I use different symbols? What is the difference between is and ==?

In Python they do not mean the same thing

  • x is y states that x is the same exact object as y

  • x == y states that x is equal to y

  • x is not y states that x is NOT the same exact object as y

  • x != y states that x is NOT equal to y

Things can be equal without being the same exact object. For example, an integer (a whole number without decimals) can be equal to a float (binary floating point decimal numbers) and they are NOT the same object.


RED: make it fail



GREEN: make it pass


I change the assertion to make the statement True

89  # test AssertionError with is vs equal
90  # 0 is 0.0
91  # assert 0 is 0.0
92  assert 0 is not 0.0
93
94
95  # NOTES

the test passes because an integer is not the same object as a float.


REFACTOR: make it better


  • I add another assertion, this time with !=

    the terminal is my friend, and shows

    E       assert 0 != 0.0
    

    because 0 and 0.0 are equal, they are both zero.

  • I change the assertion to make the statement True

    the test passes because 0 and 0.0 are equal, they are both zero.

  • I remove the commented assertions

  • I add a git commit message in the other terminal

    terminal
    git commit --all --message \
    'test AssertionError with is vs equal'
    

    the terminal shows a summary of the changes then goes back to the command line.

The tests show that an integer can be EQUAL to a float but an integer IS NOT a float.


a better way to organize tests

I used comments to group the assertions by what I was testing, and each time I made an assertion True, the terminal showed a confusing message (no tests ran).

Since I am using pytest-watcher which uses pytest to run the test, I can use functions to group the assertions.

A function is code that is callable, this means I can write code to do something one time, and call the name for the function to do that thing at a different time from when I write the code.

functions are made with

  • the def keyword

  • a name

  • parentheses and a colon at the end

  • the code that makes up the function (its body) comes after the colon

def name_of_function():
    the body of the function
    ...

test_assertion_error_w_is_vs_equal


  • I go back to the terminal where the tests are running

  • I add a function for the # test AssertionError with is vs equal group of assertions

    the terminal is my friend, and shows IndentationError

    IndentationError: expected an indented block
                      after function definition on line 89
    

    because in Python the body of a function is indented under the name.

  • I add IndentationError to the list of Exceptions seen

  • I indent the assertions with four spaces to make them the body of the function

    the test passes and the terminal still shows no tests ran

  • I add test_ to the name of the function

    the terminal shows green and the name of the test file with a better message

    terminal
    ================== test session starts ===================
    platform linux -- Python 3.X.Y, pytest-Z.A.B, pluggy-C.D.E
    rootdir: /.../pumping_python/assertion_error
    configfile: pyproject.toml
    collected 1 item
    
    tests/test_assertion_error.py .                     [100%]
    
    =================== 1 passed in F.GHs ====================
    [pytest-watcher]
    Current runner args: []
    Press w to show menu
    

    fantastic!

  • I remove the commented lines

  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_assertion_error_w_is_vs_equal'
    

    the terminal shows a summary of the changes then goes back to the command line.

pytest only calls the function if the name starts with test.


test_assertion_error_w_equality


  • I go back to the terminal where the tests are running

  • I add a function for the # test AssertionError with equality group of assertions

    the terminal is my friend, and shows IndentationError

    IndentationError: expected an indented block
                      after function definition on line 75
    

    because in Python the body of a function is indented under the name.

  • I indent the assertions with four spaces to make them the body of the function

    the terminal shows

    =================== 1 passed in L.MNs ====================
    

    I have two functions with assertions and it only shows one.

  • I add test_ to the name of the function

    the terminal shows

    =================== 2 passed in O.PQs ====================
    

    because pytest only calls the function if the name starts with test.

  • I remove the commented lines

  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_assertion_error_w_equality'
    

    the terminal shows a summary of the changes then goes back to the command line.


test_assertion_error_w_true


  • I go back to the terminal where the tests are running

  • I add a function for the # test AssertionError with True group of assertions

    the terminal is my friend, and shows IndentationError

    IndentationError: expected an indented block
                      after function definition on line 53
    

    because in Python the body of a function is indented under the name.

  • I indent the assertions with four spaces to make them the body of the function

    the terminal shows

    =================== 2 passed in R.STs ====================
    

    I have three functions with assertions and it only shows two.

  • I add test_ to the name of the function

    the terminal shows

    =================== 3 passed in U.VWs ====================
    

    because pytest only calls the function if the name starts with test.

  • I remove the commented lines

  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_assertion_error_w_true'
    

    the terminal shows a summary of the changes then goes back to the command line.


test_assertion_error_w_false


  • I go back to the terminal where the tests are running

  • I add a function for the # test AssertionError with False group of assertions

    the terminal is my friend, and shows IndentationError

    IndentationError: expected an indented block
                      after function definition on line 31
    

    because in Python the body of a function is indented under the name.

  • I indent the assertions with four spaces to make them the body of the function

    the terminal shows

    =================== 3 passed in X.YZs ====================
    

    I have four functions with assertions and it only shows three.

  • I add test_ to the name of the function

    the terminal shows

    =================== 4 passed in A.BCs ====================
    

    because pytest only calls the function if the name starts with test.

  • I remove the commented lines

  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_assertion_error_w_false'
    

    the terminal shows a summary of the changes then goes back to the command line.


test_assertion_error_w_none


  • I go back to the terminal where the tests are running

  • I add a function for the # test AssertionError with None group of assertions

    the terminal is my friend, and shows IndentationError

    IndentationError: expected an indented block
                      after function definition on line 9
    

    because in Python the body of a function is indented under the name.

  • I indent the assertions with four spaces to make them the body of the function

    the terminal shows

    =================== 4 passed in D.EFs ====================
    

    I have five functions with assertions and it only shows four.

  • I add test_ to the name of the function

    the terminal shows

    =================== 5 passed in G.HIs ====================
    

    because pytest only calls the function if the name starts with test.

  • I remove the commented lines

  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_assertion_error_w_none'
    

    the terminal shows a summary of the changes then goes back to the command line.


test_assert_keyword


  • I go back to the terminal where the tests are running

  • I add a function for the # test assert keyword group of assertions

    1def assert_keyword():
    2# test assert keyword
    3assert 1 + 1 == 2
    

    the terminal is my friend, and shows IndentationError

    IndentationError: expected an indented block
                      after function definition on line 1
    

    because in Python the body of a function is indented under the name.

  • I indent the assertions with four spaces to make them the body of the function

     1def assert_keyword():
     2    # test assert keyword
     3    assert 1 + 1 == 2
     4
     5    assert '1' + '1' == '11'
     6
     7    assert 'I am' + ' alive' == 'I am alive'
     8
     9
    10def test_assertion_error_w_none():
    

    the terminal shows

    =================== 5 passed in J.KLs ====================
    

    I have six functions with assertions and it only shows five.

  • I add test_ to the name of the function

     1# def assert_keyword():
     2def test_assert_keyword():
     3    # test assert keyword
     4    assert 1 + 1 == 2
     5
     6    assert '1' + '1' == '11'
     7
     8    assert 'I am' + ' alive' == 'I am alive'
     9
    10
    11def test_assertion_error_w_none():
    

    the terminal shows

    =================== 6 passed in M.NOs ====================
    

    because pytest only calls the function if the name starts with test

  • I remove the commented lines

    1def test_assert_keyword():
    2    assert 1 + 1 == 2
    3
    4    assert '1' + '1' == '11'
    5
    6    assert 'I am' + ' alive' == 'I am alive'
    7
    8
    9def test_assertion_error_w_none():
    
  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_assert_keyword'
    

    the terminal shows a summary of the changes then goes back to the command line.


pytest only calls the function if the name starts with test


  • I go back to the terminal where the tests are running

  • I add a function to show that pytest only calls the function if the name starts with test

    the terminal still shows

    =================== 6 passed in P.QRs ====================
    
  • I add a function that starts with test with the same assertion

    the terminal is my friend, and shows AssertionError

    terminal
    ================== test session starts ===================
    platform linux -- Python 3.X.Y, pytest-Z.A.B, pluggy-C.D.E
    rootdir: /.../pumping_python/assertion_error
    configfile: pyproject.toml
    collected 7 items
    
    tests/test_assertion_error.py ......F               [100%]
    
    ======================== FAILURES ========================
    ______________________ test_failure ______________________
    
        def test_failure():
    >       assert False == True
    E       assert False == True
    
    tests/test_assertion_error.py:102: AssertionError
    ============== short test summary info ===================
    FAILED tests/test_assertion_error.py::test_failure -
        assert False == True
    ============== 1 failed, 6 passed in T.UVs ===============
    [pytest-watcher]
    Current runner args: []
    Press w to show menu
    

    more details than when I write the assertions without a function.

  • I change the assertion to make it True

    the test passes. I leave the commented line as a reminder of what will cause the failure.

  • I add a git commit message

    terminal
    git commit --all --message \
    'add test_failure'
    

    the terminal shows a summary of the changes then goes back to the command line.

pytest only calls the function if the name starts with test.


close the project

  • I close test_assertion_error.py

  • I click in the terminal where the tests are running

  • I use q on the keyboard to leave the tests. The terminal goes back to the command line.

  • I change directory to the parent of assertion_error

    terminal
    cd ..
    

    the terminal is my friend, and shows

    .../pumping_python
    

    I am back in the pumping_python directory.


review

The tests show that

How many questions can you answer about AssertionError?


code from the chapter

Do you want to see all the CODE I typed in this chapter?


what is next?

Would you like to test functions?


rate pumping python

If this has been a 7 star experience for you, please CLICK HERE to leave a 5 star review of pumping python. It helps other people get into the book too.