Created
June 7, 2012 20:46
-
-
Save schuster-rainer/2891441 to your computer and use it in GitHub Desktop.
python test discovery from commandline and visual studio 2010
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Projekt Structure | |
- project_root | |
| | |
+ doc/ | |
+ src/ | |
+ tests/ | |
+ run_tests.bat | |
# Setup | |
simply put the run_tests.bat in the root_folder of your projekt and execute it. | |
for details on how to configure test discovery have a look at the documentation: http://docs.python.org/library/unittest.html#test-discovery | |
# Visual Studio 2010 | |
in order to use it with python tools for visual studio goto | |
Tools > External Tools | |
add an entry with the following settings: | |
+------------------------------------------------------+ | |
| Title : python unittest | | |
+------------------------------------------------------+ | |
| Command : $(SolutionDir)\run_tests.bat | | |
+------------------------------------------------------+ | |
| Arguments: --verbose -p "*test*.py" | | |
+------------------------------------------------------+ | |
| Initial Directory: $(SolutionDir) | | |
+------------------------------------------------------+ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set PYTHONPATH=%~dp0\src | |
rem use unittest if your python version > 2.7 and unittest2 if you installed a backport running in python 2.5 or 2.6 | |
python -m unittest2 discover %* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment