From 9d5529108a95bc43303e64285cc7fe4afa314926 Mon Sep 17 00:00:00 2001 From: Lawrence Mitchell Date: Thu, 16 Nov 2017 14:21:57 +0000 Subject: [PATCH] Strip address from ctx_factory.__str__ This way, pytest is able to collect tests in parallel. Otherwise, different test slaves think they have collected different tests because the address of the context differs. --- pyopencl/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyopencl/tools.py b/pyopencl/tools.py index d974980b..6a72ee97 100644 --- a/pyopencl/tools.py +++ b/pyopencl/tools.py @@ -242,7 +242,10 @@ def pytest_generate_tests_for_pyopencl(metafunc): return cl.Context([self.device]) def __str__(self): - return "" % self.device + # Don't show address, so that parallel test collection works + return ("" % + (self.device.name.strip(), + self.device.platform.name.strip())) test_plat_and_dev = get_test_platforms_and_devices() -- GitLab