Hello community,

here is the log from the commit of package python-py for openSUSE:Factory 
checked in at 2019-02-20 14:08:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-py (Old)
 and      /work/SRC/openSUSE:Factory/.python-py.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-py"

Wed Feb 20 14:08:05 2019 rev:31 rq:676513 version:1.7.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-py/python-py.changes      2018-11-08 
09:39:36.637721140 +0100
+++ /work/SRC/openSUSE:Factory/.python-py.new.28833/python-py.changes   
2019-02-20 14:08:12.731001614 +0100
@@ -1,0 +2,19 @@
+Fri Feb 15 11:19:55 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Make tests never fail as they are borked on pytest-4 with
+  most probably no intention of being ever fixed
+
+-------------------------------------------------------------------
+Fri Feb 15 11:01:39 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Make tests really pass on pytest 3.x series
+- Add patch to operate better with serparators (from upstream git):
+  * separators.patch
+
+-------------------------------------------------------------------
+Tue Feb 12 14:34:40 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Drop the doc subpackage, no need for it really
+- Make sure the tests are realy executed
+
+-------------------------------------------------------------------

Old:
----
  python-py-doc.changes
  python-py-doc.spec

New:
----
  separators.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-py.spec ++++++
--- /var/tmp/diff_new_pack.xjtoox/_old  2019-02-20 14:08:14.211001125 +0100
+++ /var/tmp/diff_new_pack.xjtoox/_new  2019-02-20 14:08:14.223001121 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-py
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
 #
 
 
+%define oldpython python
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-py
 Version:        1.7.0
@@ -25,9 +26,13 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/pytest-dev/py
 Source:         
https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz
+Patch0:         separators.patch
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools_scm}
+BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+Obsoletes:      %{oldpython}-py-docs
 BuildArch:      noarch
 %python_subpackages
 
@@ -43,7 +48,12 @@
 
 %prep
 %setup -q -n py-%{version}
+%patch0 -p1
+
 rm -rf py.egg-info
+rm -f tox.ini
+# https://github.com/pytest-dev/py/issues/162
+rm -f testing/log/test_warning.py
 
 %build
 %python_build
@@ -52,6 +62,13 @@
 %python_install
 %python_exec %fdupes %{buildroot}%{$python_sitelib}
 
+%check
+export LANG=en_US.UTF-8
+# the passing is because upstream does not care about the results for now and
+# pinned pytest 3 in the repo (as this module is deprecated)
+# https://github.com/pytest-dev/py/issues/209
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m pytest || :
+
 %files %{python_files}
 %doc README.rst
 %license LICENSE

++++++ separators.patch ++++++
>From a499409ee0f1234d45a80bf918cca18259fa9e1c Mon Sep 17 00:00:00 2001
From: Anthony Sottile <[email protected]>
Date: Thu, 22 Nov 2018 14:24:11 -0800
Subject: [PATCH] Have at least one separator in sep()

Before:

```
 1 failed, 1 passed, 1 skipped, 1 deselected, 1 xfailed, 1 xpassed, 1 error in 
0.04 seconds
```

After:

```
= 1 failed, 1 passed, 1 skipped, 1 deselected, 1 xfailed, 1 xpassed, 1 error in 
0.04 seconds =
```
---
 py/_io/terminalwriter.py           | 2 +-
 testing/io_/test_terminalwriter.py | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/py/_io/terminalwriter.py b/py/_io/terminalwriter.py
index 817bf2d8..be559867 100644
--- a/py/_io/terminalwriter.py
+++ b/py/_io/terminalwriter.py
@@ -227,7 +227,7 @@ def sep(self, sepchar, title=None, fullwidth=None, **kw):
             # i.e.    2 + 2*len(sepchar)*N + len(title) <= fullwidth
             #         2*len(sepchar)*N <= fullwidth - len(title) - 2
             #         N <= (fullwidth - len(title) - 2) // (2*len(sepchar))
-            N = (fullwidth - len(title) - 2) // (2*len(sepchar))
+            N = max((fullwidth - len(title) - 2) // (2*len(sepchar)), 1)
             fill = sepchar * N
             line = "%s %s %s" % (fill, title, fill)
         else:
diff --git a/testing/io_/test_terminalwriter.py 
b/testing/io_/test_terminalwriter.py
index 64b07568..1eef7f7d 100644
--- a/testing/io_/test_terminalwriter.py
+++ b/testing/io_/test_terminalwriter.py
@@ -165,6 +165,12 @@ def test_sep_with_title(self, tw):
         assert len(l) == 1
         assert l[0] == "-" * 26 + " hello " + "-" * (27-win32) + "\n"
 
+    def test_sep_longer_than_width(self, tw):
+        tw.sep('-', 'a' * 10, fullwidth=5)
+        line, = tw.getlines()
+        # even though the string is wider than the line, still have a separator
+        assert line == '- aaaaaaaaaa -\n'
+
     @py.test.mark.skipif("sys.platform == 'win32'")
     def test__escaped(self, tw):
         text2 = tw._escaped("hello", (31))

Reply via email to