Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests not being discovered since 2019.4.0 #5458

Closed
cdietschrun opened this issue Apr 24, 2019 · 52 comments
Closed

Tests not being discovered since 2019.4.0 #5458

cdietschrun opened this issue Apr 24, 2019 · 52 comments
Labels
area-testing bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release

Comments

@cdietschrun
Copy link

Environment data

  • VS Code version: 1.33.1
  • Extension version (available under the Extensions sidebar): 2019.4.11987
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6 in my virtualenv
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
  • Relevant/affected Python packages and their versions: tests?

Expected behaviour

Discover Python unit tests should pick up unit tests (excluding ones I want ignored), mark the unit tests in the source file with the 'debug test|run test' annotations, and running unit tests should only run my tests. This was working prior to yesterday.

Actual behaviour

Discover unit tests includes directories I've asked to be ignored in python.testing.pyTestArgs, unit test source files are not marked with annotations, and all tests run. Also I'm not seeing the results of Discover Unit Tests anywhere after run it.

Steps to reproduce:

  1. My workspace settings file has these settings:

``

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

		"python.linting.ignorePatterns": [
			".vscode/*.py",
			"**/site-packages/**/*.py",
			"cps_python_packages",
			"tests",
			"context.py"
		],
		"python.linting.pylintArgs": [
			"--rcfile", 
			"C:\\Users\\me\\source\\repos\\mason\\.pylintrc"
		],
		"python.testing.pyTestArgs": [
			"--ignore=${workspaceFolder}/mason/cps_python_packages/cps_datamodel/tests"
		],

and cps_python_packages shouldn't be linted or tested, but is being linted and tested. I have no user settings affecting this.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

None relevant so far as I can tell
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Apr 24, 2019
@phloose
Copy link

phloose commented Apr 24, 2019

I have the same problem with pytest! I didn't change anything to the test configuration and it worked fine yesterday. Environment data (vscode and python extension version) is more or less the same as from the OP except that i use Miniconda python v3.7.1.

Here are my workspace settings:

{
    "python.testing.pyTestArgs": [
        ".",
        "-v",
        "-s"
    ],
    "python.testing.unittestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.pyTestEnabled": true
}

Additionally i get a large error message in the console, which could help you guys debug this error:

Python Extension: Failed to parse discovered Test Error: Traceback (most recent call last):
  File "C:\Users\USER\.vscode\extensions\ms-python.python-2019.4.11987\pythonFiles\testing_tools\run_adapter.py", line 16, in <module>
    main(tool, cmd, subargs, toolargs)
  File "C:\Users\USER\.vscode\extensions\ms-python.python-2019.4.11987\pythonFiles\testing_tools\adapter\__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "C:\Users\USER\.vscode\extensions\ms-python.python-2019.4.11987\pythonFiles\testing_tools\adapter\pytest.py", line 43, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 2)

	at ChildProcess.module.exports.exec.c.once (C:\Users\USER\.vscode\extensions\ms-python.python-2019.4.11987\out\client\extension.js:9:35776)
	at Object.onceWrapper (events.js:273:13)
	at ChildProcess.emit (events.js:182:13)
	at maybeClose (internal/child_process.js:961:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)

I would like to add that i love vscode and its capabilities - you are doing great work! Please fix this error, because i also need vscode and testing at work :)

@ralexx
Copy link

ralexx commented Apr 24, 2019

Similar behavior for VS Code 1.33.1/Python extension 2019.4.11987 on macOS 10.12.

When running code . in my conda env, I get pop-up messages telling me that I can change the Python interpreter in the status bar (my env has curiously been renamed to base in the status bar, which is the name reserved for the root env), and that I need to change the value of the setting python.unitTest to python.testing.

My previous settings.json file had this line to enable pytest:

"python.unitTest.pyTestEnabled": true,

Now, that line of the config file shows a tooltip message Unknown configuration setting.

I tried making the recommended change to settings.json and this resulted in another error pop-up (sorry did not take screen grab in time). I backed out and restored an earlier copy of settings.json. VSCode now runs without error messages.

@DonJayamanne DonJayamanne self-assigned this Apr 25, 2019
@DonJayamanne DonJayamanne added area-testing regression Bug didn't exist in a previous release labels Apr 25, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Apr 25, 2019
@DonJayamanne DonJayamanne added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Apr 25, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Apr 25, 2019
@DonJayamanne
Copy link

