From 9f6bea4bf784a32f2f8d021d1160a21b51cc1fe6 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Fri, 31 Jul 2020 12:43:23 +0100 Subject: [PATCH 1/3] Pin pytest to v6 and make work --- Pipfile | 4 ++-- tests/unit_tests/conftest.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 2b6db107..52f7d060 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..49571e74 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) class UnityTestSource(pytest.File): @@ -38,7 +38,7 @@ def collect(self): 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): From 88e95afed55c9af27fbe2640fe659ddf758c7c13 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Fri, 31 Jul 2020 12:47:41 +0100 Subject: [PATCH 2/3] Few typos --- tests/unit_tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py index 49571e74..5c69582f 100644 --- a/tests/unit_tests/conftest.py +++ b/tests/unit_tests/conftest.py @@ -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.from_parent(parent, fspath) + return UnityTestSource.from_parent(parent, fspath=path) class UnityTestSource(pytest.File): @@ -32,7 +32,7 @@ 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') From 133f66b72bf6920399fef5c4a9d646dc39cf9dbc Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 3 Aug 2020 11:30:10 +0100 Subject: [PATCH 3/3] Hard pin pytest including patch releases --- Pipfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index 52f7d060..931d4ad5 100644 --- a/Pipfile +++ b/Pipfile @@ -7,5 +7,5 @@ verify_ssl = true flake8 = "*" [packages] -pytest = "~=6.0.0" -pytest-xdist = "~=1.34.0" +pytest = "==6.0.0" +pytest-xdist = "==1.34.0"