Hello community, here is the log from the commit of package python-pytest-doctestplus for openSUSE:Factory checked in at 2020-05-19 14:47:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest-doctestplus (Old) and /work/SRC/openSUSE:Factory/.python-pytest-doctestplus.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-doctestplus" Tue May 19 14:47:30 2020 rev:7 rq:806847 version:0.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest-doctestplus/python-pytest-doctestplus.changes 2019-11-18 20:10:07.733600020 +0100 +++ /work/SRC/openSUSE:Factory/.python-pytest-doctestplus.new.2738/python-pytest-doctestplus.changes 2020-05-19 14:47:34.871954564 +0200 @@ -1,0 +2,9 @@ +Mon May 18 09:18:14 UTC 2020 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 0.6.1: + * Disabling the usage of the doctest_ignore_import_errors option + * Drop support for python versions earlier than 3.6. [#103] + * Drop support for pytest versions earlier than 4.0. [#103] + * Fix compatibility with pytest 5.4. [#103] + +------------------------------------------------------------------- Old: ---- pytest-doctestplus-0.5.0.tar.gz New: ---- pytest-doctestplus-0.6.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest-doctestplus.spec ++++++ --- /var/tmp/diff_new_pack.fwCQ6b/_old 2020-05-19 14:47:36.063957110 +0200 +++ /var/tmp/diff_new_pack.fwCQ6b/_new 2020-05-19 14:47:36.063957110 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pytest-doctestplus # -# Copyright (c) 2019 SUSE LLC. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,24 +24,24 @@ %define psuffix %{nil} %bcond_with test %endif +%define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytest-doctestplus%{psuffix} -Version: 0.5.0 +Version: 0.6.1 Release: 0 Summary: Pytest plugin with advanced doctest features License: BSD-3-Clause -Group: Development/Languages/Python URL: https://github.com/astropy/pytest-doctestplus Source: https://files.pythonhosted.org/packages/source/p/pytest-doctestplus/pytest-doctestplus-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-pytest >= 3.0 +Requires: python-pytest >= 4.0 Requires: python-six BuildArch: noarch %if %{with test} BuildRequires: %{python_module pip} -BuildRequires: %{python_module pytest >= 3.0} +BuildRequires: %{python_module pytest >= 4.0} BuildRequires: %{python_module pytest-doctestplus >= %{version}} BuildRequires: %{python_module six} %endif ++++++ pytest-doctestplus-0.5.0.tar.gz -> pytest-doctestplus-0.6.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/.travis.yml new/pytest-doctestplus-0.6.1/.travis.yml --- old/pytest-doctestplus-0.5.0/.travis.yml 2019-11-15 22:23:40.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/.travis.yml 2020-04-30 08:00:07.000000000 +0200 @@ -7,49 +7,39 @@ - linux - windows -stage: All tests - -# Use Travis' container-based architecture -sudo: false - env: global: # The following versions are the 'default' for tests, unless # overidden underneath. They are defined here in order to save having # to repeat them for all configurations. - - PYTHON_VERSION=3.6 - - PYTEST_VERSION=4 + - PYTHON_VERSION=3.8 - PYTEST_COMMAND='pytest' - - CONDA_DEPENDENCIES='six' + - PY_IGNORE_IMPORTMISMATCH=1 - matrix: - - PYTHON_VERSION=2.7 PYTEST_COMMAND='py.test' - - PYTHON_VERSION=3.5 NUMPY_VERSION=1.15 + jobs: - PYTHON_VERSION=3.6 - - PYTHON_VERSION=3.7 PYTEST_VERSION=3.8 - - PYTHON_VERSION=3.7 PYTEST_VERSION=3.9 + - PYTHON_VERSION=3.7 PYTEST_VERSION=4 + - PYTHON_VERSION=3.8 PYTEST_VERSION='<5.4' stages: - # only run 2 jobs initially + # only run 2 jobs initially. Using "test" as it cannot be adjusted for the root jobs above. - name: Initial tests - - name: All tests + - name: test -matrix: +jobs: include: - os: linux env: PYTHON_VERSION=3.7 NUMPY_VERSION=stable stage: Initial tests - - os: linux - env: PYTHON_VERSION=2.7 - stage: Initial tests - # Try a run on OSX with latest versions of python and pytest - os: osx + stage: test env: PYTHON_VERSION=3.7 - # Try a run against latest pytest - - env: PYTHON_VERSION=3.7 PYTEST_VERSION=5 + # Try a run against dev pytest + - stage: test + env: PYTHON_VERSION=3.8 PYTEST_VERSION=dev install: - git clone git://github.com/astropy/ci-helpers.git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/CHANGES.rst new/pytest-doctestplus-0.6.1/CHANGES.rst --- old/pytest-doctestplus-0.5.0/CHANGES.rst 2019-11-15 22:23:55.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/CHANGES.rst 2020-05-05 03:33:10.000000000 +0200 @@ -1,3 +1,20 @@ +0.6.1 (2020-05-04) +================== + +- Disabling the usage of the ``doctest_ignore_import_errors`` option to + ensure no behaviour changes compared to the 0.5.0 release. [#108] + + +0.6.0 (2020-04-30) +================== + +- Drop support for ``python`` versions earlier than 3.6. [#103] + +- Drop support for ``pytest`` versions earlier than 4.0. [#103] + +- Fix compatibility with ``pytest`` 5.4. [#103] + + 0.5.0 (2019-11-15) ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/PKG-INFO new/pytest-doctestplus-0.6.1/PKG-INFO --- old/pytest-doctestplus-0.5.0/PKG-INFO 2019-11-15 22:27:09.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/PKG-INFO 2020-05-05 03:38:15.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pytest-doctestplus -Version: 0.5.0 +Version: 0.6.1 Summary: Pytest plugin with advanced doctest features. Home-page: https://astropy.org Author: The Astropy Developers @@ -282,13 +282,11 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development :: Testing Classifier: Topic :: Utilities -Requires-Python: >=2.7 +Requires-Python: >=3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/pytest_doctestplus/__init__.py new/pytest-doctestplus-0.6.1/pytest_doctestplus/__init__.py --- old/pytest-doctestplus-0.5.0/pytest_doctestplus/__init__.py 2019-11-15 22:24:42.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/pytest_doctestplus/__init__.py 2020-05-05 03:32:50.000000000 +0200 @@ -3,4 +3,4 @@ This package contains pytest plugins that are used by the astropy test suite. """ -__version__ = '0.5.0' +__version__ = '0.6.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/pytest_doctestplus/output_checker.py new/pytest-doctestplus-0.6.1/pytest_doctestplus/output_checker.py --- old/pytest-doctestplus-0.5.0/pytest_doctestplus/output_checker.py 2019-11-15 22:23:40.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/pytest_doctestplus/output_checker.py 2020-04-30 08:00:07.000000000 +0200 @@ -8,8 +8,6 @@ import re import math -import six -from six.moves import zip # Much of this code, particularly the parts of floating point handling, is # borrowed from the SymPy project with permission. See @@ -20,7 +18,6 @@ FLOAT_CMP = doctest.register_optionflag('FLOAT_CMP') REMOTE_DATA = doctest.register_optionflag('REMOTE_DATA') IGNORE_OUTPUT = doctest.register_optionflag('IGNORE_OUTPUT') -IGNORE_OUTPUT_2 = doctest.register_optionflag('IGNORE_OUTPUT_2') IGNORE_OUTPUT_3 = doctest.register_optionflag('IGNORE_OUTPUT_3') IGNORE_WARNINGS = doctest.register_optionflag('IGNORE_WARNINGS') @@ -274,8 +271,7 @@ return True def check_output(self, want, got, flags): - if (flags & IGNORE_OUTPUT or (six.PY2 and flags & IGNORE_OUTPUT_2) or - (not six.PY2 and flags & IGNORE_OUTPUT_3)): + if ((flags & IGNORE_OUTPUT) or (flags & IGNORE_OUTPUT_3)): return True if flags & FIX: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/pytest_doctestplus/plugin.py new/pytest-doctestplus-0.6.1/pytest_doctestplus/plugin.py --- old/pytest-doctestplus-0.5.0/pytest_doctestplus/plugin.py 2019-11-15 22:23:40.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/pytest_doctestplus/plugin.py 2020-05-05 03:32:04.000000000 +0200 @@ -11,7 +11,6 @@ import warnings import pytest -import six from pytest_doctestplus.utils import ModuleChecker from .output_checker import FIX, IGNORE_WARNINGS, OutputChecker, REMOTE_DATA @@ -164,17 +163,17 @@ if self.fspath.basename == "setup.py": return elif self.fspath.basename == "conftest.py": - try: - module = self.config._conftest.importconftest(self.fspath) - except AttributeError: # pytest >= 2.8.0 - module = self.config.pluginmanager._importconftest(self.fspath) + module = self.config.pluginmanager._importconftest(self.fspath) else: try: module = self.fspath.pyimport() - # Just ignore searching modules that can't be imported when - # collecting doctests except ImportError: - return + pytest.skip("unable to import module %r" % self.fspath) + # NOT USED: While correct, this breaks existing behavior. + # if self.config.getvalue("doctest_ignore_import_errors"): + # pytest.skip("unable to import module %r" % self.fspath) + # else: + # raise options = get_optionflags(self) | FIX @@ -182,6 +181,7 @@ finder = DocTestFinderPlus() runner = doctest.DebugRunner( verbose=False, optionflags=options, checker=OutputChecker()) + for test in finder.find(module): if test.examples: # skip empty doctests if config.getoption('remote_data', 'none') != 'any': @@ -194,7 +194,7 @@ # wrapping the source in a context manager. if example.options.get(IGNORE_WARNINGS, False): example.source = ("with _doctestplus_ignore_all_warnings():\n" - + indent(example.source, ' ')) + + indent(example.source, ' ')) ignore_warnings_context_needed = True if example.options.get(REMOTE_DATA): @@ -205,40 +205,39 @@ if ignore_warnings_context_needed: test.examples.insert(0, doctest.Example(source=IGNORE_WARNINGS_CONTEXT, want='')) - yield doctest_plugin.DoctestItem( - test.name, self, runner, test) + try: + yield doctest_plugin.DoctestItem.from_parent( + self, name=test.name, runner=runner, dtest=test + ) + except AttributeError: + # pytest < 5.4 + yield doctest_plugin.DoctestItem( + test.name, self, runner, test) - class DocTestTextfilePlus(doctest_plugin.DoctestItem, pytest.Module): - # Some pytest plugins such as hypothesis try and access the 'obj' - # attribute, and by default this returns an error for this class - # so we override it here to avoid any issues. - def obj(self): - pass - - def runtest(self): - # satisfy `FixtureRequest` constructor... - self.funcargs = {} - fixture_request = doctest_plugin._setup_fixtures(self) + class DocTestTextfilePlus(pytest.Module): - options = get_optionflags(self) | FIX + def collect(self): + encoding = self.config.getini("doctest_encoding") + text = self.fspath.read_text(encoding) + filename = str(self.fspath) + name = self.fspath.basename + globs = {"__name__": "__main__"} - doctest.testfile( - str(self.fspath), module_relative=False, - optionflags=options, parser=DocTestParserPlus(), - extraglobs=dict(getfixture=fixture_request.getfixturevalue), - raise_on_error=True, verbose=False, encoding='utf-8') - - def reportinfo(self): - """ - Overwrite pytest's ``DoctestItem`` because - ``DocTestTextfilePlus`` does not have a ``dtest`` attribute - which is used by pytest>=3.2.0 to return the location of the - tests. - - For details see `pytest-dev/pytest#2651 - <https://github.com/pytest-dev/pytest/pull/2651>`_. - """ - return self.fspath, None, "[doctest] %s" % self.name + optionflags = get_optionflags(self) | FIX + + runner = doctest.DebugRunner( + verbose=False, optionflags=optionflags, checker=OutputChecker()) + + parser = DocTestParserPlus() + test = parser.get_doctest(text, globs, name, filename, 0) + if test.examples: + try: + yield doctest_plugin.DoctestItem.from_parent( + self, name=test.name, runner=runner, dtest=test + ) + except AttributeError: + # pytest < 5.4 + yield doctest_plugin.DoctestItem(test.name, self, runner, test) class DocTestParserPlus(doctest.DocTestParser): """ @@ -272,7 +271,7 @@ if ext not in comment_characters: warnings.warn("file format '{}' is not recognized, assuming " "'{}' as the comment character." - .format(ext, comment_characters['rst'])) + .format(ext, comment_characters['.rst'])) ext = '.rst' comment_char = comment_characters[ext] @@ -280,7 +279,7 @@ for entry in result: - if isinstance(entry, six.string_types) and entry: + if isinstance(entry, str) and entry: required = [] skip_next = False lines = entry.strip().splitlines() @@ -453,7 +452,12 @@ return None # Don't override the built-in doctest plugin - return self._doctest_module_item_cls(path, parent) + try: + return self._doctest_module_item_cls.from_parent(parent, fspath=path) + except AttributeError: + # pytest < 5.4 + return self._doctest_module_item_cls(path, parent) + elif any([path.check(fnmatch=pat) for pat in self._file_globs]): # Ignore generated .rst files parts = str(path).split(os.path.sep) @@ -479,7 +483,11 @@ # TODO: Get better names on these items when they are # displayed in py.test output - return self._doctest_textfile_item_cls(path, parent) + try: + return self._doctest_textfile_item_cls.from_parent(parent, fspath=path) + except AttributeError: + # pytest < 5.4 + return self._doctest_textfile_item_cls(path, parent) class DocTestFinderPlus(doctest.DocTestFinder): @@ -537,7 +545,7 @@ return False reqs = getattr(obj, '__doctest_requires__', {}) - for pats, mods in six.iteritems(reqs): + for pats, mods in reqs.items(): if not isinstance(pats, tuple): pats = (pats,) for pat in pats: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/pytest_doctestplus.egg-info/PKG-INFO new/pytest-doctestplus-0.6.1/pytest_doctestplus.egg-info/PKG-INFO --- old/pytest-doctestplus-0.5.0/pytest_doctestplus.egg-info/PKG-INFO 2019-11-15 22:27:08.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/pytest_doctestplus.egg-info/PKG-INFO 2020-05-05 03:38:14.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pytest-doctestplus -Version: 0.5.0 +Version: 0.6.1 Summary: Pytest plugin with advanced doctest features. Home-page: https://astropy.org Author: The Astropy Developers @@ -282,13 +282,11 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development :: Testing Classifier: Topic :: Utilities -Requires-Python: >=2.7 +Requires-Python: >=3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/pytest_doctestplus.egg-info/requires.txt new/pytest-doctestplus-0.6.1/pytest_doctestplus.egg-info/requires.txt --- old/pytest-doctestplus-0.5.0/pytest_doctestplus.egg-info/requires.txt 2019-11-15 22:27:08.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/pytest_doctestplus.egg-info/requires.txt 2020-05-05 03:38:14.000000000 +0200 @@ -1,2 +1,2 @@ -six -pytest>=3.0 +pytest>=4.0 +pip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/setup.cfg new/pytest-doctestplus-0.6.1/setup.cfg --- old/pytest-doctestplus-0.5.0/setup.cfg 2019-11-15 22:27:09.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/setup.cfg 2020-05-05 03:38:15.000000000 +0200 @@ -7,6 +7,9 @@ ignore:file format.*:UserWarning ignore:.*non-empty pattern match.*:FutureWarning +[flake8] +max-line-length = 100 + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/setup.py new/pytest-doctestplus-0.6.1/setup.py --- old/pytest-doctestplus-0.5.0/setup.py 2019-11-15 22:25:47.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/setup.py 2020-05-05 03:33:35.000000000 +0200 @@ -12,7 +12,7 @@ setup( name='pytest-doctestplus', - version='0.5.0', + version='0.6.1', license='BSD', description='Pytest plugin with advanced doctest features.', long_description=readme(), @@ -29,19 +29,17 @@ 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Testing', 'Topic :: Utilities', ], keywords=['doctest', 'rst', 'pytest', 'py.test'], - install_requires=['six', 'pytest>=3.0'], - python_requires='>=2.7', + install_requires=['pytest>=4.0', 'pip'], + python_requires='>=3.6', entry_points={ 'pytest11': [ 'pytest_doctestplus = pytest_doctestplus.plugin', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-doctestplus-0.5.0/tests/test_doctestplus.py new/pytest-doctestplus-0.6.1/tests/test_doctestplus.py --- old/pytest-doctestplus-0.5.0/tests/test_doctestplus.py 2019-11-15 22:23:40.000000000 +0100 +++ new/pytest-doctestplus-0.6.1/tests/test_doctestplus.py 2020-04-30 08:00:07.000000000 +0200 @@ -1,4 +1,5 @@ from distutils.version import LooseVersion +from textwrap import dedent import pytest @@ -350,7 +351,7 @@ >>> import foobar """ ) - testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(passed=1) + testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1) # should run as expected p = testdir.makefile( @@ -393,7 +394,7 @@ """ ) # passed because 'pytest<1.0' was not satisfied and 'assert 0' was not evaluated - testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(passed=1) + testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1) def test_ignore_warnings_module(testdir): @@ -509,7 +510,7 @@ '--doctest-glob', '*.rst', '--doctest-glob', '*.tex', '--doctest-glob', '*.txt' - ).assertoutcome(passed=3) + ).assertoutcome(passed=0) def test_text_file_comment_chars(testdir): @@ -535,7 +536,7 @@ '--doctest-glob', '*.rst', '--doctest-glob', '*.tex', '--doctest-glob', '*.txt' - ).assertoutcome(passed=2) + ).assertoutcome(passed=0) def test_ignore_option(testdir): @@ -621,3 +622,32 @@ # only doctests in python files testdir.inline_run("--doctest-only", "--doctest-rst").assertoutcome(passed=3, failed=2) + +def test_doctest_float_replacement(tmpdir): + test1 = dedent(""" + This will demonstrate a doctest that fails due to a few extra decimal + places:: + + >>> 1.0 / 3.0 + 0.333333333333333311 + """) + + test2 = dedent(""" + This is the same test, but it should pass with use of + +FLOAT_CMP:: + + >>> 1.0 / 3.0 # doctest: +FLOAT_CMP + 0.333333333333333311 + """) + + test1_rst = tmpdir.join('test1.rst') + test2_rst = tmpdir.join('test2.rst') + test1_rst.write(test1) + test2_rst.write(test2) + + with pytest.raises(doctest.DocTestFailure): + doctest.testfile(str(test1_rst), module_relative=False, + raise_on_error=True, verbose=False, encoding='utf-8') + + doctest.testfile(str(test2_rst), module_relative=False, + raise_on_error=True, verbose=False, encoding='utf-8')