[python-periodictable] 05/09: Enable build-time tests with py.test

Stuart Prescott stuart at debian.org
Sun Nov 5 04:19:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

stuart pushed a commit to branch master
in repository python-periodictable.

commit 5273b6932d595fd8c39f93efedc78ad04533b20a
Author: Stuart Prescott <stuart at debian.org>
Date:   Sun Nov 5 14:52:34 2017 +1100

    Enable build-time tests with py.test
---
 debian/control              | 2 ++
 debian/patches/pytest.patch | 8 ++++++++
 debian/patches/series       | 1 +
 debian/rules                | 5 +++++
 4 files changed, 16 insertions(+)

diff --git a/debian/control b/debian/control
index c2ee5a0..065b632 100644
--- a/debian/control
+++ b/debian/control
@@ -14,10 +14,12 @@ Build-Depends:
  python-matplotlib,
  python-setuptools,
  python-sphinx,
+ python-pytest,
  python3-all,
  python3-matplotlib,
  python3-setuptools,
  python3-sphinx,
+ python3-pytest,
  texinfo
 Standards-Version: 4.1.1
 Homepage: http://www.reflectometry.org/danse/elements.html
diff --git a/debian/patches/pytest.patch b/debian/patches/pytest.patch
new file mode 100644
index 0000000..35852c1
--- /dev/null
+++ b/debian/patches/pytest.patch
@@ -0,0 +1,8 @@
+Description: Add pytest.ini file to configure tests
+Author: Stuart Prescott <stuart at debian.org>
+--- /dev/null
++++ b/pytest.ini
+@@ -0,0 +1,3 @@
++[pytest]
++testpaths = periodictable test doc
++addopts = --doctest-modules --doctest-glob='*.rst'
diff --git a/debian/patches/series b/debian/patches/series
index f436b68..098902c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+pytest.patch
 sphinx-local-mathjax.patch
diff --git a/debian/rules b/debian/rules
index e246995..52514d6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,11 @@
 
 export PYBUILD_NAME=periodictable
 
+export PYBUILD_TEST_ARGS=test doc periodictable
+export PYBUILD_BEFORE_TEST=cp -r {dir}/test {dir}/doc {build_dir}
+export PYBUILD_AFTER_TEST=rm -rf {build_dir}/test {build_dir}/doc
+export MPLBACKEND=Agg
+
 %:
 	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-periodictable.git



More information about the debian-science-commits mailing list