From 54dee7ac38318af25521cdb1e4d228372f9f8603 Mon Sep 17 00:00:00 2001 From: Joseph Weston <joseph@weston.cloud> Date: Sun, 17 Feb 2019 14:00:29 +0100 Subject: [PATCH] skip qsymm tests if sympy and qsymm are not installed This is a partial application of the changeset proposed in https://gitlab.kwant-project.org/kwant/kwant/merge_requests/274/, which removes the need for a 'conftest.py', instead using 'pytest.importorskip'. We apply this change only to 'qsymm', as applying this change elsewhere requires rethinking where tests are put in the package structure of Kwant. This minimal change allows us to build packages for Conda and Debian, which is necessary for releasing Kwant 1.4. --- kwant/tests/test_qsymm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kwant/tests/test_qsymm.py b/kwant/tests/test_qsymm.py index 7f0d1825..7ad21aa6 100644 --- a/kwant/tests/test_qsymm.py +++ b/kwant/tests/test_qsymm.py @@ -9,9 +9,12 @@ from collections import OrderedDict import numpy as np -import sympy -import qsymm +from pytest import importorskip + +sympy = importorskip('sympy') + +qsymm = importorskip('qsymm') from qsymm.symmetry_finder import symmetries from qsymm.hamiltonian_generator import bloch_family, hamiltonian_from_family from qsymm.groups import (hexagonal, PointGroupElement, spin_matrices, -- GitLab