microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.32k stars 1.18k forks source link

visualstudio_py_testlauncher.py - format_exception() missing 3 required positional arguments: 'etype', 'value', and 'tb' #3305

Closed Ark-kun closed 12 months ago

Ark-kun commented 5 years ago

I got an exception while trying to debug a unittest. The exception was from a bug in VSCode Python extension itself:

Exception has occurred: TypeError
format_exception() missing 3 required positional arguments: 'etype', 'value', and 'tb'
  File "C:\Users\Ark\.vscode\extensions\ms-python.python-2018.9.2\pythonFiles\PythonTools\visualstudio_py_testlauncher.py", line 344, in main
    pass
  File "C:\Users\Ark\.vscode\extensions\ms-python.python-2018.9.2\pythonFiles\PythonTools\visualstudio_py_testlauncher.py", line 347, in <module>
    main()

I looked at the extension's code and the error is correct. See https://github.com/DonJayamanne/pythonVSCode/commit/3e50a6821dc5db60cc87b4205fdb7c712d7fd7fb#r31258938

Environment data

Actual behavior

Exception has occurred: TypeError
format_exception() missing 3 required positional arguments: 'etype', 'value', and 'tb'
  File "C:\Users\Ark\.vscode\extensions\ms-python.python-2018.9.2\pythonFiles\PythonTools\visualstudio_py_testlauncher.py", line 344, in main
    pass
  File "C:\Users\Ark\.vscode\extensions\ms-python.python-2018.9.2\pythonFiles\PythonTools\visualstudio_py_testlauncher.py", line 347, in <module>
    main()

Expected behavior

No exception

VCPintoHUUB commented 5 years ago

Hi, Any workaround for this bug? Will it be fixed?

VCPintoHUUB commented 5 years ago

Hi, Any hope on seeing this fixed?

brettcannon commented 4 years ago

We are going through old issues and we noticed that no one had replied to this issue. I want to apologize for the oversight and to let you know that the issue was triaged (as shown by the labels applied to this issue).

eleanorjboyd commented 12 months ago

Hello! I have reviewed this issue and given the architectural changes of the testing rewrite, this issue should no longer exist on the rewrite. Therefore I am going to close this issue but please comment or open a new issue if you are still seeing a problem when you try this yourself!

To use the rewrite yourself just add ”python.experiments.optInto": ["pythonTestAdapter"] to your user settings. You can confirm you have the rewrite enabled by setting your log level to trace, via the Developer: Set Log Level command in the command palette. Then check to see if Experiment 'pythonTestAdapter' is active is in your python logs.

Thanks!