Closed kenichiice closed 2 months ago
The issue is that PTVS is trying to access pytest's private API, we will take a look and have it fixed.
For people finding this with google, and VS 2022 17.11.1 with pytest 8.3.2:
Change line 136 of this file to bypass this problem.
C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\Core\testlauncher.py
#note: this must match adapter\pytest\_discovery.py
def patch_translate_non_printable():
import _pytest.compat
translate_non_printable = getattr(_pytest.compat, "_translate_non_printable", None)
+,None
Describe the bug When running tests using pytest 8.3.1 on Visual Studio 2022, the following error occurs.
Note that this error does not occur when pytest 8.0.2 is used.
The
_translate_non_printable
that is causing the error seems to have been removed from the pytest code.Steps to Reproduce
Expected behavior No error should occur.
Sample Code For example, the following test code will reproduce the error.
Configuration information (If you are providing a diagnostics file (see below), skip this section) VS Version: 17.10.4 PTVS version: 17.0.24064.1 Python version: 3.11