PaiGram/test/run.py
omg-xtao 25151deebe
当 Redis 无法连接时,使用 fakeredis 模拟 并且 完善 测试 (#51)
* 当 Redis 无法连接时,使用 fakeredis 模拟

* 完善 测试
2022-06-19 15:42:02 +08:00

19 lines
504 B
Python

import os
import unittest
main_suite = unittest.TestSuite()
for parent, dirs, _ in os.walk("."):
for dirname in dirs:
if dirname == "__pycache__":
continue
discover = unittest.defaultTestLoader.discover(
start_dir=parent + os.sep + dirname, pattern='test_*.py',
top_level_dir=parent + os.sep + dirname)
main_suite.addTest(discover)
if __name__ == "__main__":
runner = unittest.TextTestRunner(verbosity=2)
runner.run(main_suite)