@cdietschrun @ralexx @xibalba01
Please could you provide a sample repo (files/project) that we can use at our end to replicate this bug.

@ralexx
Copy link

ralexx commented Apr 25, 2019

@DonJayamanne, unfortunately I can't provide my repo. I tried to drag some modules and their companion tests into a fresh repo but VSCode/Python were well-behaved.

From Python output window after running VSCode in the original repo:

Starting Jedi Python language engine.
Diagnostic Code: InvalidTestSettingDiagnostic, Message: Your settings needs to be updated to change the setting "python.unitTest." to "python.testing.", otherwise testing Python code using the extension may not work. Would you like to automatically update your settings now?

@StudyExchange
Copy link

I have similar problem!

1. Env

VS Code version:

Version: 1.33.1 (user setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

Anaconda: Python 3.6.5 :: Anaconda, Inc.

2. My demo repo is bellow:

vscode_bug_demo is my project folder.
[./vscode_bug_demo/.vscode/settings.json]

{
    "python.pythonPath": "C:\\ProgramData\\Anaconda3\\python.exe",
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        "./test",
        "-p",
        "*_test.py"
    ],
    "python.testing.pyTestEnabled": true,
    "python.testing.nosetestsEnabled": false,
    "python.testing.unittestEnabled": false,
    "python.testing.pyTestArgs": [
        "test"
    ]
}

[./vscode_bug_demo/test/demo_test.py]

import pytest
class Test_Demo(object):
    def test_demo(self):
        assert True

@MarekLew
Copy link

MarekLew commented Apr 25, 2019

After update extension do 2019.4.0 pytest return code -2. I reconfigure setting and don`t work too.

VS Code version: 1.33.1
OS and version: Windows 10
Python version: 3.7.2 in my virtualenv
pytest-4.4.1

@r-beer
Copy link

r-beer commented Apr 25, 2019

After update extension do 2019.4.0 pytest return code -2. I reconfigure setting and don`t work too.

VS Code version: 1.33.1
OS and version: Windows 10
Python version: 3.7.2 in my virtualenv
pytest-4.4.1

I get the same error, with exit code 2 or 4 using a similar setup but Python 3.7.1 in a conda environment.

I was able to set up a small folder with just two files as described in the VS Code tutorial for unit testing which successfully discovers and runs the tests.

However, as soon as I add test_function.py files from my repository, I get the errors.

Maybe there are some bugs which interrupt the test discovery when imports within the test_function.py files are not successful?

@phloose
Copy link

phloose commented Apr 25, 2019

Strangely when i set up a clean repo i get not problems... since my repo/filebase where the error occured is largely crap i dont like to make it official :) But maybe it helps:

https://github.com/xibalba01/vscode_python_ext_bug

Some interesting thing happened while playing around with my repo: I figured out that the error did NOT occur in vscode when i leave out the __init__.py file! Tests are discovered successfully. I have to add, that an existing __init__.py has no effect on manually running pytest! Hope it helps discovering the bug.

@chkpnt
Copy link

chkpnt commented Apr 25, 2019

@xibalba01 I guess you do not experience this issue as you do not specify a folder for your tests (python.testing.pyTestArgs).
If you do so, like python.testing.pyTestArgs = [ "tests" ], VSCode tries to access the test file in tests/folder/test_sometest.py as folder/test_sometest.py, which of course isn't accessible.

For me, a work-around was to use python.testing.pyTestArgs = [ "." ] and to ignore the folders I do not want to test.

@r-beer
Copy link

r-beer commented Apr 25, 2019

@xibalba01 I guess you do not expirence this issue as you do not specify a folder for your tests (python.testing.pyTestArgs).
If you do so, like python.testing.pyTestArgs = [ "tests" ], VSCode tries to access the test file in tests/folder/test_sometest.py as folder/test_sometest.py, which of course isn't accessible.

For me, a work-around was to use python.testing.pyTestArgs = [ "." ] and to ignore the folders I do not want to test.

While this is indeed a workaround for the non-recognition of tests in subfolders, which worked for me when I added an __init__.py file in the subfolder, for me this still results in a test discovery error with exit code 2, related to an import of a package.

