From 6021d8544e8808419d1b44f0cf850ce3ca3290f5 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Thu, 28 Nov 2019 18:31:37 +0000 Subject: element.py: Compute whether an element is cached only on `is_cached` This removes the early call to get whether sources are locally cached in `_update_source_state` by delegating it to the call of `is_cached`. Once it is cached, the element is assumed to stay that way for the duration of the pipeline, we can therefore cache the result once it is true. Also remove `Consistency.IS_CACHED`, which is not used anywhere else. --- tests/sources/git.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/sources/git.py b/tests/sources/git.py index d6f9cb223..25976ffca 100644 --- a/tests/sources/git.py +++ b/tests/sources/git.py @@ -499,7 +499,9 @@ def test_unlisted_submodule(cli, tmpdir, datafiles, fail): result.assert_main_error(ErrorDomain.PLUGIN, "git:unlisted-submodule") else: result.assert_success() - assert "git:unlisted-submodule" in result.stderr + # We have cached things internally and successfully. Therefore, the plugin + # is not involved in checking whether the cache is correct or not. + assert "git:unlisted-submodule" not in result.stderr @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") @@ -613,7 +615,9 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail): result.assert_main_error(ErrorDomain.PLUGIN, "git:invalid-submodule") else: result.assert_success() - assert "git:invalid-submodule" in result.stderr + # We have cached things internally and successfully. Therefore, the plugin + # is not involved in checking whether the cache is correct or not. + assert "git:invalid-submodule" not in result.stderr @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") -- cgit v1.2.1