VS2022 with Python 3.10 failing to discover tests

32 views Asked by At

VS2022 with Python 3.10 failing to discover tests. .

Traceback (most recent call last): File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PROFESSIONAL\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\PythonFiles\testing_tools\run_adapter.py", line 18, in main(tool, cmd, subargs, toolargs) File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PROFESSIONAL\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\PythonFiles\testing_tools\adapter_main_.py", line 129, in main parents, result = run(toolargs, **subargs) File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PROFESSIONAL\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\PythonFiles\testing_tools\adapter\unittest_discovery.py", line 21, in discover print(error) File "C:\Users\fnh3651\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 659: character maps to

In fact it was also showing errors for missing python packages that are not installed. After installing all the required python packages used by my solution then I ended up with this weird error. As per my experience with previous Visual studio, it never used to find missing packages during test discovery process.

But on same solution, when I change the environment to Python 3.7 its able to discover all test.

0

There are 0 answers