2023-12-13から1日間の記事一覧

pytest Thread宣言のクラスをモックにする

対象クラス abusiness.py from threading import Thread class AThread(Thread): def run(self)->None: print("AThread!") # TODO 処理 AThread を実行するテストされるクラス some.py class Some: def exec(self)->None: a = AThread() a.start() a.join() …