导入pytest后出现错误

时间:2021-06-09 01:45:12

标签: pytest pytest-django

我刚刚安装了 pytest 并尝试使用它,但它给了我错误。我卸载它并再次安装它,它给了我与我尝试导入它相同的错误

const validationSchema = Yup.object().shape({
  weight: Yup.number()
    .required(`Value required`)
    .integer()
    .positive()
    .min(0)
    .max(10, `Weight can't be greater than 10`),
});

你能帮我做什么吗,或者建议另一个库,就像 pytest 那样我测试我的应用程序。

感谢您的贡献

1 个答案:

答案 0 :(得分:1)

  1. 检查您是否在正在使用的同一个 pyenv 中安装了 pytest。运行 pip list 命令并检查那里是否有 pytest
  2. 可能是 pyenv 中的环境问题。尝试创建一个新的。在 PyCharm 中,它是 File -> Settings -> Project -> Python Interpreter -> Add