I can control whether the test discovery will fail or not, by just (de-) commenting one import statement in one file.

I am new to pytest, so please let me know, if this is intended.

Anyway, it would be helpful if unsuccesful imports result in an error for the respective file without the test discovery failing entirely.

@phloose
Copy link

phloose commented Apr 25, 2019

@chkpnt when you look in the settings.json in the repo i pointed to, i specified the root directory as test directory --> python.testing.pyTestArgs = [ "." ].

Anyway, i think it should not be such a hassle to discover tests, which are somewhere in the workspace folder tree - with or without __init__.py. I am wondering that this is somehow broken, because the same setup worked a few days before (maybe it has to do with python extension update?!)...

As i said, when running pytest from the commandline from the root folder with the same commands from the pyTestArgs the tests are discovered without any problem - with and without __init__.py. Within vscode tests are only discovered when i leave out the __init__.py. For replication check my repo: https://github.com/xibalba01/vscode_python_ext_bug

@r-beer i second that. More clear error messages would be helpful.

@docker0406
Copy link

after update pytest and vscode are latest version,I met same issue with exit code 2

Test Discovery failed:
Error: Traceback (most recent call last):
File "c:\Users\wuguilin.vscode\extensions\ms-python.python-2019.4.11987\pythonFiles\testing_tools\run_adapter.py", line 16, in
main(tool, cmd, subargs, toolargs)
File "c:\Users\wuguilin.vscode\extensions\ms-python.python-2019.4.11987\pythonFiles\testing_tools\adapter_main_.py", line 90, in main
parents, result = run(toolargs, **subargs)
File "c:\Users\wuguilin.vscode\extensions\ms-python.python-2019.4.11987\pythonFiles\testing_tools\adapter\pytest.py", line 43, in discover
raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 1)

my code

import pytest

def test_a():
    assert 1

@hameerabbasi
Copy link

I ran into the same issue. Here's a minimal repro (you need pytest and pytest-flake8):

Test discovery fails with the addopts line in pytest.ini and passes without it.

vscode-test.zip

Python Extension Version: 2019.4.11987
VSCode version: 1.33.1

Here's what should happen:

$ pytest --collect-only
============================= test session starts ==============================
platform darwin -- Python 3.7.3, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: /Users/hameerabbasi/Quansight/vscode-test, inifile: pytest.ini
plugins: mypy-0.3.2, flake8-1.0.4, cov-2.6.1, nbval-0.9.1
collected 2 items
<Flake8Item tests/test_abc.py>
<Module tests/test_abc.py>
  <Function test_abc>

========================= no tests ran in 0.01 seconds =========================

@DonJayamanne DonJayamanne changed the title Tests not being found, and ignored directories not being ignored since 2019.4.0 in lint and pytest Tests not being discovered since 2019.4.0 Apr 25, 2019
@darrenwu-git
Copy link

I met similar issue here:
Test discovery error, please check the configuration settings for the tests.

My setings.json:
"python.testing.pyTestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pyTestEnabled": true

VS Code Version: 1.33.1
Extension version Version: 2019.4.11987
Python version: 3.5.6 64-bit
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Relevant/affected Python packages and their versions: pytest 4.4.0

@DonJayamanne
Copy link

@MusicGuitar Please could you provide a sample repo we can use to replicate this at our end.

@DonJayamanne DonJayamanne added the important Issue identified as high-priority label Apr 25, 2019
@hameerabbasi
Copy link

hameerabbasi commented Apr 25, 2019

@DonJayamanne I’ve provided a ZIP file in my comments, it’s a minimal repro.

You can also use https://github.com/Quansight-Labs/uarray

I basically just switched the unit test framework to PyTest and added the --no-cov flag.

@darrenwu-git
Copy link

@DonJayamanne
Here is my sample repo.
https://github.com/musicguitar/vscode_python_pytest_fails_sample
When I run the "Run All tests" in vscode. Also, there are no any test cases been found.

It shows the following errors:

Test Discovery failed: 
Error: Traceback (most recent call last):
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/run_adapter.py", line 16, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/pytest.py", line 43, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 2)

Test Discovery failed: 
Error: Traceback (most recent call last):
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/run_adapter.py", line 16, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/pytest.py", line 43, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 2)

