Проблема заключается в том, что я не могу запустить тест через консоль.
В консоли я прописываю pytest test_main.py
Сам файл теста выглядит так:
import pytest
@pytest.fixture(scope='session')
def app():
print('Test Run')
class SmokeTest(object):
def test_base_route(self):
print("Tedt")
.
В результате у меня получается:
(virtual) C00 D:\Project\sdo-python>pytest tests
Traceback (most recent call last):
File “C:\Users\engin.eas\AppData\Local\Programs\Python\Python37-32\lib\runpy.py”, line 193, in run_module_as_main
“main”, mod_spec)
File “C:\Users\engin.eas\AppData\Local\Programs\Python\Python37-32\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "D:\Project\sdo-python\virtual\Scripts\pytest.exe_main.py", line 9, in
File "d:\project\sdo-python\virtual\lib\site-packages_pytest\config_init.py", line 58, in main
config = prepareconfig(args, plugins)
File "d:\project\sdo-python\virtual\lib\site-packages_pytest\config_init.py", line 208, in _prepareconfig
pluginmanager=pluginmanager, args=args
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\hooks.py”, line 286, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\manager.py”, line 92, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\manager.py”, line 86, in
firstresult=hook.spec.opts.get(“firstresult”) if hook.spec else False,
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\callers.py”, line 203, in multicall
gen.send(outcome)
File “d:\project\sdo-python\virtual\lib\site-packages_pytest\helpconfig.py”, line 89, in pytest_cmdline_parse
config = outcome.get_result()
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\callers.py”, line 80, in get_result
raise ex[1].with_traceback(ex[2])
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\callers.py”, line 187, in multicall
res = hook_impl.function(*args)
File "d:\project\sdo-python\virtual\lib\site-packages_pytest\config_init.py", line 719, in pytest_cmdline_parse
self.parse(args)
File "d:\project\sdo-python\virtual\lib\site-packages_pytest\config_init.py", line 927, in parse
self.preparse(args, addopts=addopts)
File "d:\project\sdo-python\virtual\lib\site-packages_pytest\config_init.py", line 883, in _preparse
early_config=self, args=args, parser=self._parser
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\hooks.py”, line 286, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\manager.py”, line 92, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\manager.py”, line 86, in
firstresult=hook.spec.opts.get(“firstresult”) if hook.spec else False,
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\callers.py”, line 208, in _multicall
return outcome.get_result()
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\callers.py”, line 80, in get_result
raise ex[1].with_traceback(ex[2])
File “d:\project\sdo-python\virtual\lib\site-packages\pluggy\callers.py”, line 182, in _multicall
next(gen) # first yield
File “d:\project\sdo-python\virtual\lib\site-packages_pytest\capture.py”, line 42, in pytest_load_initial_conftests
_py36_windowsconsoleio_workaround(sys.stdout)
File “d:\project\sdo-python\virtual\lib\site-packages_pytest\capture.py”, line 823, in _py36_windowsconsoleio_workaround
sys.stdin = _reopen_stdio(sys.stdin, “rb”)
File “d:\project\sdo-python\virtual\lib\site-packages_pytest\capture.py”, line 816, in _reopen_stdio
open(os.dup(f.fileno()), mode, buffering),
OSError: [WinError 87] Параметр задан неверно
Я не могу понять где ошибка и почему не запускается?