Python單元測試去哪兒了? - Where do the Python unit tests go?

問題:

If you're writing a library, or an app, where do the unit test files go? 如果您正在編寫庫或應用程序,則單元測試文件會放在哪裏?

It's nice to separate the test files from the main app code, but it's awkward to put them into a "tests" subdirectory inside of the app root directory, because it makes it harder to import the modules that you'll be testing. 將測試文件與主應用程序代碼分開是很好的選擇,但是將它們放在應用程序根目錄內的“ tests”子目錄中是很尷尬的,因爲這樣會使導入要測試的模塊更加困難。

Is there a best practice here? 這裏有最佳實踐嗎?


解決方案:

參考一: https://stackoom.com/question/FuJ
參考二: Where do the Python unit tests go?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章