Skip to content

Commit

Permalink
now suby is an attribute of suby
Browse files Browse the repository at this point in the history
pomponchik committed Jul 23, 2024
1 parent 57bf53f commit 97901d6
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions suby/proxy_module.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
from subprocess import Popen, PIPE
from typing import List, Tuple, Callable, Union, Optional, Any
from pathlib import Path
from types import ModuleType

from emptylog import EmptyLogger, LoggerProtocol
from cantok import AbstractToken, TimeoutToken, DefaultToken, CancellationError
@@ -129,3 +130,7 @@ def fill_result(stdout_buffer: List[str], stderr_buffer: List[str], returncode:
result.stdout = ''.join(stdout_buffer)
result.stderr = ''.join(stderr_buffer)
result.returncode = returncode

@property
def suby(self) -> ModuleType:
return self
4 changes: 4 additions & 0 deletions tests/test_proxy_module.py
Original file line number Diff line number Diff line change
@@ -331,3 +331,7 @@ def test_use_path_object_as_first_positional_argument():
assert result.stdout == 'kek\n'
assert result.stderr == ''
assert result.returncode == 0


def test_suby_as_attribute_of_suby():
assert suby.suby is suby

0 comments on commit 97901d6

Please sign in to comment.