[diffoscope] 01/01: Add a test for @tool_required raising RequiredToolNotFound.

Chris Lamb chris at chris-lamb.co.uk
Tue Mar 28 21:40:31 CEST 2017


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch experimental
in repository diffoscope.

commit 01b3b2d221cc2bbf0cbf782e68ef3072e3a9de18
Author: Chris Lamb <lamby at debian.org>
Date:   Tue Mar 28 20:37:29 2017 +0100

    Add a test for @tool_required raising RequiredToolNotFound.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/test_tools.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/test_tools.py b/tests/test_tools.py
index cf5320e..6210ee0 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -17,6 +17,8 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
+import pytest
+
 
 def test_sbin_added_to_path():
     from diffoscope.tools import tool_required
@@ -26,3 +28,15 @@ def test_sbin_added_to_path():
         pass
 
     fn()
+
+
+def test_required_tool_not_found():
+    from diffoscope.exc import RequiredToolNotFound
+    from diffoscope.tools import tool_required
+
+    @tool_required('does-not-exist')
+    def fn():
+        pass
+
+    with pytest.raises(RequiredToolNotFound):
+        fn()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list