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

Pytest discovery stuck in Output panel #18656

Closed
Tracked by #19791
mrtolkien opened this issue Mar 8, 2022 · 18 comments
Closed
Tracked by #19791

Pytest discovery stuck in Output panel #18656

mrtolkien opened this issue Mar 8, 2022 · 18 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on verified Verification succeeded
Milestone

Comments

@mrtolkien
Copy link

mrtolkien commented Mar 8, 2022

Issue Type: Bug

Behaviour

Expected vs. Actual

Running pytest in the terminal works. Running the discovery command from VS Code directly works:

> ~/.cache/pypoetry/virtualenvs/lol-data-rest-api-m4zklELf-py3.10/bin/python ~/.vscode-server/extensions/ms-python.python-2022.2.1924087327/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . --cache-clear --runxfail -s rest_api/tests

[{"rootid": ".", "root": "/home/tolki/development/mobalab/mobalab_backend", "parents": [{"id": "./rest_api", "kind": "folder", "name": "rest_api", "parentid": ".", "relpath": "./rest_api"}, {"id": "./rest_api/tests", "kind": "folder", "name": "tests", "parentid": "./rest_api", "relpath": "./rest_api/tests"}, {"id": "./rest_api/tests/test_games.py", "kind": "file", "name": "test_games.py", "parentid": "./rest_api/tests", "relpath": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_add_note", "kind": "function", "name": "test_add_note", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_delete_riot_game", "kind": "function", "name": "test_delete_riot_game", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_get_game_champion", "kind": "function", "name": "test_get_game_champion", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_insert_and_delete_game", "kind": "function", "name": "test_insert_and_delete_game", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_games.py::test_update_game", "kind": "function", "name": "test_update_game", "parentid": "./rest_api/tests/test_games.py"}, {"id": "./rest_api/tests/test_get_game_details.py", "kind": "file", "name": "test_get_game_details.py", "parentid": "./rest_api/tests", "relpath": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_all_kills", "kind": "function", "name": "test_get_all_kills", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_building_kills", "kind": "function", "name": "test_get_game_building_kills", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_epic_monsters_kills", "kind": "function", "name": "test_get_game_epic_monsters_kills", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_gold", "kind": "function", "name": "test_get_game_gold", "parentid": "./rest_api/tests/test_get_game_details.py"}, {"id": "./rest_api/tests/test_get_game_details.py::test_get_game_kills", "kind": "function", "name": "test_get_game_kills", "parentid": "./rest_api/tests/test_get_game_details.py"},
(...)

But in the OUTPUT/Python tab the process is stuck and never finds tests.

If I forcefully stop it, the logs are:

[ERROR 2022-2-8 18:31:46.477]: Cancelled discovering pytest tests:
 SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at a.runTestDiscovery (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:82661)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at E.refreshTestData (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:94259)
    at v.refreshTestDataInternal (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:85653)
    at async Promise.all (index 0)
    at v.resolveChildren (/home/tolki/.vscode-server/extensions/ms-python.python-2022.2.1924087327/out/client/extension.js:85:86988) {
  stdout: ''
}

Interestingly, the log error looks to be 1 month in the past for some reason.

Steps to reproduce:

  1. Launch VS Code
  2. No Python tests :(

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.1
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Default
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

insidersChannel: "off"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.2.1924087327
VS Code version: Code 1.65.0 (b5205cc8eb4fbaa726835538cd82372cc0222d43, 2022-03-02T11:12:08.962Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 7 5800X 8-Core Processor (16 x 3793)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.90GB (12.93GB free)
Process Argv --crash-reporter-id 0b342376-bcbb-4c08-9c59-05e04abdb7b7
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.16.3-microsoft-standard-WSL2
CPUs AMD Ryzen 7 5800X 8-Core Processor (16 x 3792)
Memory (System) 15.58GB (8.76GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vsclayoutctrt:30448491
dsvsc009:30440023
pythonvspyt640:30442238
vsbas813:30436447
vscscmwlcmt:30438805
vscgsvidc:30447482
helix:30440343

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 8, 2022
@karthiknadig karthiknadig added area-testing bug Issue identified by VS Code Team member as probable bug triage and removed triage-needed Needs assignment to the proper sub-team labels Mar 8, 2022
@kimadeline
Copy link

Hi @mrtolkien, thank you for reaching out.

Do you have a sample repo I could use to try and replicate your issue?

Thanks!

@kimadeline kimadeline added the info-needed Issue requires more information from poster label Mar 8, 2022
@brettcannon brettcannon changed the title Pytest discovery stuck i Pytest discovery stuck in Output panel Mar 8, 2022
@mrtolkien
Copy link
Author

mrtolkien commented Mar 9, 2022

This is happening in a private monorepo that has both Jest and Pytest suites configured. The python interpreter is built with poetry and properly gets activated when opening the terminal.

Jest and Pytest used to cohabitate peacefully, but now pytests discovery freezes forever with no feedback on logging.

I'm not entirely sure how to recreate a similar repo to try and reproduce the problem, especially since there's no feedback from the extension. Is it possible to run a debugger attached to it?

@mrtolkien
Copy link
Author

Still facing this issue, but it's intermittent. Sometimes I'll start VS Code and it'll properly pick up the tests, sometimes it won't.

But most of the time it just stays stuck, with the following feedback in OUTPUT/Python:

> ~/.cache/pypoetry/virtualenvs/lol-data-rest-api-m4zklELf-py3.10/bin/python ~/.vscode-server/extensions/ms-python.python-2022.2.1924087327/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear rest_api/tests
cwd: .

I'm also seeing nothing in the Extensions Log Folder, it's just frozen there forever and impossible to debug. I wish I could give more information honestly, but the exact incriminating command runs perfectly in the terminal already...

@mrtolkien
Copy link
Author

I have installed this extension and it finds and runs my tests properly:
https://marketplace.visualstudio.com/items?itemName=LittleFoxTeam.vscode-python-test-adapter

It relies on the same settings coming from python.testing so it's not a configuration issue.

The repo is very big as it's a monorep containing both Typescrip and Python projects, could that be an issue?

@kimadeline
Copy link

kimadeline commented Apr 1, 2022

Hi @mrtolkien, sorry for the delay!

it's a monorep containing both Typescrip and Python projects, could that be an issue?

Maybe?
What is the output if you run pytest in the terminal (python -m pytest --rootdir . -s --cache-clear rest_api/tests)?

@mrtolkien
Copy link
Author

pytest runs perfectly in the terminal. Running python -m pytest --rootdir . -s --cache-clear rest_api/tests works.

Even the test discovery command works with the python 2022.04 extension:
~/.cache/pypoetry/virtualenvs/lol-data-rest-api-m4zklELf-py3.9/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear .

That's what's weird, everything works from a terminal, but for some reason the extension is stuck forever. Is it trying to index files in huge folders, like node_modules? I have added it to my norecursedirs in pytest.ini but it did not have any impact.

@mrtolkien mrtolkien reopened this Apr 3, 2022
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Apr 3, 2022
@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Apr 4, 2022
@CleitonDeLima
Copy link

Same problem here, the command seems to be stuck.

> ~/.cache/pypoetry/virtualenvs/coral-sistemas-o8TNEM9u-py3.8/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.0/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear
cwd: .

Executing the command via terminal is returns the path to the tests normally.

@kimadeline
Copy link

Hi @CleitonDeLima, same question as above, what is the output in the terminal? Do you have a sample repo I could use to try and replicate your issue?

@CleitonDeLima
Copy link

Hi @CleitonDeLima, same question as above, what is the output in the terminal? Do you have a sample repo I could use to try and replicate your issue?

Hi @kimadeline

I have this problem in any project, this is the last one I tested.

Running run_adapter in the terminal I get the tests:

 > ~/.cache/pypoetry/virtualenvs/mywallet-RNjgMciX-py3.10/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear
[{"rootid": ".", "root": "/mnt/wsl/PHYSICALDRIVE3/Projects/mywallet", "parents": [{"id": "./tests", "kind": "folder", "name": "tests", "parentid": ".", "relpath": "./tests"}, {"id": "./tests/test_views.py", "kind": "file", "name": "test_views.py", "parentid": "./tests", "relpath": "./tests/test_views.py"}, {"id": "./tests/test_views.py::TestTransactions", "kind": "suite", "name": "TestTransactions", "parentid": "./tests/test_views.py"}], "tests": [{"id": "./tests/test_views.py::test_home", "name": "test_home", "source": "./tests/test_views.py:8", "markers": [], "parentid": "./tests/test_views.py"}, {"id": "./tests/test_views.py::TestTransactions::test_get_list", "name": "test_get_list", "source": "./tests/test_views.py:16", "markers": [], "parentid": "./tests/test_views.py::TestTransactions"}, {"id": "./tests/test_views.py::TestTransactions::test_get_create", "name": "test_get_create", "source": "./tests/test_views.py:23", "markers": [], "parentid": "./tests/test_views.py::TestTransactions"}, {"id": "./tests/test_views.py::TestTransactions::test_post_create", "name": "test_post_create", "source": "./tests/test_views.py:28", "markers": [], "parentid": "./tests/test_views.py::TestTransactions"}, {"id": "./tests/test_views.py::TestTransactions::test_update", "name": "test_update", "source": "./tests/test_views.py:42", "markers": [], "parentid": "./tests/test_views.py::TestTransactions"}]}]

vscode returns:

~/.cache/pypoetry/virtualenvs/mywallet-RNjgMciX-py3.10/bin/python ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear
cwd: .
Config System
CPUs AMD Ryzen 5 2600 Six-Core Processor (12 x 3394)
GPU Status 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled
Load (avg)  
Memory (System) 15.94GB (6.91GB free)
Process Argv --folder-uri=vscode-remote://wsl+Arch/home/cleiton/Projects/mywallet --remote=wsl+Arch --crash-reporter-id 9aee08db-1535-4d00-a08e-0570dd89def2
Screen Reader no
VM 0%
A/B experiment info
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30466689
pynewfile477:30463512
My enabled extensions
Extension Author (truncated) Version
html-snippets abu 0.2.1
Bookmarks ale 13.2.4
django-html bib 1.3.0
django big 1.0.2
font-switcher eva 4.0.3
auto-rename-tag for 0.1.10
better-cpp-syntax jef 1.15.13
vscode-peacock joh 4.0.1
dotenv mik 1.0.1
vscode-language-pack-pt-BR MS- 1.66.2
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.231.4
remote-ssh ms- 0.78.0
remote-ssh-edit ms- 0.80.0
remote-wsl ms- 0.66.0
vscode-icons vsc 11.10.0
codesnap adp 1.3.4
better-toml bun 0.3.2
EditorConfig Edi 0.16.4
vscode-language-pack-pt-BR MS- 1.66.2
python ms- 2022.4.1
vscode-pylance ms- 2022.4.0
jupyter ms- 2022.3.1000901801
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.6
vscodeintellicode Vis 1.2.18

(3 theme extensions excluded)

Notes

@matthewghgriffiths
Copy link

matthewghgriffiths commented Apr 20, 2022

I'm also getting this issue.

I'm running Ubuntu 20.04.4 LTS on WSL2.

VSCode version details:

Version: 1.66.2 (user setup)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:46:01.075Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.22000

the in the VSCode the python log hangs during the test discovery as so,

> /bin/python3 ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
cwd: .

When running the same command in the terminal in VSCode I get the following output,

matthew@studio:~/Source/test_vscode$ /bin/python3 ~/.vscode-server/extensions/ms-python.python-2022.4.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests
[{"rootid": ".", "root": "/mnt/c/Users/matthew/Source/test_vscode", "parents": [{"id": "./tests", "kind": "folder", "name": "tests", "parentid": ".", "relpath": "./tests"}, {"id": "./tests/test_1.py", "kind": "file", "name": "test_1.py", "parentid": "./tests", "relpath": "./tests/test_1.py"}], "tests": [{"id": "./tests/test_1.py::test_fail", "name": "test_fail", "source": "./tests/test_1.py:4", "markers": [], "parentid": "./tests/test_1.py"}]}]
matthew@studio:~/Source/test_vscode$ 

This problem occurs in a minimal test environment,

matthew@studio:~/Source/test_vscode$ tree
.
└── tests
    ├── __init__.py
    └── test_1.py

Where test_1.py is,

import pytest 

def test_fail():
    assert 0 == 1

I have also attached a tar of the test environment.

test_vscode.tar.gz

@kimadeline kimadeline removed the info-needed Issue requires more information from poster label Apr 20, 2022
@seedifferently
Copy link

seedifferently commented Apr 22, 2022

I am also encountering this issue where in the python Output panel pytest doesn't appear to discover any tests, but running the exact same command in the Terminal panel gives the expected output.

The below steps to reproduce worked for me with a fresh install using the following system info:

KEY VALUE
Windows Version 21H2
OS Build 19044.1645
VS Code Version 1.66.2
Remote WSL: Ubuntu-20.04
OS Linux x64 5.10.102.1-microsoft-standard-WSL2
EXTENSION VERSION
remote-wsl 0.66.0
python 2022.4.1
vscode-pylance 2022.4.2

Steps to reproduce:

  1. Set up WSL2 and install the Ubuntu 20.04 distro.
  2. Open Ubuntu 20.04 and install python3/pytest (e.g. sudo apt install -y python3-pytest)
  3. Do a mkdir -p ~/src/vscodeissue/ and populate it with the tests directory and files that @matthewghgriffiths demonstrated above.
  4. Install VS Code and wsl/python extensions.
  5. Open folder from item 3 in Remote-WSL with VS Code.
  6. Click testing icon on left, continue with pytest setup.
  7. Discovery will attempt to run, the Refresh Tests icon will spin for a few seconds, then nothing happens and no tests were discovered.
  8. Copy the command from the python Output panel into the Terminal panel, and you'll get the expected output.

Hope this helps.

@Strernd
Copy link

Strernd commented May 2, 2022

I have the same problem on OS: Darwin arm64 21.1.0 with VS Code 1.66.2

@karthiknadig karthiknadig added triage-needed Needs assignment to the proper sub-team and removed triage labels May 4, 2022
@krishnap
Copy link

krishnap commented Aug 25, 2022

I ran into this issue and another colleague did as well. In our case, we used to see abort trap: 6 when python test discovery was run due to missing openssl libraries in the path, which would show up as the unparsable json error that was reported at the top of the issue. After we put the libraries in the path (as below), things started working again for us.

ln -s /usr/local/Cellar/[email protected]/1.1.1d/lib/libcrypto.dylib /usr/local/lib/libcrypto.dylib
ln -s /usr/local/Cellar/[email protected]/1.1.1d/lib/libssl.dylib /usr/local/lib/libssl.dylib

@karthiknadig
Copy link
Member

We are working on a pytest adapter that does not interfere with pytests own detection. The current test adapter we have seems to be interacting with pytest in a way where it can cause errors when parsing JSON output. (Tracking item: #19791 )

I will add this issue to that task for verification when it is done.

@karthiknadig karthiknadig added needs PR Ready to be worked on and removed triage-needed Needs assignment to the proper sub-team labels Sep 15, 2022
@karthiknadig karthiknadig removed their assignment Sep 15, 2022
@eleanorjboyd
Copy link
Member

Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and I am not longer reproducing the bug! I used the minimal repro from @matthewghgriffiths.

If any of you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users settings.json "python.experiments.optInto": ["pythonTestAdapter"]. We are in the processes of switching all users to the rewrite but are doing so incrementally so if you do not have insiders, watch our release notes to get updated on when it will begin to hit stable. Let me know if it doesn’t work for you and we can re-open this issue. Thanks!

@eleanorjboyd eleanorjboyd added this to the June 2023 milestone Jun 22, 2023
@ulugbekna ulugbekna added the verified Verification succeeded label Jun 28, 2023
@stefanbschneider
Copy link

stefanbschneider commented Jun 29, 2023

@eleanorjboyd Great, thank you! With the new, experimental test adapter the test discovery worked quickly!

Note that I also had to set "python.experiments.enabled": true, in the settings, which I had previously set to false.


I have 2 repos with tests open in my workspace. With the old test adapter, the tests from repo A were loaded without issue but the test discover for repo B was running forever. Strangely, with the new, experimental adapter, the tests from B are discovered quickly, but I get a test discovery error for repo A:

2023-06-29 09:44:26.830 [error] pytest test discovery error 
 undefined

Not sure what to do with this? Running pytest --collect-only in a terminal works fine, so I don't know what the test discovery error is about.


Also, if I try to run tests from repo B, which are now discovered quickly with the new adapter, I get new errors about unclosed sockets, which I did not get before:

2023-06-29 11:42:51.150 [error] Pytest test execution error
 [n [Error]: sys:1: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 52886), raddr=('127.0.0.1', 52884)>

Not sure if all of these are related; just posting any info that may be useful.

@stefanbschneider
Copy link

My bad: I could resolve my issues with test discovery and running tests, simply by selecting: "Python: Configure Tests" from the command palette. Here I could select where to search for tests. Now test discovery works quickly without the experimental adapter.

@eleanorjboyd
Copy link
Member

Great! Glad it got resolved!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2023
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 needs PR Ready to be worked on verified Verification succeeded
Projects
None yet
Development

No branches or pull requests