我是一名新的志愿者,致力于一個使用 tox 進行自動化測驗的開源專案。作為一種學習方式,我有興趣了解 tox 如何呼叫 API 中的函式——例如,它傳遞給它們的引數是什么。有沒有辦法查看它如何呼叫正在測驗的函式?
uj5u.com熱心網友回復:
tox不直接執行測驗,但通常驅動測驗運行程式,例如pytest或其他。
例如來自我的一個專案 tox.ini
[testenv]
description = run the tests with pytest
extras = test
commands = pytest {posargs}
您可以通過breakpoint()(在 Python 3.7 或更高版本上)或通過import pdb;pdb.set_trace()例如
https://github.com/tox-dev/tox/blob/86a0383c0617ff1d1ea47a526211bedc415c9d95/src/tox/session/commands/run/sequential.py#L67設定斷點-L76
并逐步完成該程序。
但是,如果您只想維護一個開源專案,這應該不是必需的。
如果您還有其他問題,我們在一個相當體面的檔案https://tox.wiki/en/latest/的,也是一個友好的交談https://discord.gg/tox
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/407609.html
標籤:
