官术网_书友最值得收藏!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Type this in your Command Prompt to create a virtualenv."

A block of code is set as follows:

 # contents of test_player_mechanics.py
def test_player_hit():
player = create_player()
assert player.health == 100
undead = create_undead()
undead.hit(player)
assert player.health == 80

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

def test_empty_name():
with pytest.raises(InvalidCharacterNameError):
create_character(name='', class_name='warrior')


def test_invalid_class_name():
with pytest.raises(InvalidClassNameError):
create_character(name='Solaire', class_name='mage')

Any command-line input or output is written as follows:

λ pip install pytest
主站蜘蛛池模板: 息烽县| 韩城市| 内黄县| 闽清县| 葵青区| 盐山县| 东丽区| 镇雄县| 增城市| 栾城县| 通渭县| 麻江县| 确山县| 蓬莱市| 奉节县| 滁州市| 东丽区| 庄河市| 泸西县| 乌拉特后旗| 浦东新区| 衡水市| 三亚市| 锡林浩特市| 云安县| 曲沃县| 迭部县| 灌南县| 桂平市| 扶风县| 湘乡市| 波密县| 罗田县| 昌吉市| 同心县| 城固县| 常德市| 鹤山市| 东至县| 吉安市| 河西区|