diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-03-20 11:06:42 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-21 14:57:31 +0000 |
commit | f2b15d86debd32241228f7b728016ed0057cd0d2 (patch) | |
tree | e98e085e4f0a9020725aa3a25df7809a96d807ba /tests/integration/manual.py | |
parent | bc1b971e169f2fc721c61276c071640caee6a3f8 (diff) | |
download | buildstream-f2b15d86debd32241228f7b728016ed0057cd0d2.tar.gz |
tests: str(datafiles) instead of a longer thing
Replace some popular copypasta.
This important-looking invocation:
os.path.join(datafiles.dirname, datafiles.basename)
is equivalent to this shorter invocation:
project = str(datafiles)
It seems like it's very popular copypasta, replace it with the shorter
one thus:
# Use 'gsed' or 'sed' etc. as appropriate for your system.
git config --global alias.sub '!f() { git grep --name-only --null "$1" | gxargs --null gsed --in-place --expression "s/$1/$2/g" ; }; f'
git sub 'os.path.join(datafiles.dirname, datafiles.basename)' 'str(datafiles)'
Diffstat (limited to 'tests/integration/manual.py')
-rw-r--r-- | tests/integration/manual.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/integration/manual.py b/tests/integration/manual.py index 507434eaa..76ea1dc66 100644 --- a/tests/integration/manual.py +++ b/tests/integration/manual.py @@ -34,7 +34,7 @@ def create_manual_element(name, path, config, variables, environment): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element(cli, datafiles): - project = os.path.join(datafiles.dirname, datafiles.basename) + project = str(datafiles) checkout = os.path.join(cli.directory, 'checkout') element_path = os.path.join(project, 'elements') element_name = 'import/import.bst' @@ -68,7 +68,7 @@ strip @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element_environment(cli, datafiles): - project = os.path.join(datafiles.dirname, datafiles.basename) + project = str(datafiles) checkout = os.path.join(cli.directory, 'checkout') element_path = os.path.join(project, 'elements') element_name = 'import/import.bst' @@ -98,7 +98,7 @@ def test_manual_element_environment(cli, datafiles): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element_noparallel(cli, datafiles): - project = os.path.join(datafiles.dirname, datafiles.basename) + project = str(datafiles) checkout = os.path.join(cli.directory, 'checkout') element_path = os.path.join(project, 'elements') element_name = 'import/import.bst' @@ -133,7 +133,7 @@ def test_manual_element_noparallel(cli, datafiles): @pytest.mark.datafiles(DATA_DIR) @pytest.mark.skipif(not HAVE_SANDBOX, reason='Only available with a functioning sandbox') def test_manual_element_logging(cli, datafiles): - project = os.path.join(datafiles.dirname, datafiles.basename) + project = str(datafiles) element_path = os.path.join(project, 'elements') element_name = 'import/import.bst' |