diff --git a/Pipfile b/Pipfile index 2b6db107..931d4ad5 100644 --- a/Pipfile +++ b/Pipfile @@ -7,5 +7,5 @@ verify_ssl = true flake8 = "*" [packages] -pytest = "*" -pytest-xdist = "*" +pytest = "==6.0.0" +pytest-xdist = "==1.34.0" diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py index f2e1240d..5c69582f 100644 --- a/tests/unit_tests/conftest.py +++ b/tests/unit_tests/conftest.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2019, XMOS Ltd, All rights reserved +# Copyright (c) 2018-2020, XMOS Ltd, All rights reserved import os.path import pytest import subprocess @@ -10,7 +10,7 @@ def pytest_collect_file(parent, path): if ((path.ext == ".c" or path.ext == ".xc") and (path.basename.startswith("test_") and "_Runner" not in path.basename)): - return UnityTestSource(path, parent) + return UnityTestSource.from_parent(parent, fspath=path) class UnityTestSource(pytest.File): @@ -32,13 +32,13 @@ def collect(self): test_src_name + '_single_issue.xe') test_bin_path_si = os.path.join('bin', test_bin_name_si) - yield UnityTestExecutable(test_bin_path_si, self) + yield UnityTestExecutable.from_parent(self, name=test_bin_path_si) test_bin_name_di = os.path.join( test_src_name + '_dual_issue.xe') test_bin_path_di = os.path.join('bin', test_bin_name_di) - yield UnityTestExecutable(test_bin_path_di, self) + yield UnityTestExecutable.from_parent(self, name=test_bin_path_di) class UnityTestExecutable(pytest.Item):