我有如下代码。
import testing.postgresql
sql = testing.postgresql.Postgresql(copy_data_from=r"path_to_my_sql_file.sql")我想为单元测试创建虚拟数据,但是得到了这个错误。
raise RuntimeError("command not found: %s" % name)
RuntimeError: command not found: initdbFYI:如果有更好的方法进行测试,我尝试这是为了数据库模拟单元测试,请分享,谢谢!
发布于 2022-09-21 19:00:15
我也有同样的问题,不知怎么的,我似乎错过了postgresql,甚至还以为它以前使用过工作。)如果在mac上可以使用brew:
brew install postgresqlhttps://stackoverflow.com/questions/72464664
复制相似问题