Commit 240ee9b8 authored by Samuel GAIST's avatar Samuel GAIST

[test] Improve test prefix setup

parent 82c80ad6
Pipeline #17296 passed with stage
in 2 minutes and 10 seconds
......@@ -73,26 +73,25 @@ token = '4'
if sys.platform == 'darwin':
tmp_folder = tempfile.mkdtemp(prefix=__name__, suffix='.tmpdir', dir='/tmp')
prefix_folder = tempfile.mkdtemp(prefix=__name__,
suffix='.prefix',
dir='/tmp')
else:
tmp_folder = tempfile.mkdtemp(prefix=__name__, suffix='.tmpdir')
prefix_folder = tempfile.mkdtemp(prefix=__name__,
suffix='.prefix')
prefix = os.path.join(tmp_folder, 'prefix')
def rsync_to_tmp(path):
subprocess.check_call(['rsync', '-arz', path, tmp_folder])
prefix = os.path.join(prefix_folder, 'prefix')
def setup_package():
prefixes = [
pkg_resources.resource_filename('beat.backend.python.test', 'prefix'),
pkg_resources.resource_filename('beat.core.test', 'prefix')
]
prefixes = [
pkg_resources.resource_filename('beat.backend.python.test', 'prefix'),
pkg_resources.resource_filename('beat.core.test', 'prefix')
]
for path in prefixes:
rsync_to_tmp(path)
for path in prefixes:
subprocess.check_call(['rsync', '-arz', path, prefix_folder])
def teardown_package():
shutil.rmtree(tmp_folder)
shutil.rmtree(prefix_folder)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment