Closed ttSpace closed 4 months ago
Seems like the version of pytest you installed is missing pytest.compat._translate_non_printable
. What version of pytest do you have? Can you try updating the version and see if it repros?
@StellaHuang95 The Python installed from Microsoft Store.
I am now able to repro it. It's an issue within the pytest 8.1.0. This version has been yanked, see https://doc.pytest.org/en/latest/changelog.html#pytest-8-1-0-yanked.
Once I revert back to 8.0.2, I was able to run tests without any issues.
This is still broken in pytest v8.1.1.
Describe the bug
Python from Microsoft Store.
Steps to Reproduce
Expected behavior
Tests can be run successfully.
Additional context and screenshots
The test was skipped.
Logs
Output for
General
in theOutput
panel``` ========== Starting test run ========== cd C:\Users\vting\source\repos\PythonApplication6\PythonApplication6\ set PYTHONPATH=C:\Users\vting\source\repos\PythonApplication6\PythonApplication6\ "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\python3.9.exe" "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\testlauncher.py" C:\Users\vting\source\repos\PythonApplication6\PythonApplication6\ pytest "" 0 "" "" dummyfilename .\test_1.py::test_failure .\test_1.py::test_passing --junitxml=C:\Users\vting\source\repos\PythonApplication6\TestResults\junitresults_c9d7473e-b54e-4c9e-b97a-aff866df4e4a.xml --rootdir=C:\Users\vting\source\repos\PythonApplication6\PythonApplication6 -o junit_logging=all -o junit_family=xunit1 Traceback (most recent call last): File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\testlauncher.py", line 189, in
main()
File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\testlauncher.py", line 30, in main
run(testRunner, coverage_file, test_file, args)
File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\testlauncher.py", line 119, in run
patch_translate_non_printable()
File "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\testlauncher.py", line 136, in patch_translate_non_printable
translate_non_printable = getattr(_pytest.compat, "_translate_non_printable")
AttributeError: module '_pytest.compat' has no attribute '_translate_non_printable'
Results for pytest not found C:\Users\vting\source\repos\PythonApplication6\TestResults\junitresults_c9d7473e-b54e-4c9e-b97a-aff866df4e4a.xml
========== Test run finished: 2 Tests (0 Passed, 0 Failed, 2 Skipped) run in 395 ms ==========
```