diff --git a/Jenkinsfile b/Jenkinsfile index 28f2648..1f3c46c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,7 +32,7 @@ pipeline { parallel{ stage('pytest') { steps { - sh '${POETRY_HOME}/bin/poetry run pytest tests --junitxml pytest.xml -o junit_family=xunit1 --cov pysuperconductor --cov-report=xml:coverage.xml' + sh '${POETRY_HOME}/bin/poetry run pytest' } } stage('lint') { diff --git a/do.sh b/do.sh index bfd0c5c..b25e893 100644 --- a/do.sh +++ b/do.sh @@ -12,7 +12,7 @@ build() { test() { echo "I am ${FUNCNAME[0]}ing" poetry run flake8 - poetry run pytest tests --cov pysuperconductor + poetry run pytest } all() { diff --git a/pyproject.toml b/pyproject.toml index 633d34b..f8bc694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,3 +17,8 @@ pytest-cov = "^2.10.1" [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api" + +[tool.pytest.ini_options] +junit_family = "xunit1" +testpaths = ["tests"] +addopts = "--junitxml pytest.xml --cov pysuperconductor --cov-report=xml:coverage.xml --cov-fail-under=90" diff --git a/pysuperconductor/__init__.py b/pysuperconductor/__init__.py index 15802b7..7fdaee1 100644 --- a/pysuperconductor/__init__.py +++ b/pysuperconductor/__init__.py @@ -1,5 +1,9 @@ +import logging from pysuperconductor.meta import __version__ def get_version(): return __version__ + + +logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/pysuperconductor/os_gap_calc.py b/pysuperconductor/os_gap_calc.py index db47a94..f3cc9b8 100644 --- a/pysuperconductor/os_gap_calc.py +++ b/pysuperconductor/os_gap_calc.py @@ -1,6 +1,7 @@ import numpy import scipy.integrate as integrate import scipy.optimize +import logging def energy(freq, delta): @@ -28,5 +29,5 @@ def equilibrium_gap(temp, debye_frequency, nv): lambda d: gap_integral(temp, d, 0, debye_frequency) - nv_inv, x0=debye_frequency / (numpy.sinh(nv_inv)) ) - print(sol) + logging.info(sol) return sol.x