Skip to content

Commit

Permalink
Do not run doctest with Python < 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
flozz committed Jun 24, 2020
1 parent 07600f7 commit 44a6d39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def test(session):
# Do not run doctest when using Python 2 as the output of some functions
# looks deferent from the one of Python 3 and so it cannot be matched
# properly...
if session.python == "2.7":
# Do not run doctest on Python < 3.7 because dict are not ordered so
# the result is not predictable...
if session.python in ["2.7", "3.5", "3.6"]:
session.run("pytest", "test", env={"RIVALCFG_DRY": "1"})
else:
session.run("pytest", "--doctest-modules", "rivalcfg", "test", env={
Expand Down
5 changes: 3 additions & 2 deletions rivalcfg/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ def parse_param_string(paramstr, value_parsers={}):
{'hello': {'name': 'world'}}
>>> parse_param_string("hello(name=world ) ;;")
{'hello': {'name': 'world'}}
>>> parse_param_string("foo(a=42)", value_parsers={
>>> parse_param_string("foo(a=42; b=3.14)", value_parsers={
... "foo": {
... "a": int,
... "b": float,
... },
... })
{'foo': {'a': 42}}
{'foo': {'a': 42, 'b': 3.14}}
>>> parse_param_string("foobar[a=1]")
Traceback (most recent call last):
...
Expand Down

0 comments on commit 44a6d39

Please sign in to comment.