From e4412977d8404a2a820c4c1c366604ab6cdc6427 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Fri, 21 Jun 2019 09:21:02 +0100 Subject: _yaml: Remove useless calls to '_yaml.node_sanitize' Calling '_yaml.dump' will itself call '_yaml.node_sanitize', therefore we can remove all calls to it in places where we directly after call dump. --- tests/sources/git.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/sources/git.py') diff --git a/tests/sources/git.py b/tests/sources/git.py index e01477c49..45a2b827a 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -786,7 +786,7 @@ def test_git_describe(cli, tmpdir, datafiles, ref_storage, tag_type): project_config = _yaml.load(os.path.join(project, 'project.conf')) _yaml.node_set(project_config, 'ref-storage', ref_storage) - _yaml.dump(_yaml.node_sanitize(project_config), os.path.join(project, 'project.conf')) + _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') os.makedirs(repofiles, exist_ok=True) @@ -900,7 +900,7 @@ def test_git_describe_head_is_tagged(cli, tmpdir, datafiles, ref_storage, tag_ty project_config = _yaml.load(os.path.join(project, 'project.conf')) _yaml.node_set(project_config, 'ref-storage', ref_storage) - _yaml.dump(_yaml.node_sanitize(project_config), os.path.join(project, 'project.conf')) + _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') os.makedirs(repofiles, exist_ok=True) @@ -1015,7 +1015,7 @@ def test_git_describe_relevant_history(cli, tmpdir, datafiles): project_config = _yaml.load(os.path.join(project, 'project.conf')) _yaml.node_set(project_config, 'ref-storage', 'project.refs') - _yaml.dump(_yaml.node_sanitize(project_config), os.path.join(project, 'project.conf')) + _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') os.makedirs(repofiles, exist_ok=True) @@ -1095,7 +1095,7 @@ def test_default_do_not_track_tags(cli, tmpdir, datafiles): project_config = _yaml.load(os.path.join(project, 'project.conf')) _yaml.node_set(project_config, 'ref-storage', 'inline') - _yaml.dump(_yaml.node_sanitize(project_config), os.path.join(project, 'project.conf')) + _yaml.dump(project_config, os.path.join(project, 'project.conf')) repofiles = os.path.join(str(tmpdir), 'repofiles') os.makedirs(repofiles, exist_ok=True) @@ -1162,7 +1162,7 @@ def test_overwrite_rogue_tag_multiple_remotes(cli, tmpdir, datafiles): } } ]) - _yaml.dump(_yaml.node_sanitize(project_config), os.path.join(project, 'project.conf')) + _yaml.dump(project_config, os.path.join(project, 'project.conf')) repo.add_annotated_tag('tag', 'tag') @@ -1208,7 +1208,7 @@ def test_overwrite_rogue_tag_multiple_remotes(cli, tmpdir, datafiles): repodir, reponame = os.path.split(repo.repo) - _yaml.dump(_yaml.node_sanitize(project_config), os.path.join(project, 'project.conf')) + _yaml.dump(project_config, os.path.join(project, 'project.conf')) config = repo.source_config(ref=new_ref) del config['track'] -- cgit v1.2.1