summaryrefslogtreecommitdiff
path: root/tests/cachekey
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-20 11:06:42 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-21 14:57:31 +0000
commitf2b15d86debd32241228f7b728016ed0057cd0d2 (patch)
treee98e085e4f0a9020725aa3a25df7809a96d807ba /tests/cachekey
parentbc1b971e169f2fc721c61276c071640caee6a3f8 (diff)
downloadbuildstream-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/cachekey')
-rw-r--r--tests/cachekey/cachekey.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index 2bc60582a..bfeb89a8b 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -158,7 +158,7 @@ DATA_DIR = os.path.join(
@pytest.mark.skipif(HAVE_OSTREE is False, reason="ostree is not available")
@pytest.mark.datafiles(DATA_DIR)
def test_cache_key(datafiles, cli):
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
# Workaround bug in recent versions of setuptools: newer
# versions of setuptools fail to preserve symbolic links
@@ -228,7 +228,7 @@ def test_keys_stable_over_targets(cli, datafiles):
target1 = 'elements/key-stability/t1.bst'
target2 = 'elements/key-stability/t2.bst'
- project = os.path.join(datafiles.dirname, datafiles.basename)
+ project = str(datafiles)
full_graph_result = cli.run(project=project, args=[
'show',
'--format', '%{name}::%{full-key}',