Test Discovery failed: 
Error: Traceback (most recent call last):
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/run_adapter.py", line 16, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/pytest.py", line 43, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 2)

Test Discovery failed: 
Error: Traceback (most recent call last):
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/run_adapter.py", line 16, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "/home/darrenwu/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/testing_tools/adapter/pytest.py", line 43, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 2)

============================= test session starts ==============================
platform linux -- Python 3.5.6, pytest-4.4.0, py-1.8.0, pluggy-0.9.0
rootdir: /home/darrenwu/workspace/stock/vscode_python_pytest_fails_sample
collected 1 item

tests/test_stockcodes.py .                                               [100%]

-------------- generated xml file: /tmp/tmp-8268oUZMSUx4pq2M.xml ---------------
=========================== 1 passed in 0.27 seconds ===========================

@ashleybartlett
Copy link

I have found that removing all args, and leaving it as a blank list appears to work.

@darrenwu-git
Copy link

Tried to revert to 2019.3.6558. And reverted setting.json as:

"python.unitTest.pyTestArgs": [
    "."
  ],
  "python.unitTest.unittestEnabled": false,
  "python.unitTest.nosetestsEnabled": false,
  "python.unitTest.pyTestEnabled": true

The pytest works with my test repo:
https://github.com/musicguitar/vscode_python_pytest_fails_sample

Name: Python
Id: ms-python.python
Description: Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.
Version: 2019.3.6558
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python

@montao
Copy link

montao commented Apr 26, 2019

Seems like a bug in the latest version of VS Code Python extension. I had the same issue, then I downgraded the Python extension to 2019.3.6558 and then it works again. So we should go to our VS Code extensions list, select the Python extension and "Install another version..." from the setting of that extension.

