forked from openedx/openedx-tutor-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
41 lines (32 loc) · 1.02 KB
/
conftest.py
File metadata and controls
41 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""Common fixtures for integration tests."""
import pytest
import subprocess
from .helpers import PARAGON_NAME, PARAGON_IMAGE, MFE_SERVICE
@pytest.fixture(scope="package", autouse=True)
def setup_tutor_paragon_plugin():
"""
Fixture to set up the Tutor Paragon plugin for integration tests.
This fixture enables the Paragon plugin, builds the necessary Docker image,
and ensures that the plugin is disabled after the tests are complete.
"""
subprocess.run(
["tutor", "plugins", "enable", MFE_SERVICE, PARAGON_NAME],
check=True,
capture_output=True,
)
subprocess.run(
["tutor", "images", "build", PARAGON_IMAGE],
check=True,
capture_output=True,
)
subprocess.run(
["tutor", "config", "save", "--set", "LMS_HOST=local.openedx.io"],
check=True,
capture_output=True,
)
yield
subprocess.run(
["tutor", "plugins", "disable", PARAGON_NAME, MFE_SERVICE],
check=True,
capture_output=True,
)