# Coverage for tests/conftest.py : 100%

## 18 statements

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 import os

2 import shutil

3

4 import pytest

5 from app import create_app

6

7 from shopyo.api.file import tryrmtree

8

9# from shopyo.app import app as _app

10

11

12@pytest.fixture(scope="module")

13 def temp_app():

14 return create_app("testing")

15

16

17@pytest.fixture

18 def app(tmpdir, app_type, temp_app):

19 src = os.path.join(temp_app.instance_path, "config.py")

20 dest = tmpdir.join("temp_config.py")

21 dest.write("")

22 shutil.copy(src, dest)

23 tryrmtree(temp_app.instance_path)

24 dev_app = create_app(app_type)

25 yield dev_app

26 shutil.copy(dest, src)