Skip to content

Commit

Permalink
refactor(wrap_stdout): remove unused lines
Browse files Browse the repository at this point in the history
  • Loading branch information
saygox committed Dec 8, 2021
1 parent a70f23b commit 14f4182
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions commitizen/wrap_stdio/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
if sys.platform == "linux": # pragma: no cover
import os

# from io import IOBase

class WrapStdinLinux:
def __init__(self):
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
Expand Down
4 changes: 0 additions & 4 deletions commitizen/wrap_stdio/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def __getattr__(self, key):
return "UTF-8"
return getattr(self.tty, key)

def __del__(self):
self.tty.close()

# backup_event_loop = None
backup_event_loop_policy = None
backup_stdin = None
backup_stdout = None
Expand Down
7 changes: 0 additions & 7 deletions tests/wrap_stdio/test_wrap_stdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

from commitizen import wrap_stdio

# def test_warp_stdio_exists():
# assert hasattr(wrap_stdio_windows, "sys")
# assert hasattr(wrap_stdio_linux, "sys")
# assert hasattr(wrap_stdio_unix, "sys")


if sys.platform == "win32": # pragma: no cover
pass
elif sys.platform == "linux":
Expand Down Expand Up @@ -56,7 +50,6 @@ def test_wrap_stdout_linux(mocker):
readerwriter_mock().write.assert_called_with("stderr")

wrap_stdio.unwrap_stdio()

assert sys.stdout == tmp_stdout
assert sys.stderr == tmp_stderr

Expand Down

0 comments on commit 14f4182

Please sign in to comment.