getenv()s return None when using Pycharm's Play button

46 Views Asked by At

I am using:

from dotenv import load_dotenv
from os import getenv
load_dotenv("config/.env")

in a project which uses the pytest & selenium package.

I use getenv("example_string") at various points in this file which imports from a .env file.

The getenv()s work when I run the pytest command through the command-line. However, the getenv()s all return None when I run pytest through Pycharm's 'play button' like in the picture below:

enter image description here

How can I get the play button to work too?

0

There are 0 best solutions below