First time here? Check out the FAQ!
1

Django project : Different ways to launch the debugger

Hello

I would like to make unique the way to launch debug test files whether they need unittest or Django test . For django test files, if I click on the green arrow and for unittest files I create a launch configuration associated to the file.

I cannot succeed in creating a launch configuration for a django test file that would not use the main entry point of the green arrow. I enter as run arguments manage.py test the name of the test file and in environment I select add to project values and set my own environment variables. This produces an error because the apps are not completely configured. What is wrong?

piscvau's avatar
526
piscvau
asked 2023-07-02 10:34:18 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2023-07-03 08:29:28 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

If you want to launch these tests like a regular debug/execute process then you may need to create an Named Entry Point from the Debug menu to pair the launch configuration with the file name and debug/execute that. Or bring up the file you want to debug in the editor and use Debug Current File in the Debug menu. The green arrow will start the main entry point if one is set.

If instead you are trying to run the test in the Testing tool, you can Add Current File to get the other file into the Testing tool and then set its Test Framework to 'unittest' and its Environment to your launch configuration under the Testing tab of the file's Project Properties (right-click on its name or the editor to access that). I just tried that in a Django project and it worked, in addition to having manage.py in the Testing tool to run Django style tests.

Wingware Support's avatar
4.2k
Wingware Support
answered 2023-07-03 08:29:08 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer