Here is the error I get when I discover the tests from within VS code. I don't have any problem running pytest from the command line in the same source folder / conda env.
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/_pytest/main.py", line 440, in perform_collect
INTERNALERROR> session=self, config=self.config, items=items
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 80, in pytest_collection_modifyitems
INTERNALERROR> test, parents = self.parse_item(item)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 65, in parse_item
INTERNALERROR> return parse_item(item)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 162, in parse_item
INTERNALERROR> location, fullname = _get_location(item, testroot, relfile)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 143, in <lambda>
INTERNALERROR> _get_location=(lambda *a: _get_location(*a)),
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 283, in _get_location
INTERNALERROR> location = '{}:{}'.format(srcfile, int(lineno) + 1)
INTERNALERROR> TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/_pytest/main.py", line 191, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/_pytest/main.py", line 234, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/_pytest/main.py", line 244, in pytest_collection
INTERNALERROR> return session.perform_collect()
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/_pytest/main.py", line 443, in perform_collect
INTERNALERROR> hook.pytest_collection_finish(session=self)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/manager.py", line 92, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/manager.py", line 86, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/ogrisel/miniconda3/envs/pip/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 94, in pytest_collection_finish
INTERNALERROR> test, parents = self.parse_item(item)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 65, in parse_item
INTERNALERROR> return parse_item(item)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 162, in parse_item
INTERNALERROR> location, fullname = _get_location(item, testroot, relfile)
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 143, in <lambda>
INTERNALERROR> _get_location=(lambda *a: _get_location(*a)),
INTERNALERROR> File "/home/ogrisel/.vscode-insiders/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 283, in _get_location
INTERNALERROR> location = '{}:{}'.format(srcfile, int(lineno) + 1)
INTERNALERROR> TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Environment data
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): language serverHere is the error I get when I discover the tests from within VS code. I don't have any problem running pytest from the command line in the same source folder / conda env.
Steps to reproduce: