summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-27 18:44:24 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-27 19:00:44 +0900
commitb52ad07c9990b88560bb968cff217f4285a7a622 (patch)
tree6508c2309771e65f34cc5d601e3c729191c4c811
parent0c7bd18dc387b4d3d140b18a42e0662253dffbea (diff)
downloadbuildstream-b52ad07c9990b88560bb968cff217f4285a7a622.tar.gz
Integration tests: Removing some dead code
o Removing format_files() helper in testutils o Removing imports of format_files() o Removing imports of walk_dir() where it's not used o Removing `element_path` variables that are unused
-rw-r--r--tests/integration/autotools.py4
-rw-r--r--tests/integration/cmake.py4
-rw-r--r--tests/integration/compose.py2
-rw-r--r--tests/integration/import.py2
-rw-r--r--tests/integration/manual.py1
-rw-r--r--tests/integration/script.py2
-rw-r--r--tests/integration/stack.py2
-rw-r--r--tests/testutils/integration.py16
8 files changed, 4 insertions, 29 deletions
diff --git a/tests/integration/autotools.py b/tests/integration/autotools.py
index a955df1c2..0c9ac6cd8 100644
--- a/tests/integration/autotools.py
+++ b/tests/integration/autotools.py
@@ -2,7 +2,7 @@ import os
import pytest
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, assert_contains
+from tests.testutils.integration import assert_contains
pytestmark = pytest.mark.integration
@@ -21,7 +21,6 @@ DATA_DIR = os.path.join(
def test_autotools_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
- element_path = os.path.join(project, 'elements')
element_name = 'autotools/amhello.bst'
result = cli.run(project=project, args=['build', element_name])
@@ -41,7 +40,6 @@ def test_autotools_build(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_autotools_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
- element_path = os.path.join(project, 'elements')
element_name = 'autotools/amhello.bst'
result = cli.run(project=project, args=['build', element_name])
diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py
index c03ccf586..8f017e707 100644
--- a/tests/integration/cmake.py
+++ b/tests/integration/cmake.py
@@ -2,7 +2,7 @@ import os
import pytest
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, assert_contains
+from tests.testutils.integration import assert_contains
pytestmark = pytest.mark.integration
@@ -18,7 +18,6 @@ DATA_DIR = os.path.join(
def test_cmake_build(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
- element_path = os.path.join(project, 'elements')
element_name = 'cmake/cmakehello.bst'
result = cli.run(project=project, args=['build', element_name])
@@ -34,7 +33,6 @@ def test_cmake_build(cli, tmpdir, datafiles):
@pytest.mark.datafiles(DATA_DIR)
def test_cmake_run(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
- element_path = os.path.join(project, 'elements')
element_name = 'cmake/cmakehello.bst'
result = cli.run(project=project, args=['build', element_name])
diff --git a/tests/integration/compose.py b/tests/integration/compose.py
index 079c3844f..00c80d58b 100644
--- a/tests/integration/compose.py
+++ b/tests/integration/compose.py
@@ -6,7 +6,7 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, walk_dir
+from tests.testutils.integration import walk_dir
pytestmark = pytest.mark.integration
diff --git a/tests/integration/import.py b/tests/integration/import.py
index ea08ff0c2..6925a0a47 100644
--- a/tests/integration/import.py
+++ b/tests/integration/import.py
@@ -4,7 +4,7 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, walk_dir
+from tests.testutils.integration import walk_dir
pytestmark = pytest.mark.integration
diff --git a/tests/integration/manual.py b/tests/integration/manual.py
index 914c90dd4..e71ccdd79 100644
--- a/tests/integration/manual.py
+++ b/tests/integration/manual.py
@@ -4,7 +4,6 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, walk_dir
pytestmark = pytest.mark.integration
diff --git a/tests/integration/script.py b/tests/integration/script.py
index af5ff67a8..5ecc51973 100644
--- a/tests/integration/script.py
+++ b/tests/integration/script.py
@@ -4,7 +4,6 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, walk_dir
pytestmark = pytest.mark.integration
@@ -144,7 +143,6 @@ def test_script_cwd(cli, tmpdir, datafiles):
def test_script_layout(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
- element_path = os.path.join(project, 'elements')
element_name = 'script/script-layout.bst'
res = cli.run(project=project, args=['build', element_name])
diff --git a/tests/integration/stack.py b/tests/integration/stack.py
index a049b4892..9444fbbad 100644
--- a/tests/integration/stack.py
+++ b/tests/integration/stack.py
@@ -4,7 +4,6 @@ import pytest
from buildstream import _yaml
from tests.testutils import cli_integration as cli
-from tests.testutils.integration import format_files, walk_dir
pytestmark = pytest.mark.integration
@@ -20,7 +19,6 @@ DATA_DIR = os.path.join(
def test_stack(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
checkout = os.path.join(cli.directory, 'checkout')
- element_path = os.path.join(project, 'elements')
element_name = 'stack/stack.bst'
res = cli.run(project=project, args=['build', element_name])
diff --git a/tests/testutils/integration.py b/tests/testutils/integration.py
index a8c54e574..a6fa92871 100644
--- a/tests/testutils/integration.py
+++ b/tests/testutils/integration.py
@@ -3,22 +3,6 @@ import os
from buildstream import _yaml
-# Recursively call .format() on all files in the given directory.
-#
-# This modifies the original files.
-#
-def format_files(directory, *args, **kwargs):
- for dirname, _, filenames in os.walk(directory):
- for filename in filenames:
- with open(os.path.join(dirname, filename), 'r') as f:
- template = f.read()
-
- element = template.format(*args, **kwargs)
-
- with open(os.path.join(dirname, filename), 'w') as f:
- f.write(element)
-
-
# Return a list of files relative to the given directory
def walk_dir(root):
for dirname, dirnames, filenames in os.walk(root):