ericsnowcurrently added a commit that referenced this issue May 15, 2019
(for #5458)

pythonFiles/testing_tools/adapter/pytest.py has gotten too big, with too many different things implemented there. This change addresses that by adding a "pytest" subpackage and splitting the code from pytest.py up into several modules under that subpackage.

Note that this change is almost exclusively moving code around, adding missing docstrings, and removing superfluous comments.
@brettcannon brettcannon added the regression Bug didn't exist in a previous release label May 30, 2019
@hameerabbasi
Copy link

This error went away and then came back for me.

@hameerabbasi
Copy link

The log:

python /Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear
Test Discovery failed: 
Error: ============================= test session starts ==============================
platform darwin -- Python 3.7.3, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /Users/hameerabbasi/Quansight/unumpy, inifile: pytest.ini, testpaths: unumpy
plugins: mypy-0.3.3, cov-2.7.1, black-0.3.7
collected 183 items
<BlackItem unumpy/__init__.py>
<MypyItem unumpy/__init__.py>
<DoctestModule unumpy/__init__.py>
  <DoctestItem unumpy>
<Package /Users/hameerabbasi/Quansight/unumpy/unumpy>
  <BlackItem _multimethods.py>
  <MypyItem _multimethods.py>
  <BlackItem _version.py>
  <MypyItem _version.py>
  <BlackItem cupy_backend.py>
  <MypyItem cupy_backend.py>
  <BlackItem dask_backend.py>
  <MypyItem dask_backend.py>
  <BlackItem numpy_backend.py>
  <MypyItem numpy_backend.py>
  <BlackItem sparse_backend.py>
  <MypyItem sparse_backend.py>
  <BlackItem torch_backend.py>
  <MypyItem torch_backend.py>
  <BlackItem xnd_backend.py>
  <MypyItem xnd_backend.py>
<BlackItem unumpy/tests/__init__.py>
<MypyItem unumpy/tests/__init__.py>
<Package /Users/hameerabbasi/Quansight/unumpy/unumpy/tests>
  <BlackItem test_numpy.py>
  <MypyItem test_numpy.py>
  <Module test_numpy.py>
    <Function test_ufuncs_coerce[backend0-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend0-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend0-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend0-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend0-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend0-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend0-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend0-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend0-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend0-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend0-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend0-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend0-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend0-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend0-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend0-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend0-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend0-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend0-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend0-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend0-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend0-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend0-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend0-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend0-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend0-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend0-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend0-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend0-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend0-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend0-method27-args27-kwargs27]>
    <Function test_multiple_output[backend0-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend1-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend1-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend1-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend1-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend1-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend1-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend1-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend1-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend1-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend1-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend1-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend1-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend1-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend1-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend1-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend1-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend1-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend1-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend1-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend1-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend1-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend1-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend1-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend1-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend1-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend1-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend1-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend1-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend1-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend1-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend1-method27-args27-kwargs27]>
    <Function test_multiple_output[backend1-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend2-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend2-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend2-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend2-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend2-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend2-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend2-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend2-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend2-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend2-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend2-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend2-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend2-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend2-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend2-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend2-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend2-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend2-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend2-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend2-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend2-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend2-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend2-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend2-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend2-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend2-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend2-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend2-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend2-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend2-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend2-method27-args27-kwargs27]>
    <Function test_multiple_output[backend2-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend3-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend3-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend3-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend3-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend3-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend3-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend3-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend3-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend3-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend3-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend3-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend3-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend3-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend3-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend3-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend3-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend3-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend3-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend3-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend3-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend3-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend3-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend3-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend3-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend3-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend3-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend3-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend3-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend3-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend3-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend3-method27-args27-kwargs27]>
    <Function test_multiple_output[backend3-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend4-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend4-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend4-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend4-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend4-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend4-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend4-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend4-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend4-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend4-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend4-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend4-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend4-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend4-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend4-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend4-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend4-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend4-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend4-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend4-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend4-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend4-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend4-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend4-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend4-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend4-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend4-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend4-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend4-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend4-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend4-method27-args27-kwargs27]>
    <Function test_multiple_output[backend4-method0-args0-kwargs0]>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/_pytest/main.py", line 462, in perform_collect
INTERNALERROR>     session=self, config=self.config, items=items
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 77, in pytest_collection_modifyitems
INTERNALERROR>     self._tests.add_test(test, parents)
INTERNALERROR>   File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/discovery.py", line 35, in add_test
INTERNALERROR>     parentid = self._ensure_parent(test.path, parents)
INTERNALERROR>   File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/discovery.py", line 60, in _ensure_parent
INTERNALERROR>     assert nodeid == '.'
INTERNALERROR> AssertionError
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/_pytest/main.py", line 213, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/_pytest/main.py", line 256, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/_pytest/main.py", line 266, in pytest_collection
INTERNALERROR>     return session.perform_collect()
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/_pytest/main.py", line 465, in perform_collect
INTERNALERROR>     hook.pytest_collection_finish(session=self)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/Users/hameerabbasi/miniconda3/envs/uarray/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 91, in pytest_collection_finish
INTERNALERROR>     self._tests.add_test(test, parents)
INTERNALERROR>   File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/discovery.py", line 35, in add_test
INTERNALERROR>     parentid = self._ensure_parent(test.path, parents)
INTERNALERROR>   File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/discovery.py", line 60, in _ensure_parent
INTERNALERROR>     assert nodeid == '.'
INTERNALERROR> AssertionError

========================= no tests ran in 1.18 seconds =========================

Traceback (most recent call last):
  File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/run_adapter.py", line 16, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "/Users/hameerabbasi/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 34, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 3)
pytest --collect-only
============================================== test session starts ==============================================
platform darwin -- Python 3.7.3, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /Users/hameerabbasi/Quansight/unumpy, inifile: pytest.ini, testpaths: unumpy
plugins: mypy-0.3.3, cov-2.7.1, black-0.3.7
collected 183 items                                                                                             
<BlackItem unumpy/__init__.py>
<MypyItem unumpy/__init__.py>
<DoctestModule unumpy/__init__.py>
  <DoctestItem unumpy>
<Package /Users/hameerabbasi/Quansight/unumpy/unumpy>
  <BlackItem _multimethods.py>
  <MypyItem _multimethods.py>
  <BlackItem _version.py>
  <MypyItem _version.py>
  <BlackItem cupy_backend.py>
  <MypyItem cupy_backend.py>
  <BlackItem dask_backend.py>
  <MypyItem dask_backend.py>
  <BlackItem numpy_backend.py>
  <MypyItem numpy_backend.py>
  <BlackItem sparse_backend.py>
  <MypyItem sparse_backend.py>
  <BlackItem torch_backend.py>
  <MypyItem torch_backend.py>
  <BlackItem xnd_backend.py>
  <MypyItem xnd_backend.py>
