[Debian-astro-commits] [python-astropy] 01/01: Fix for newer pytest. Closes: #812648

Ole Streicher olebole at moszumanska.debian.org
Sun Feb 14 12:26:12 UTC 2016


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

olebole pushed a commit to branch debian
in repository python-astropy.

commit d5fc1fe30dd0140587247da956f7c306ff2c541b
Author: Ole Streicher <olebole at debian.org>
Date:   Sun Feb 14 13:25:55 2016 +0100

    Fix for newer pytest. Closes: #812648
---
 debian/changelog                        |  6 ++++++
 debian/patches/fix_for_pytest_2.8.patch | 37 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 3 files changed, 44 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index fb0f1ed..caf5284 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-astropy (1.1.1-3) UNRELEASED; urgency=medium
+
+  * Fix for newer pytest. Closes: #812648
+
+ -- Ole Streicher <olebole at debian.org>  Sun, 14 Feb 2016 13:24:29 +0100
+
 python-astropy (1.1.1-2) unstable; urgency=low
 
   * Fix dependency of python-astropy-utils on python-astropy
diff --git a/debian/patches/fix_for_pytest_2.8.patch b/debian/patches/fix_for_pytest_2.8.patch
new file mode 100644
index 0000000..0d62e9c
--- /dev/null
+++ b/debian/patches/fix_for_pytest_2.8.patch
@@ -0,0 +1,37 @@
+From e904df784b91fd45e7dfcdec0713c471bb03efff Mon Sep 17 00:00:00 2001
+From: Thomas Robitaille <thomas.robitaille at gmail.com>
+Date: Fri, 1 Jan 2016 19:36:39 +0000
+Bug: https://bugs.debian.org/812648
+Bug: https://github.com/astropy/astropy/pull/4349
+Subject: [PATCH] Fixes to pytest plugins for pytest >= 2.8.0
+--- a/astropy/tests/pytest_plugins.py
++++ b/astropy/tests/pytest_plugins.py
+@@ -161,7 +161,10 @@
+         # handling __doctest_skip__) doesn't happen.
+         def collect(self):
+             if self.fspath.basename == "conftest.py":
+-                module = self.config._conftest.importconftest(self.fspath)
++                try:
++                    module = self.config._conftest.importconftest(self.fspath)
++                except AttributeError:  # pytest >= 2.8.0
++                    module = self.config.pluginmanager._importconftest(self.fspath)
+             else:
+                 try:
+                     module = self.fspath.pyimport()
+@@ -191,8 +194,14 @@
+         def runtest(self):
+             # satisfy `FixtureRequest` constructor...
+             self.funcargs = {}
+-            self._fixtureinfo = doctest_plugin.FuncFixtureInfo((), [], {})
+-            fixture_request = doctest_plugin.FixtureRequest(self)
++            try:
++                self._fixtureinfo = doctest_plugin.FuncFixtureInfo((), [], {})
++                fixture_request = doctest_plugin.FixtureRequest(self)
++            except AttributeError:  # pytest >= 2.8.0
++                python_plugin = config.pluginmanager.getplugin('python')
++                self._fixtureinfo = python_plugin.FuncFixtureInfo((), [], {})
++                fixture_request = python_plugin.FixtureRequest(self)
++
+             failed, tot = doctest.testfile(
+                 str(self.fspath), module_relative=False,
+                 optionflags=opts, parser=DocTestParserPlus(),
diff --git a/debian/patches/series b/debian/patches/series
index cb43c51..ab1402e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 mark_known_failures.patch
 disable_helper.patch
 fix_astropy_wcs_py.patch
+fix_for_pytest_2.8.patch

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



More information about the Debian-astro-commits mailing list