Skip to content

Commit 2a93a44

Browse files
Copilotbittner
andcommitted
Add return self to __enter__ and clean up test code
Co-authored-by: bittner <[email protected]>
1 parent 7ae6e13 commit 2a93a44

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

cli_test_helpers/decorators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __enter__(self):
3636
sys.argv = self.args
3737
self._old_handlers = logging.root.handlers[:]
3838
logging.root.handlers.clear()
39+
return self
3940

4041
def __exit__(self, exc_type, exc_val, exc_tb):
4142
sys.argv = self._old

tests/test_decorators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def test_argv_context_logging_isolation():
5757
logging.basicConfig(
5858
filename=str(logfile),
5959
level=logging.INFO,
60-
force=False, # Should work without force since handlers are cleared
6160
)
6261

6362
# Log a message

0 commit comments

Comments
 (0)