I would like to run django unittest via python subprocess and I would like to store all the data (especially the words Failure or OK) in a variable. However when I use subprocess to run this the output only contains the parts:
"Creating test database for alias 'default'..." "Destroying test database for alias 'default'..."
The rest just comes out on the screen which is what I don't want. How can I get all of the output from a django unittest into a variable.
args_list = ['python', '/path/to/manage.py', 'test', 'myapp']
process=subprocess.Popen(args_list, stdout=subprocess.PIPE)
output, errors = process.communicate()
print output
output will just equal: Creating test database for alias 'default'... Destroying test database for alias 'default'...
However on my screen the whole standard output of the django unittest appears. How can all of the output be stores to a variable.