<BlackItem unumpy/tests/__init__.py>
<MypyItem unumpy/tests/__init__.py>
<Package /Users/hameerabbasi/Quansight/unumpy/unumpy/tests>
  <BlackItem test_numpy.py>
  <MypyItem test_numpy.py>
  <Module test_numpy.py>
    <Function test_ufuncs_coerce[backend0-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend0-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend0-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend0-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend0-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend0-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend0-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend0-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend0-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend0-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend0-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend0-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend0-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend0-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend0-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend0-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend0-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend0-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend0-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend0-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend0-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend0-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend0-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend0-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend0-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend0-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend0-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend0-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend0-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend0-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend0-method27-args27-kwargs27]>
    <Function test_multiple_output[backend0-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend1-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend1-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend1-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend1-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend1-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend1-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend1-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend1-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend1-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend1-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend1-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend1-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend1-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend1-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend1-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend1-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend1-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend1-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend1-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend1-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend1-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend1-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend1-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend1-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend1-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend1-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend1-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend1-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend1-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend1-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend1-method27-args27-kwargs27]>
    <Function test_multiple_output[backend1-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend2-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend2-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend2-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend2-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend2-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend2-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend2-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend2-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend2-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend2-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend2-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend2-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend2-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend2-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend2-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend2-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend2-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend2-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend2-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend2-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend2-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend2-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend2-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend2-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend2-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend2-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend2-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend2-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend2-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend2-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend2-method27-args27-kwargs27]>
    <Function test_multiple_output[backend2-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend3-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend3-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend3-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend3-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend3-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend3-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend3-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend3-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend3-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend3-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend3-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend3-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend3-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend3-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend3-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend3-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend3-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend3-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend3-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend3-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend3-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend3-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend3-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend3-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend3-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend3-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend3-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend3-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend3-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend3-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend3-method27-args27-kwargs27]>
    <Function test_multiple_output[backend3-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend4-method0-args0-kwargs0]>
    <Function test_ufuncs_coerce[backend4-method1-args1-kwargs1]>
    <Function test_ufuncs_coerce[backend4-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend4-method0-args0-kwargs0]>
    <Function test_functions_coerce[backend4-method1-args1-kwargs1]>
    <Function test_functions_coerce[backend4-method2-args2-kwargs2]>
    <Function test_functions_coerce[backend4-method3-args3-kwargs3]>
    <Function test_functions_coerce[backend4-method4-args4-kwargs4]>
    <Function test_functions_coerce[backend4-method5-args5-kwargs5]>
    <Function test_functions_coerce[backend4-method6-args6-kwargs6]>
    <Function test_functions_coerce[backend4-method7-args7-kwargs7]>
    <Function test_functions_coerce[backend4-method8-args8-kwargs8]>
    <Function test_functions_coerce[backend4-method9-args9-kwargs9]>
    <Function test_functions_coerce[backend4-method10-args10-kwargs10]>
    <Function test_functions_coerce[backend4-method11-args11-kwargs11]>
    <Function test_functions_coerce[backend4-method12-args12-kwargs12]>
    <Function test_functions_coerce[backend4-method13-args13-kwargs13]>
    <Function test_functions_coerce[backend4-method14-args14-kwargs14]>
    <Function test_functions_coerce[backend4-method15-args15-kwargs15]>
    <Function test_functions_coerce[backend4-method16-args16-kwargs16]>
    <Function test_functions_coerce[backend4-method17-args17-kwargs17]>
    <Function test_functions_coerce[backend4-method18-args18-kwargs18]>
    <Function test_functions_coerce[backend4-method19-args19-kwargs19]>
    <Function test_functions_coerce[backend4-method20-args20-kwargs20]>
    <Function test_functions_coerce[backend4-method21-args21-kwargs21]>
    <Function test_functions_coerce[backend4-method22-args22-kwargs22]>
    <Function test_functions_coerce[backend4-method23-args23-kwargs23]>
    <Function test_functions_coerce[backend4-method24-args24-kwargs24]>
    <Function test_functions_coerce[backend4-method25-args25-kwargs25]>
    <Function test_functions_coerce[backend4-method26-args26-kwargs26]>
    <Function test_functions_coerce[backend4-method27-args27-kwargs27]>
    <Function test_multiple_output[backend4-method0-args0-kwargs0]>

