Skip to content

Commit

Permalink
Remove Windows support
Browse files Browse the repository at this point in the history
Follow-on to #12.  These changes should have been included
in e034d0b, but were
accidentally omitted.
  • Loading branch information
jmgate committed Feb 2, 2022
1 parent aa564f2 commit 8a5e08f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/shelllogger/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ def auxiliary_command(
2. You don't tee the ``stdout`` or ``stderr``.
Todo:
* Rip out Windows support.
* Maybe combine this with :func:`run` with extra flags.
* Replace ``**kwargs`` with function arguments.
Expand Down
24 changes: 3 additions & 21 deletions tests/test_shell_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,6 @@ def test_timing() -> None:
command = "sleep 1"
if os.name == "posix":
command = "sleep 1"
elif os.name == "nt":
command = "timeout /nobreak /t 1"
else:
print(f"Warning: os.name is unrecognized: {os.name}; test may fail.")
result = logger._run(command)
Expand Down Expand Up @@ -530,12 +528,7 @@ def test_working_directory() -> None:
logger = ShellLogger(stack()[0][3], Path.cwd())
command = "pwd"
directory = "/tmp"
if os.name == "posix":
pass
elif os.name == "nt":
command = "cd"
directory = "C:\\Users"
else:
if os.name != "posix":
print(f"Warning: os.name is unrecognized: {os.name}; test may fail.")
result = logger._run(command, pwd=directory)
assert result.stdout.strip() == directory
Expand Down Expand Up @@ -720,13 +713,7 @@ def test_change_pwd() -> None:
pwd_command = "pwd"
directory1 = "/"
directory2 = "/tmp"
if os.name == "posix":
pass
elif os.name == "nt":
pwd_command = "cd"
directory1 = "C:\\"
directory2 = "C:\\Users"
else:
if os.name != "posix":
print(f"Warning: os.name is unrecognized: {os.name}; test may fail.")
logger._run(f"cd {directory1}")
result = logger._run(pwd_command)
Expand All @@ -745,12 +732,7 @@ def test_returncode() -> None:
logger = ShellLogger(stack()[0][3], Path.cwd())
command = "false"
expected_returncode = 1
if os.name == "posix":
pass
elif os.name == "nt":
command = "type nul | findstr NOPE"
expected_returncode = 1
else:
if os.name != "posix":
print(f"Warning: os.name is unrecognized: {os.name}; test may fail.")
result = logger._run(command)
assert result.returncode == expected_returncode
Expand Down

0 comments on commit 8a5e08f

Please sign in to comment.