51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2015|回复: 5
打印 上一主题 下一主题

pycharm遇到的问题,可能是pytest or 环境问题?

[复制链接]
  • TA的每日心情
    无聊
    昨天 09:20
  • 签到天数: 403 天

    连续签到: 1 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2020-7-7 11:46:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    我按照作者描述安装好所有库,但是不同文章代码都会出现相同的为题,如下:
    1. Testing started at 09:38 ...

    2. /home/rhu/anaconda3/bin/python "/media/rhu/New Volume1/pycharm/pycharm-community-2018.3.6/helpers/pycharm/_jb_pytest_runner.py" --path "/media/rhu/SGC/SGC-master/citation.py"

    3. Launching pytest with arguments /media/rhu/SGC/SGC-master/citation.py in /media/rhu/SGC/SGC-master



    4. ============================= test session starts ==============================

    5. platform linux -- Python 3.6.8, pytest-5.3.2, py-1.8.0, pluggy-0.13.1

    6. rootdir: /media/rhu/SGC/SGC-master

    7. plugins: allure-pytest-2.8.6, remotedata-0.2.1collected 1 item



    8. citation.py E

    9. test setup failed

    10. file /media/rhu/SGC/SGC-master/citation.py, line 60

    11. def test_regression(model, test_features, test_labels):

    12. E fixture 'model' not found

    13. > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory

    14. > use 'pytest --fixtures [testpath]' for help on them.



    15. /media/rhu/SGC/SGC-master/citation.py:60

    16. [100%]



    17. ==================================== ERRORS ====================================

    18. ______ ERROR at setup of testregression______

    19. file /media/rhu/SGC/SGC-master/citation.py, line 60

    20. def test_regression(model, test_features, test_labels):

    21. E fixture 'model' not found

    22. > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory

    23. > use 'pytest --fixtures [testpath]' for help on them.

    24. /media/rhu/SGC/SGC-master/citation.py:60

    25. ============ 1 error in 3.88s =========

    26. Process finished with exit code 0
    复制代码


    但是,把代码放到Jupyter 下跑就一点问题没有,所以求助该怎么解决?

    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    昨天 14:25
  • 签到天数: 647 天

    连续签到: 2 天

    [LV.9]测试副司令

    2#
    发表于 2020-7-8 09:33:07 | 只看该作者
    等大神
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2024-4-17 09:53
  • 签到天数: 1000 天

    连续签到: 1 天

    [LV.10]测试总司令

    3#
    发表于 2020-7-8 10:17:07 | 只看该作者
    环境配置问题吧?
    E fixture 'model' not found
    use 'pytest --fixtures [testpath]' for help on them.
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 08:43
  • 签到天数: 1667 天

    连续签到: 5 天

    [LV.Master]测试大本营

    4#
    发表于 2020-7-8 10:20:37 | 只看该作者
    在pycharm的setting内配置好库了吗
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    前天 10:20
  • 签到天数: 881 天

    连续签到: 4 天

    [LV.10]测试总司令

    5#
    发表于 2020-7-8 10:31:01 | 只看该作者
    确认下版本是否兼容
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 09:57
  • 签到天数: 1386 天

    连续签到: 5 天

    [LV.10]测试总司令

    6#
    发表于 2020-7-8 10:39:37 | 只看该作者
    环境配置检查下
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-4-27 04:52 , Processed in 0.067196 second(s), 21 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表