From aab258e47cb480a6368b999b8415afff6e2e8a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Tue, 12 Mar 2024 09:33:40 +0100 Subject: [PATCH] v2.25.1 - added arguments to EmptyContextManager --- CHANGELOG.md | 15 ++------------- satella/__init__.py | 2 +- satella/coding/ctxt_managers.py | 5 +++++ tests/test_coding/test_debug.py | 2 +- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9110c8f..f58623ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,3 @@ -# v2.25.0 +# v2.25.1 -* added safe_listdir -* fixed a bug occurring in Python 3.10 with whereis -* DirectorySource will raise an exception if directory does not exist and on_fail is set to RAISE - -Build system -============ - -* Python 3.6 support dropped as it does not employ pyproject.toml, which is necessary - to build this -* fixed unit tests to run on Py3.12 -* removed Docker unit tests -* a unit test had some problems running under PyPy +* added parameters for EmptyContextManager diff --git a/satella/__init__.py b/satella/__init__.py index 87938494..6ec89075 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.25.0' +__version__ = '2.25.1' diff --git a/satella/coding/ctxt_managers.py b/satella/coding/ctxt_managers.py index 62bc2cbb..7dd1123b 100644 --- a/satella/coding/ctxt_managers.py +++ b/satella/coding/ctxt_managers.py @@ -9,8 +9,13 @@ class EmptyContextManager: >>> ctxt = EmptyContextManager() >>> with ctxt: >>> ... + + Note that it will accept any parameters, and then throw them on the ground. """ + def __init__(self, *args, **kwargs): + pass + def __enter__(self): return self diff --git a/tests/test_coding/test_debug.py b/tests/test_coding/test_debug.py index d9ce597e..d577137b 100644 --- a/tests/test_coding/test_debug.py +++ b/tests/test_coding/test_debug.py @@ -9,7 +9,7 @@ from satella.exceptions import PreconditionError class TestTypecheck(unittest.TestCase): def test_empty_ctxt_manager(self): - with EmptyContextManager() as p: + with EmptyContextManager(1, 2) as p: pass def test_except_exception(self): -- GitLab