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

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
主站蜘蛛池模板: 松滋市| 永登县| 宝应县| 龙泉市| 黑山县| 突泉县| 瑞金市| 荆门市| 中阳县| 富平县| 台安县| 榆社县| 右玉县| 枣强县| 巫山县| 铜梁县| 南陵县| 开鲁县| 金乡县| 绥芬河市| 建德市| 彩票| 赣州市| 鱼台县| 炉霍县| 岳阳市| 三都| 莎车县| 太和县| 钟祥市| 石狮市| 灵璧县| 桦南县| 德惠市| 岳阳县| 旌德县| 永春县| 怀仁县| 青阳县| 竹溪县| 绩溪县|