You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is an issue with pytest so I'm logging it here for now. Tests fail to discover when using pytest >= 5.1.0 when pytest.ini or tox.ini are present in project.
I'd normally assume this was a pytest issue but if I execute the command to discover tests manually in terminal, it runs without error.
Environment data
VS Code version: 1.37.1
Extension version: 2019.9.32431-dev
OS and version: Windows 10 Pro (64 bit)
Python version: 3.7.3 32-bit
Relevant/affected Python packages and their versions: pytest >= 5.1.0
python C:\Users\dillon.miller\.vscode\extensions\ms-python.python-2019.9.32431-dev\pythonFiles\testing_tools\run_adapter.py discover pytest -- -s --cache-clear tests
Test Discovery failed:
Error: ============================= test session starts =============================
platform win32 -- Python 3.7.3, pytest-5.1.1, py-1.8.0, pluggy-0.12.0
rootdir: c:\Users\dillon.miller\Documents\act.nexus\e2e, inifile: tox.ini
plugins: flaky-3.6.1, check-0.3.5, html-1.22.0, instafail-0.4.1, metadata-1.8.0
________________________ ERROR collecting test session ________________________
Traceback (most recent call last):
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\__init__.py", line 436, in _importconftest
return self._conftestpath2mod[conftestpath]
KeyError: local('C:\\Users\\dillon.miller\\Documents\\act.nexus\\e2e\\conftest.py')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\py\_path\common.py", line 377, in visit
for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\py\_path\common.py", line 418, in gen
dirs = self.optsort([p for p in entries
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\py\_path\common.py", line 419, in <listcomp>
if p.check(dir=1) and (rec is None or rec(p))])
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\main.py", line 600, in _recurse
ihook = self.gethookproxy(dirpath.dirpath())
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\main.py", line 424, in gethookproxy
my_conftestmodules = pm._getconftestmodules(fspath)
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\__init__.py", line 420, in _getconftestmodules
mod = self._importconftest(conftestpath.realpath())
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\__init__.py", line 461, in _importconftest
self.consider_conftest(mod)
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\__init__.py", line 514, in consider_conftest
self.register(conftestmodule, name=conftestmodule.__file__)
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\__init__.py", line 323, in register
ret = super().register(plugin, name)
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\manager.py", line 121, in register
hook._maybe_apply_history(hookimpl)
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\hooks.py", line 336, in _maybe_apply_history
res = self._hookexec(self, [method], kwargs)
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\manager.py", line 81, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\callers.py", line 208, in _multicall
return outcome.get_result()
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Users\dillon.miller\AppData\Roaming\Python\Python37\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "c:\Users\dillon.miller\Documents\act.nexus\e2e\conftest.py", line 86, in pytest_addoption
help='Test')
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\argparsing.py", line 73, in addoption
self._anonymous.addoption(*opts, **attrs)
File "C:\Users\dillon.miller\AppData\Local\Programs\Python\Python37-32\lib\site-packages\_pytest\config\argparsing.py", line 304, in addoption
raise ValueError("option names %s already added" % conflict)
ValueError: option names {'--test'} already added
collected 0 items / 1 errors
- generated html file: file://c:\Users\dillon.miller\Documents\act.nexus\e2e\pytest-results.html -
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 1 error in 0.23s ===============================
Traceback (most recent call last):
File "C:\Users\dillon.miller\.vscode\extensions\ms-python.python-2019.9.32431-dev\pythonFiles\testing_tools\run_adapter.py", line 18, in <module>
main(tool, cmd, subargs, toolargs)
File "C:\Users\dillon.miller\.vscode\extensions\ms-python.python-2019.9.32431-dev\pythonFiles\testing_tools\adapter\__main__.py", line 90, in main
parents, result = run(toolargs, **subargs)
File "C:\Users\dillon.miller\.vscode\extensions\ms-python.python-2019.9.32431-dev\pythonFiles\testing_tools\adapter\pytest\_discovery.py", line 35, in discover
raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 2)
The text was updated successfully, but these errors were encountered:
I'm not sure if this is an issue with pytest so I'm logging it here for now. Tests fail to discover when using pytest >= 5.1.0 when pytest.ini or tox.ini are present in project.
I'd normally assume this was a pytest issue but if I execute the command to discover tests manually in terminal, it runs without error.
Environment data
Expected behaviour
Test discovery passes.
Actual behaviour
Test discovery fails.
Steps to reproduce:
Logs
The text was updated successfully, but these errors were encountered: