Skip to content

Commit

Permalink
Use autouse fixture to set env vars required for EPICS to use lo inte…
Browse files Browse the repository at this point in the history
…rface (#283)
  • Loading branch information
jwlodek authored May 3, 2024
1 parent 4ee3f29 commit f6f9cc0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ def pytest_internalerror(excinfo):
raise excinfo.value


# Autouse fixture that will set all EPICS networking env vars to use lo interface
# to avoid false failures caused by things like firewalls blocking EPICS traffic.
@pytest.fixture(scope="session", autouse=True)
def configure_epics_environment():
os.environ["EPICS_CAS_INTF_ADDR_LIST"] = "127.0.0.1"
os.environ["EPICS_CAS_BEACON_ADDR_LIST"] = "127.0.0.1"
os.environ["EPICS_CA_ADDR_LIST"] = "127.0.0.1"
os.environ["EPICS_CAS_AUTO_ADDR_LIST"] = "NO"
os.environ["EPICS_CA_AUTO_BEACON_ADDR_LIST"] = "NO"

os.environ["EPICS_PVAS_INTF_ADDR_LIST"] = "127.0.0.1"
os.environ["EPICS_PVAS_BEACON_ADDR_LIST"] = "127.0.0.1"
os.environ["EPICS_PVA_ADDR_LIST"] = "127.0.0.1"
os.environ["EPICS_PVAS_AUTO_BEACON_ADDR_LIST"] = "NO"
os.environ["EPICS_PVA_AUTO_ADDR_LIST"] = "NO"


@pytest.fixture(scope="function")
def RE(request):
loop = asyncio.new_event_loop()
Expand Down

0 comments on commit f6f9cc0

Please sign in to comment.