私はいくつかの長時間実行されている pytest テストを特定しました
py.test --durations=10
line_profiler や cprofile などを使用して、これらのテストの 1 つを計測したいと考えています。pytestのセットアップまたは破棄が遅いものの一部である可能性があるため、テスト自体からプロファイルデータを取得したいと本当に思っています。
ただし、通常、line_profiler または cprofile がどのように関与しているかを考えると、それらを pytest で動作させる方法は明確ではありません。