aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/conftest.py
diff options
context:
space:
mode:
authorMatthew Bentham <Matthew.Bentham@arm.com>2019-12-02 12:59:43 +0000
committerMatthew Bentham <Matthew.Bentham@arm.com>2019-12-02 16:23:45 +0000
commit245d64c60d0ea30f5080ff53225b5169927e24d6 (patch)
treed623e46d7d5ddb34ef3bb84c45df3ada9209ce82 /python/pyarmnn/conftest.py
parent88d5f9f1615fa956464b8932b574d85c37cec937 (diff)
downloadarmnn-245d64c60d0ea30f5080ff53225b5169927e24d6.tar.gz
Work in progress of python bindings for Arm NNexperimental/pyarmnn
Not built or tested in any way Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com> Change-Id: Ie7f92b529aa5087130f0c5cc8c17db1581373236
Diffstat (limited to 'python/pyarmnn/conftest.py')
-rw-r--r--python/pyarmnn/conftest.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/python/pyarmnn/conftest.py b/python/pyarmnn/conftest.py
new file mode 100644
index 0000000000..0eea35c7e0
--- /dev/null
+++ b/python/pyarmnn/conftest.py
@@ -0,0 +1,47 @@
+# Copyright © 2019 Arm Ltd. All rights reserved.
+# SPDX-License-Identifier: MIT
+import os
+
+import pytest
+
+
+@pytest.fixture(scope="module")
+def data_folder_per_test(request):
+ """
+ This fixture returns path to folder with test resources (one per test module)
+ """
+
+ basedir, script = request.fspath.dirname, request.fspath.basename
+ return str(os.path.join(basedir, "testdata", os.path.splitext(script)[0]))
+
+
+@pytest.fixture(scope="module")
+def shared_data_folder(request):
+ """
+ This fixture returns path to folder with shared test resources among all tests
+ """
+
+ return str(os.path.join(request.fspath.dirname, "testdata", "shared"))
+
+
+@pytest.fixture(scope="function")
+def tmpdir(tmpdir):
+ """
+ This fixture returns path to temp folder. Fixture was added for py35 compatibility
+ """
+
+ return str(tmpdir)
+
+
+def pytest_addoption(parser):
+ parser.addoption('--juno', action='store_true', dest="juno",
+ default=False, help="enable juno fpga related tests")
+
+
+def pytest_configure(config):
+ config.addinivalue_line(
+ "markers", "juno: mark test to run only on juno"
+ )
+
+ if not config.option.juno:
+ setattr(config.option, 'markexpr', 'not juno')