Replies: 3 comments
-
Any thoughts? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Generally to run tests successfully (manually, without VS Code) I do next: APP_ENV=test pytest --no-cov --no-migrations --maxfail=10 my_app and tests work. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is a duplicate of #16760. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I run my project inside the Docker container, and use "Remote - Container" extension for this. My host OS is MacOS, and inside container I use Ubuntu Linux. Generally when I reopen my project in container, I work like I have Ubuntu installed, and it what I like. It works fine with everything, except for pytest tests discovery.
I have a problem with test discovery in VS Code. My project is pretty big, and it depends on he env variables when python code is running. The same for pytest.
I have created next config in the
.vscode/launch.json
:And I can run all tests and debug them. But I want to be able to see the list of all tests in the "Testing" tab and see for each test function the "Run test" and "Debug test", to run or debug a specific test. I used it before in other projects and it worked fine. I have no idea why it fails for me in the new project (previously I did work with Unittest and without run in the Docker container, like I do it now).
Only thing that I understand - the VS Code runs this command to discover tests:
And as I see, it doesn't pass the env variables like I expect. I think that if I will be able to tell VS Code to pass env variables to the test discovery, it should start to work. I spend couple of weeks with tries, but no success. Please help me to make it work. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions