Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2File conftest.py for auth testing contains pytest fixtures that are only in 

3box__default/auth module. Refer to https://docs.pytest.org/en/stable/fixture.html 

4for more details on pytest 

5""" 

6import pytest 

7 

8 

9@pytest.fixture 

10def email_config(request, flask_app): 

11 """ 

12 pytest fixture for temporally changing the email related configs 

13 To remove the config pass "remove" in @pytest.parameterize. For 

14 setting value to the config pass the actual value. See test_email.py 

15 for usage 

16 

17 Args: 

18 request (pytest obj): a built in by pytest object used to read 

19 incoming fixture arguments 

20 flask_app (flask app): flask app fixture 

21 

22 """ 

23 config_name, config_val = request.param 

24 old = flask_app.config[config_name] 

25 

26 if config_val == "remove": 

27 del flask_app.config[config_name] 

28 else: 

29 flask_app.config[config_name] = config_val 

30 print(f"\n{config_name}: {config_val}\n") 

31 

32 yield 

33 flask_app.config[config_name] = old