Skip to content

Commit

Permalink
Use tmpdir for all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgate committed Aug 18, 2021
1 parent 8166bdf commit ae1c49e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_ShellLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
from src.shelllogger import ShellLogger, ShellLoggerDecoder


@pytest.fixture(autouse=True)
def use_tmpdir(monkeypatch, tmpdir):
"""
**@pytest.fixture(autouse=True)**
Automatically use a temporary directory as the current working
directory for all tests.
"""
monkeypatch.chdir(tmpdir)


@pytest.fixture()
def shell_logger() -> ShellLogger:
"""
Expand Down Expand Up @@ -736,7 +747,6 @@ def test_html_print(capsys):
assert "orange zebra" in html_text


@pytest.mark.skip(reason="Broken")
def test_append_mode():
logger1 = ShellLogger(stack()[0][3] + "_1", Path.cwd())
logger1.log("Print HELLO to stdout", "echo HELLO")
Expand Down

0 comments on commit ae1c49e

Please sign in to comment.