-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear EMLE environment variables before each test.
- Loading branch information
Showing
4 changed files
with
27 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import pytest | ||
import shlex | ||
import subprocess | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def wrapper(): | ||
""" | ||
A wrapper function that clears the environment variables before each test | ||
and stops the EMLE server after each test. | ||
""" | ||
|
||
# Clear the environment. | ||
|
||
for env in os.environ: | ||
if env.startswith("EMLE_"): | ||
del os.environ[env] | ||
|
||
yield | ||
|
||
# Stop the EMLE server. | ||
process = subprocess.run( | ||
shlex.split("emle-stop"), | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters