Complete the code to set an environment variable using monkeypatch.
def test_env_var(monkeypatch): monkeypatch.[1]('MY_VAR', '123') import os assert os.getenv('MY_VAR') == '123'
Complete the code to check that the environment variable is changed inside the test.
def test_change_env(monkeypatch): monkeypatch.setenv('PATH', '/tmp') import os assert os.getenv('PATH') == [1]
Fix the error in the code to correctly set the environment variable using monkeypatch.
def test_fix_env(monkeypatch): monkeypatch.[1]('DEBUG', 'True') import os assert os.getenv('DEBUG') == 'True'
Fill both blanks to set and then delete an environment variable using monkeypatch.
def test_set_and_delete(monkeypatch): monkeypatch.[1]('TEMP_VAR', 'value') monkeypatch.[2]('TEMP_VAR', raising=False) import os assert os.getenv('TEMP_VAR') is None
Fill all three blanks to set an environment variable, check its value, and then delete it using monkeypatch.
def test_full_env(monkeypatch): monkeypatch.[1]('API_KEY', 'abc123') import os assert os.getenv([2]) == 'abc123' monkeypatch.[3]('API_KEY', raising=False) assert os.getenv('API_KEY') is None
