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