# Advice for VS Code Testing Implementation

**URL:** <https://forum.djangoproject.com/t/advice-for-vs-code-testing-implementation/37261>\
**Category:** Using Django\
**Created:** [December 16, 2024, 7:16pm UTC](https://forum.djangoproject.com/t/advice-for-vs-code-testing-implementation/37261 "2024-12-16T19:16:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eleanorjboyd](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/eleanorjboyd/32/25797_2.png) [@eleanorjboyd](https://forum.djangoproject.com/u/eleanorjboyd)\
**Post date:** [December 16, 2024, 7:16pm UTC](https://forum.djangoproject.com/t/advice-for-vs-code-testing-implementation/37261/1 "2024-12-16T19:16:50Z")

</div>

Hello!  
I am the maintainer of the vscode-python extension and had a quick question about a bug I am having which I am trying to find the best solution for.

You can see the issue which started this here: [Error during Django test execution: [WinError 206] The filename or extension is too long · Issue #24242 · microsoft/vscode-python · GitHub](https://github.com/microsoft/vscode-python/issues/24242)

My main question is there any way to programmatically trigger Django test run like how pytest has `pytest.main`? Currently I am spinning up a subprocess to call Django test run but am hitting a limit where I am passing too many test-ids which makes the command too long. From our end I can switch to finding common parents of the tests and running those so each id doesn’t need to be included but since this is a more intensive endeavor I wanted to check to see if there are any other paths first.

I know you can call the steps of the test run itself like:

```auto
django.setup()

# Get and run the test runner
TestRunner = get_runner(settings)
....

```

but I am attempting to mirror user behavior as accurately as possible so doing each steps individually feels like it would restrict users control of the flow (but maybe thats not true and I should switch to this other way of calling it?)

Curious your advice as I want the Django implementation to follow the best practices of the library while working within the technical constraints of the extension.

Thanks!
