From 75ad14aaa234be8ef34ed1ca38253229053fdc8e Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Wed, 25 Dec 2019 00:43:33 -0600 Subject: [PATCH] :nail_care: black --- dvc/api.py | 6 +++--- tests/func/test_api.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dvc/api.py b/dvc/api.py index 17b1231d4..7bde1b0be 100644 --- a/dvc/api.py +++ b/dvc/api.py @@ -32,7 +32,7 @@ SUMMON_SCHEMA = Schema( }, } ] - }, + } ) @@ -106,7 +106,7 @@ def summon(name, repo=None, rev=None, summon_file="dvcsummon.yaml", args=None): except SummonError as exc: raise SummonError( str(exc) + " at '{}' in '{}'".format(summon_file, repo), - cause=exc.cause + cause=exc.cause, ) _pull_dependencies(_repo, info.get("deps")) @@ -132,7 +132,7 @@ def _get_object_from_summon_file(name, path): elif len(objects) >= 2: raise SummonError( "More than one object with name '{}'".format(name) - ) + ) return objects[0] diff --git a/tests/func/test_api.py b/tests/func/test_api.py index 1d22be44a..bff3abe51 100644 --- a/tests/func/test_api.py +++ b/tests/func/test_api.py @@ -137,7 +137,7 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch): "objects": [ { "name": "sum", - "meta": { "description": "Add to " }, + "meta": {"description": "Add to "}, "summon": { "type": "python", "call": "calculator.add_to_num", @@ -151,7 +151,7 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch): different_objects = copy.deepcopy(objects) different_objects["objects"][0]["summon"]["args"]["x"] = 100 - dup_objects= copy.deepcopy(objects) + dup_objects = copy.deepcopy(objects) dup_objects["objects"] *= 2 dvcsummon_yaml = ruamel.yaml.dump(objects) @@ -179,7 +179,9 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch): assert api.summon("sum", repo=repo_url) == 101 assert api.summon("sum", repo=repo_url, args={"x": 2}) == 102 - assert api.summon("sum", repo=repo_url, summon_file="different.yaml") == 200 + assert ( + api.summon("sum", repo=repo_url, summon_file="different.yaml") == 200 + ) try: api.summon("sum", repo=repo_url, summon_file="missing.yaml") @@ -193,7 +195,9 @@ def test_summon(tmp_dir, erepo_dir, dvc, monkeypatch): with pytest.raises(SummonError, match=r"No object with name 'missing'"): api.summon("missing", repo=repo_url) - with pytest.raises(SummonError, match=r"More than one object with name 'sum'"): + with pytest.raises( + SummonError, match=r"More than one object with name 'sum'" + ): api.summon("sum", repo=repo_url, summon_file="dup.yaml") with pytest.raises(SummonError, match=r"extra keys not allowed"):