---------------- generated xml file: /Users/hameerabbasi/Quansight/unumpy/junit/test-results.xml ----------------

---------- coverage: platform darwin, python 3.7.3-final-0 -----------
Name                                                               Stmts   Miss Branch BrPart  Cover
----------------------------------------------------------------------------------------------------
/Users/hameerabbasi/Quansight/uarray/uarray/__init__.py                4      0      0      0   100%
/Users/hameerabbasi/Quansight/uarray/uarray/_backend.py               91     36     14      0    58%
/Users/hameerabbasi/Quansight/uarray/uarray/_version.py              278    154    144     22    36%
/Users/hameerabbasi/Quansight/uarray/uarray/tests/__init__.py          0      0      0      0   100%
/Users/hameerabbasi/Quansight/uarray/uarray/tests/test_uarray.py      91     91     38      0     0%
----------------------------------------------------------------------------------------------------
TOTAL                                                                464    281    196     22    33%
Coverage HTML written to dir htmlcov
Coverage XML written to file coverage.xml

========================================= no tests ran in 1.37 seconds ==========================================

@niksite
Copy link

niksite commented Aug 9, 2019

Same issue for me, just a bit different error:

python /Users/sisuser/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear --reuse-db
Test Discovery failed: 
Error: ============================= test session starts ==============================
platform darwin -- Python 2.7.16, pytest-4.6.5, py-1.5.4, pluggy-0.12.0 -- /
...
INTERNALERROR>   File "/Users/sisuser/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 94, in pytest_collection_finish
INTERNALERROR>     test, parents = parse_item(item, self.NORMCASE, self.PATHSEP)
INTERNALERROR>   File "/Users/sisuser/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 156, in parse_item
INTERNALERROR>     if not fspath.endswith(relfile[1:]):
INTERNALERROR> TypeError: 'NoneType' object has no attribute '__getitem__'

======================== no tests ran in 10.97 seconds =========================

Traceback (most recent call last):
  File "/Users/sisuser/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles/testing_tools/run_adapter.py", line 18, in <module>
    main(tool, cmd, subargs, toolargs)
  File "/Users/sisuser/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
    parents, result = run(toolargs, **subargs)
  File "/Users/sisuser/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 36, in discover
    raise Exception('pytest discovery failed (exit code {})'.format(ec))
Exception: pytest discovery failed (exit code 3)

@brettcannon
Copy link
Member

@niksite can you please open a new issue since your cause is different?

@jetxeberria
Copy link

Same problem, after trying different versions of Python Extension finally discovered with Python 2019.2.5558

Logs when failing:

============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
rootdir: /home/username/path/workspaceroot/tests
collected 92 items
<Package /home/username/path/workspaceroot/tests/models>
  <Module test_foo.py>
    <Function test_bar>
    ...
========================= no tests ran in 0.13 seconds =========================
Test Discovery failed: 
TypeError: Cannot read property 'uri' of undefined

@praenubilus
Copy link

Same problem, after trying different versions of Python Extension finally discovered with Python 2019.2.5558

Logs when failing:

============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
rootdir: /home/username/path/workspaceroot/tests
collected 92 items
<Package /home/username/path/workspaceroot/tests/models>
  <Module test_foo.py>
    <Function test_bar>
    ...
========================= no tests ran in 0.13 seconds =========================
Test Discovery failed: 
TypeError: Cannot read property 'uri' of undefined

There are lots of reasons test will not be discovered. e.g. If you have syntax error or import error(cannot find module being imported, usually it is caused by missing appropriate init.py). Based on your partial log, I doubt it may be the former one. I will suggest you paste the whole log

@jetxeberria
Copy link

jetxeberria commented Aug 20, 2019

Same problem, after trying different versions of Python Extension finally discovered with Python 2019.2.5558
Logs when failing:

============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
rootdir: /home/username/path/workspaceroot/tests
collected 92 items
<Package /home/username/path/workspaceroot/tests/models>
  <Module test_foo.py>
    <Function test_bar>
    ...
========================= no tests ran in 0.13 seconds =========================
Test Discovery failed: 
TypeError: Cannot read property 'uri' of undefined

There are lots of reasons test will not be discovered. e.g. If you have syntax error or import error(cannot find module being imported, usually it is caused by missing appropriate init.py). Based on your partial log, I doubt it may be the former one. I will suggest you paste the whole log

My Python Extension has been automatically updated to 2019.8.30787.
It's weird that now I'm seeing again the "Discovery failed" error, but when I click the "Run All Tests" or "Debug All Tests" icons of upper left corner (in "Test" vertical tab) they work. However I can't see the options of run | debug above each test, neither see the tests tree in "Test" vertical tab

Here you have the full log taken from the "Python Test Log" from the "Output" tab. It's generated when I click the "Run All Test" button in "Test" vertical tab.

python /home/jetxeberria/.vscode/extensions/ms-python.python-2019.8.30787/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s .
Test Discovery failed: 
TypeError: Cannot read property 'uri' of undefined
============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /media/jetxeberria/data/data/documents/projects/ppmatic/astronest
plugins: html-1.20.0, metadata-1.8.0
collected 15 items

test_config.py ....                                                      [ 26%]
test_movement.py .                                                       [ 33%]
test_parser.py ..........                                                [100%]

=============================== warnings summary ===============================
/home/jetxeberria/documents/programs/anaconda/anaconda3/envs/astronest/lib/python3.7/site-packages/pike/loader.py:3
  /home/jetxeberria/documents/programs/anaconda/anaconda3/envs/astronest/lib/python3.7/site-packages/pike/loader.py:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

-- Docs: https://docs.pytest.org/en/latest/warnings.html
-------------- generated xml file: /tmp/tmp-1564HZCZ7m2Dfw6g.xml ---------------
==================== 15 passed, 1 warnings in 0.37 seconds =====================

Also, when executing View > Command Palette > Python: Discover Tests this is the output of "Python Test Log":

python /home/jetxeberria/.vscode/extensions/ms-python.python-2019.8.30787/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear .
Test Discovery failed: 
TypeError: Cannot read property 'uri' of undefined

When executing View > Command Palette > Python: Run All Tests the first log is shown

@subhashb
Copy link

subhashb commented Aug 21, 2019

I have version 2019.8.30787 (the same as in comment above ☝️ ), and I get the same error as #5458 (comment)

I have the following options configured in setup.cfg:

[tool:pytest]
addopts = --cov=src --strict-markers --gherkin-terminal-reporter-expanded --flake8 -v

Turns out that --flake8 was the option causing the problem. If I remove --flake8, VSCode python succeeds in test discovery. Apologies, I have not dug further than this level, but I can supply more info if required.

Versions:

pytest             5.0.1
pytest-bdd         3.1.1
pytest-cov         2.7.1
pytest-flake8      1.0.4
flake8             3.7.8

Invoking the whole command succeeds in terminal, of course:
pytest --cov=src --strict-markers --gherkin-terminal-reporter-expanded -v

@hameerabbasi
Copy link

hameerabbasi commented Sep 2, 2019

pytest-black also causes this same issue, but pytest-cov doesn't.

Edit: Scratch that, I have --no-cov in the arguments.

@ericsnowcurrently ericsnowcurrently removed their assignment Sep 3, 2019
@ericsnowcurrently ericsnowcurrently removed this from the September sprint 2019.1 milestone Sep 16, 2019
@luabud
Copy link
Member

luabud commented Oct 24, 2019

Hey folks. There was a refactoring to the code that handles test discovery some time ago to address a series of issues. I believe many of the issues reported here might have been fixed or will when we address #6594. The remaining action item on the extension side regarding this issue has now become unclear, that's I'm closing this issue.

If you're still having issues with test discovery with pytest, I'm going to kindly ask you all to try to run pytest in the terminal -- if it works, then it's probably an extension issue and it'd be great if you could file a separate issue following the template providing your environment info as well as repro steps. If it doesn't work, then most probably it's not a bug in the extension side, but you can always file a new issue if you're unsure.

@luabud luabud closed this as completed Oct 24, 2019
@ghost ghost removed the needs PR label Oct 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests