From 8a4401d216366ea5c8bf48d5246a4d5d215e3314 Mon Sep 17 00:00:00 2001 From: Egbert <10352354+egberts@users.noreply.github.com> Date: Wed, 7 Oct 2020 03:19:34 -0400 Subject: [PATCH] Make it work with development version string of the Big Graphviz (#110) * Make it work with development version string of the Big Graphviz such as: $ dot -V dot - graphviz version 2.44.2~dev.20200927.0217 (20200927.0217) * Add development version of `dot` and its support there of. Co-authored-by: steve --- graphviz/backend.py | 2 +- tests/test_backend.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/graphviz/backend.py b/graphviz/backend.py index 8744388bbf..49f79154da 100644 --- a/graphviz/backend.py +++ b/graphviz/backend.py @@ -260,7 +260,7 @@ def version(): stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - ma = re.search(r'graphviz version (\d+\.\d+(?:\.\d+){,2}) ', out) + ma = re.search(r'graphviz version (\d+\.\d+(?:\.\d+){,2})', out) if ma is None: raise RuntimeError('cannot parse %r output: %r' % (cmd, out)) diff --git a/tests/test_backend.py b/tests/test_backend.py index 9f307f5c20..b2dfe44e9d 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -261,6 +261,7 @@ def test_version_parsefail_mocked(mocker, Popen): # noqa: N803 @pytest.mark.parametrize('stdout, expected', [ (b'dot - graphviz version 1.2.3 (mocked)', (1, 2, 3)), (b'dot - graphviz version 2.43.20190912.0211 (20190912.0211)\n', (2, 43, 20190912, 211)), + (b'dot - graphviz version 2.44.2~dev.20200927.0217 (20200927.0217)\n', (2, 44, 2)), ]) def test_version_mocked(mocker, Popen, stdout, expected): # noqa: N803 proc = Popen.return_value