Skip to content

Commit

Permalink
Make it work with development version string of the Big Graphviz (#110)
Browse files Browse the repository at this point in the history
* 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 <steve@arca.leo>
  • Loading branch information
egberts and steve authored Oct 7, 2020
1 parent 3651713 commit 8a4401d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion graphviz/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
1 change: 1 addition & 0 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a4401d

Please sign in to comment.