diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-03-09 11:33:13 +0000 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-03-20 09:38:42 +0000 |
commit | 377a1cc949037507e64affcc9ba19916f55aa09d (patch) | |
tree | 6cb7b7d77202918f1676bd2d79df06e177350a9c /tests | |
parent | 010d10b611e5288ac9a105bce3efcfe85f01ba9f (diff) | |
download | buildstream-377a1cc949037507e64affcc9ba19916f55aa09d.tar.gz |
tests:lint: remove all len comparisons existence check
We should be using "assert not list" and not "assert len(list) == 0"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/cross_junction_workspace.py | 4 | ||||
-rw-r--r-- | tests/frontend/pull.py | 2 | ||||
-rw-r--r-- | tests/frontend/workspace.py | 4 | ||||
-rw-r--r-- | tests/internals/yaml.py | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/frontend/cross_junction_workspace.py b/tests/frontend/cross_junction_workspace.py index d3422b150..491399fe6 100644 --- a/tests/frontend/cross_junction_workspace.py +++ b/tests/frontend/cross_junction_workspace.py @@ -97,7 +97,7 @@ def test_close_cross_junction(cli, tmpdir): loaded = _yaml.load_data(result.output) assert isinstance(loaded.get('workspaces'), list) workspaces = loaded['workspaces'] - assert len(workspaces) == 0 + assert not workspaces def test_close_all_cross_junction(cli, tmpdir): @@ -116,7 +116,7 @@ def test_close_all_cross_junction(cli, tmpdir): loaded = _yaml.load_data(result.output) assert isinstance(loaded.get('workspaces'), list) workspaces = loaded['workspaces'] - assert len(workspaces) == 0 + assert not workspaces def test_subdir_command_cross_junction(cli, tmpdir): diff --git a/tests/frontend/pull.py b/tests/frontend/pull.py index b24cb22f3..dbc577641 100644 --- a/tests/frontend/pull.py +++ b/tests/frontend/pull.py @@ -387,7 +387,7 @@ def test_pull_missing_blob(cli, tmpdir, datafiles): result.assert_success() # Assert that no artifacts were pulled - assert len(result.get_pulled_elements()) == 0 + assert not result.get_pulled_elements() @pytest.mark.datafiles(DATA_DIR) diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 1a8119124..265545fc7 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -203,8 +203,8 @@ def test_open_multi(cli, tmpdir, datafiles): elif kind == 'bzr': assert '.bzr' in workspace_lsdir else: - assert not '.git' in workspace_lsdir - assert not '.bzr' in workspace_lsdir + assert '.git' not in workspace_lsdir + assert '.bzr' not in workspace_lsdir @pytest.mark.skipif(os.geteuid() == 0, reason="root may have CAP_DAC_OVERRIDE and ignore permissions") diff --git a/tests/internals/yaml.py b/tests/internals/yaml.py index 31e788872..218917667 100644 --- a/tests/internals/yaml.py +++ b/tests/internals/yaml.py @@ -245,7 +245,7 @@ def test_list_deletion(datafiles): _yaml.composite_dict(base, overlay) children = _yaml.node_get(base, list, 'children') - assert len(children) == 0 + assert not children # Tests for deep list composition |