For this, I find that pytest's monkeypatch fixture leads to better code when you need to set environment variables:
def test_conn(monkeypatch):
monkeypatch.setenv('DATABASE_URL', '')
with patch(app.mysql.connector) as mock_mysql:
conn()
mock_mysql.connect.assert_called_with()