码迷,mamicode.com
首页 > 其他好文 > 详细

pytest 运行文件报错

时间:2019-10-17 01:05:11      阅读:765      评论:0      收藏:0      [点我收藏+]

标签:turn   package   als   __call   test   mic   errno   parser   dmi   

用pytest 执行时报错:

Traceback (most recent call last):
  File "D:\program files\JetBrains\PyCharm Community Edition 2019.2.3\helpers\pycharm\_jb_pytest_runner.py", line 37, in <module>
    config_result = real_prepare_config(args, plugins_to_load)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\config\__init__.py", line 221, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\callers.py", line 203, in _multicall
    gen.send(outcome)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\helpconfig.py", line 89, in pytest_cmdline_parse
    config = outcome.get_result()
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\config\__init__.py", line 736, in pytest_cmdline_parse
    self.parse(args)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\config\__init__.py", line 943, in parse
    self._preparse(args, addopts=addopts)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\config\__init__.py", line 900, in _preparse
    early_config=self, args=args, parser=self._parser
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\manager.py", line 86, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\callers.py", line 208, in _multicall
    return outcome.get_result()
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\pluggy\callers.py", line 182, in _multicall
    next(gen)  # first yield
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\capture.py", line 53, in pytest_load_initial_conftests
    capman.start_global_capturing()
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\capture.py", line 111, in start_global_capturing
    self._global_capturing = self._getcapture(self._method)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\capture.py", line 87, in _getcapture
    return MultiCapture(out=True, err=True, Capture=FDCapture)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\capture.py", line 455, in __init__
    self.in_ = Capture(0)
  File "F:\Users\Administrator\PycharmProjects\hogwars10\venv\lib\site-packages\_pytest\capture.py", line 554, in __init__
    tmpfile = open(os.devnull, "r")
FileNotFoundError: [Errno 2] No such file or directory: nul

Process finished with exit code 1

Empty suite

技术图片

 

pytest 运行文件报错

标签:turn   package   als   __call   test   mic   errno   parser   dmi   

原文地址:https://www.cnblogs.com/tQlve/p/11689553.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!