Issues With Python Testing

I’m observing inconsistencies between python testing in VS Code and Cursor. I’m specifically running Django unittests.

One issue is that Cursor is unable to discover all of my tests, but they show in VS Code. See example below showing a missing test_admin.py file.

Example:
Cursor on left, VS Code on right

Another issue I’ve seen is inconsistent test results. Tests will fail occasionally in Cursor but will always work when running in VS Code or directly from the terminal.

I’ve also noticed that tests using the django assertion: assertTemplateUsed will fail in Cursor, but work outside of it. In the test you can see that the response is using the template correctly.

Here is my workspace settings that I’m using to setup my python tests to work with Django.

		"debugpy.debugJustMyCode": false,
		"python.envFile": "${workspaceFolder}/.python_env_file",
		"python.experiments.optInto": [
			"pythonTestAdapter"
		],
		"python.testing.cwd": "${workspaceFolder}/backend",
		"python.testing.pytestEnabled": false,
		"python.testing.unittestEnabled": true,
		"python.testing.unittestArgs": [
			"--keepdb",
			"--settings=config.settings.test"
		],

Env info
Cursor Info
Version: 0.45.10
VSCode Version: 1.96.2
Commit: 15746f716efa868ebac16b1675bad2714d6c27d0
Date: 2025-02-05T06:20:28.304Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.0.0

VSCode Info
Version: 1.96.4 (Universal)
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.0.0

Testing Environment Info
Python: 3.10.4
Django: 4.2.18

4 Likes

also having this problem

Seems to be an issue with the python plugin: I’m seeing the same issue on VSCode with the release version of ms-python.python 2024.12.3 (which is the latest for Cursor). On a more recent version like 2025.0.0, it works fine.

I’m not sure why Cursor doesn’t have the more recent releases of the Python plugin though?

3 Likes

I also have this problem, if Cursor would update the Python extension version that would be great

The next Cursor update should fix this by bumping the VSCode base version, which should allow for newer Python extension versions!

For now you can work around this by running tests in the terminal using python manage.py test - this will give you the most reliable results until we get the update out

If you want to track when this update happens, keep an eye on cursor.com/changelog

2 Likes