Skip to content

Commit

Permalink
test that we cant yet run a command at a given cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
cblegare committed Dec 9, 2021
1 parent 0cb0021 commit ed99118
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import sys
import time
from textwrap import dedent
from tempfile import TemporaryDirectory
from unittest import mock

import pytest
Expand Down Expand Up @@ -130,6 +131,15 @@ def test_run_env_systemroot():
assert systemroot in result


def test_run_cwd_getcwd():
with TemporaryDirectory() as temp_cwd:
result = nox.command.run(
[PYTHON, "-c", 'import os;print(os.getcwd())'], silent=True, cwd=temp_cwd
)

assert temp_cwd in result


def test_run_not_found():
with pytest.raises(nox.command.CommandFailed):
nox.command.run(["nonexistentcmd"])
Expand Down

0 comments on commit ed99118

Please sign in to comment.