August 2018
Beginner
160 pages
4h 8m
English
Dictionaries are probably one of the most used data structures in Python, so, unsurprisingly, pytest has specialized representation for them:
_______________________ test_starting_health ________________________ def test_starting_health(): expected = {'warrior': 85, 'sorcerer': 50}> assert get_classes_starting_health() == expectedE AssertionError: assert {'knight': 95...'warrior': 85} == {'sorcerer': 50, 'warrior': 85}E Omitting 1 identical items, use -vv to showE Differing items:E {'sorcerer': 55} != {'sorcerer': 50}E Left contains more items:E {'knight': 95}E Use -v to get the full diff
Sets also have similar output:
________________________ test_player_classes ________________________ def test_player_classes():> assert ...
Read now
Unlock full access