- pytest Quick Start Guide
- Bruno Oliveira
- 128字
- 2021-07-16 17:51:25
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
推薦閱讀
- 社交網絡對齊
- Aptana Studio Beginner's Guide
- 從區塊鏈到Web3:構建未來互聯網生態
- Truffle Quick Start Guide
- INSTANT PhpStorm Starter
- 走進物聯網
- Windows Server 2003 Active Directory Design and Implementation: Creating, Migrating, and Merging Networks
- 中小型局域網組建、管理與維護實戰
- Building RESTful Web services with Go
- 網絡基礎與網絡管理項目化教程
- 網絡環境中基于用戶視角的信息質量評價研究
- Echo Quick Start Guide
- 物聯網M2M開發技術:基于無線CPU-Q26XX
- 智能物聯安防視頻技術基礎與應用
- ReasonML Quick Start Guide