blob: 8eef1f873b8950c85cc5866a0b534f9112bce96b [file] [log] [blame]
Kshitij Sisodiaf9efe0d2022-09-30 16:42:50 +01001#
2# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
3# SPDX-License-Identifier: Apache-2.0
4#
5import os
6import pytest
7
8
9@pytest.fixture(scope="module")
10def data_folder_per_test(request):
11 """
12 This fixture returns path to folder with test resources (one per test module)
13 """
14
15 basedir, script = request.fspath.dirname, request.fspath.basename
16 return str(os.path.join(basedir, "testdata", os.path.splitext(script)[0]))
17
18
19@pytest.fixture(scope="module")
20def shared_data_folder(request):
21 """
22 This fixture returns path to folder with shared test resources among all tests
23 """
24
25 return str(os.path.join(request.fspath.dirname, "testdata", "shared"))
26
27
28@pytest.fixture(scope="function")
29def tmpdir(tmpdir):
30 """
31 This fixture returns path to temp folder. Fixture was added for py35 compatibility
32 """
33
34 return str(tmpdir)