PYTEST_CURRENT_TEST environment variable

2020-08-10

If you ever needed to know which tests execute a specific part of a code put this in your function/method:

import os
print(os.environ.get('PYTEST_CURRENT_TEST'))

and run all tests:

py.test -s  # -s means don't capture stdout so you can see the prints
Snippetspythonpytest

Print django SQL queries in development

Download mp3 from youtube using youtube-dl