microsoft / microsoft/PTVS

Cannot run all tests in a large number of tests.

Open
#7,984 2 comments 0 reactions 1 assignee View on GitHub

@AdamYoblick is already working on this.

Since Aug 20, 2024.

needs repro
Dominant language
C#
Stars
2.6k
Forks
680
Avg merge
39m
Merged PRs (30d)
1

Description

Describe the bug

image

Steps to Reproduce

  1. "New Project->Python->From Existing Python code" to bring up dialog
  2. Select a folder that contains multiple tests.
    (Note: You can copy tests from the python distribution /lib/test, such as C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\Lib\test
  3. Open a "test_*.py" file to enable unittest.
  4. Wait for tests to be discovered and run all tests.

Expected behavior

All tests should load and run successfully.

Additional context and screenshots

Some tests did not run. Tests that have not been run can be run separately.

image

Logs

Output for Tests in the Output panel

Log level is set to Informational (Default).
Connected to test environment '< Local Windows Environment >'
Source code repository not available. Some features may not work as expected.
Test data store opened in 0.005 sec.
========== Starting test discovery ==========
Starting unittest discovery for the Folder4 project. This can take up to 60 seconds.
cd C:\Users\vting\source\repos\Folder4\
set PYTHONPATH=C:\Users\vting\source\repos\Folder4\
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\PythonFiles\testing_tools\run_adapter.py discover unittest --output-file C:\Users\vting\AppData\Local\Temp\tmp3469.tmp -- . test*.py
========== Test discovery finished: 1295 Tests found in 4.9 sec ==========
========== Starting test run ==========
cd C:\Users\vting\source\repos\Folder4\
set PYTHONPATH=C:\Users\vting\source\repos\Folder4;C:\Users\vting\source\repos\Folder4\
"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\PREVIEW\COMMON7\IDE\EXTENSIONS\MICROSOFT\PYTHON\CORE\visualstudio_py_testlauncher.py" --test-list C:\Users\vting\AppData\Local\Temp\tmp6D4B.tmp -r 59071
Connected to socket
Connection event fired
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\unittest\case.py", line 59, in testPartExecutor
    yield
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\unittest\case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\unittest\case.py", line 550, in _callTestMethod
    method()
  File "C:\Users\vting\source\repos\Folder4\test_baseexception.py", line 31, in test_inheritance
    inheritance_tree = open(os.path.join(os.path.split(__file__)[0],
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\vting\\source\\repos\\Folder4\\exception_hierarchy.txt'
AVAILABLE_TARGETS = []
EXPECTED_C_LOCALE_EQUIVALENTS = ['C', 'invalid.ascii']
EXPECTED_C_LOCALE_STREAM_ENCODING = 'ascii'
EXPECTED_C_LOCALE_FS_ENCODING = 'ascii'
EXPECT_COERCION_IN_DEFAULT_LOCALE = True
_C_UTF8_LOCALES = ('C.UTF-8', 'C.utf8', 'UTF-8')
_check_nl_langinfo_CODESET = False
========== Test run finished: 518 Tests (505 Passed, 1 Failed, 12 Skipped) run in 23.1 sec ==========

Tests.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.