I\'d like to connect to a different database if my code is running under py.test. Is there a function to call or an environment variable that I can test that will tell me i
Working with pytest==4.3.1 the methods above failed, so I just went old school and checked with:
pytest==4.3.1
if 'pytest' in sys.argv[0]: print('pytest was called!')