Hello community,
here is the log from the commit of package python-process-tests for
openSUSE:Factory checked in at 2019-02-24 17:06:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-process-tests (Old)
and /work/SRC/openSUSE:Factory/.python-process-tests.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-process-tests"
Sun Feb 24 17:06:22 2019 rev:5 rq:674519 version:2.0.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-process-tests/python-process-tests.changes
2018-12-27 00:27:38.503749006 +0100
+++
/work/SRC/openSUSE:Factory/.python-process-tests.new.28833/python-process-tests.changes
2019-02-24 17:06:24.888594295 +0100
@@ -1,0 +2,6 @@
+Wed Feb 13 11:58:24 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 2.0.2:
+ * No upstream changelog provided
+
+-------------------------------------------------------------------
Old:
----
process-tests-1.2.2.tar.gz
New:
----
process-tests-2.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-process-tests.spec ++++++
--- /var/tmp/diff_new_pack.291UnD/_old 2019-02-24 17:06:25.516593996 +0100
+++ /var/tmp/diff_new_pack.291UnD/_new 2019-02-24 17:06:25.516593996 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-process-tests
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-process-tests
-Version: 1.2.2
+Version: 2.0.2
Release: 0
Summary: Tools for testing processes
License: BSD-2-Clause
++++++ process-tests-1.2.2.tar.gz -> process-tests-2.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/process-tests-1.2.2/PKG-INFO
new/process-tests-2.0.2/PKG-INFO
--- old/process-tests-1.2.2/PKG-INFO 2017-08-27 19:27:23.000000000 +0200
+++ new/process-tests-2.0.2/PKG-INFO 2019-02-11 23:56:03.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: process-tests
-Version: 1.2.2
+Version: 2.0.2
Summary: Tools for testing processes
Home-page: https://github.com/ionelmc/python-process-tests
Author: Ionel Cristian Mărieș
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/process-tests-1.2.2/python-process-tests.komodoproject
new/process-tests-2.0.2/python-process-tests.komodoproject
--- old/process-tests-1.2.2/python-process-tests.komodoproject 2017-08-27
19:20:08.000000000 +0200
+++ new/process-tests-2.0.2/python-process-tests.komodoproject 1970-01-01
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Komodo Project File - DO NOT EDIT -->
-<project id="b69cc169-6ee2-465e-a93f-d64024ef61b1" kpf_version="5"
name="python-process-tests.komodoproject">
-</project>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/process-tests-1.2.2/setup.py
new/process-tests-2.0.2/setup.py
--- old/process-tests-1.2.2/setup.py 2017-08-27 19:26:56.000000000 +0200
+++ new/process-tests-2.0.2/setup.py 2019-02-11 23:55:39.000000000 +0100
@@ -5,7 +5,7 @@
setup(
name="process-tests",
- version="1.2.2",
+ version="2.0.2",
url='https://github.com/ionelmc/python-process-tests',
download_url='',
license='BSD',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/process-tests-1.2.2/src/process_tests.egg-info/PKG-INFO
new/process-tests-2.0.2/src/process_tests.egg-info/PKG-INFO
--- old/process-tests-1.2.2/src/process_tests.egg-info/PKG-INFO 2017-08-27
19:27:23.000000000 +0200
+++ new/process-tests-2.0.2/src/process_tests.egg-info/PKG-INFO 2019-02-11
23:56:03.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: process-tests
-Version: 1.2.2
+Version: 2.0.2
Summary: Tools for testing processes
Home-page: https://github.com/ionelmc/python-process-tests
Author: Ionel Cristian Mărieș
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/process-tests-1.2.2/src/process_tests.egg-info/SOURCES.txt
new/process-tests-2.0.2/src/process_tests.egg-info/SOURCES.txt
--- old/process-tests-1.2.2/src/process_tests.egg-info/SOURCES.txt
2017-08-27 19:27:23.000000000 +0200
+++ new/process-tests-2.0.2/src/process_tests.egg-info/SOURCES.txt
2019-02-11 23:56:03.000000000 +0100
@@ -1,7 +1,6 @@
LICENSE
MANIFEST.in
README.rst
-python-process-tests.komodoproject
setup.cfg
setup.py
src/process_tests.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/process-tests-1.2.2/src/process_tests.py
new/process-tests-2.0.2/src/process_tests.py
--- old/process-tests-1.2.2/src/process_tests.py 2017-08-27
19:26:02.000000000 +0200
+++ new/process-tests-2.0.2/src/process_tests.py 2019-02-11
23:54:14.000000000 +0100
@@ -2,15 +2,12 @@
import errno
import os
-import signal
import socket
import subprocess
import sys
import threading
import time
-import traceback
from contextlib import contextmanager
-from functools import partial
from logging import getLogger
try:
@@ -59,17 +56,17 @@
break
try:
data = data.decode(self.ENCODING)
- except Exception:
- logger.exception("Failed to decode %r" % data)
+ except Exception as exc:
+ logger.exception("%r failed to decode %r: %r", self, data,
exc)
raise
self.buff.write(data)
- except OSError as e:
- if e.errno not in (
+ except OSError as exc:
+ if exc.errno not in (
errno.EAGAIN, errno.EWOULDBLOCK,
errno.EINPROGRESS
):
- print("Failed to read from %s: %s" % (self.fd, e))
+ logger.exception("%r failed to read from FD %s: %r", self,
self.fd, exc)
return self.buff.getvalue()
def reset(self):
@@ -95,8 +92,8 @@
self.queue.put(data)
else:
time.sleep(1)
- except OSError as e:
- print("Failed to read from %s: %s" % (self.fh, e))
+ except OSError as exc:
+ logger.exception("%r failed to read from %s: %r", self,
self.fh, exc)
raise
def read(self):
@@ -107,8 +104,8 @@
break
try:
data = data.decode(self.ENCODING)
- except Exception:
- logger.exception("Failed to decode %r" % data)
+ except Exception as exc:
+ logger.exception("%r failed to decode %r: %r", self, data, exc)
raise
self.buff.write(data)
return self.buff.getvalue()
@@ -118,6 +115,8 @@
class TestProcess(BufferingBase if fcntl else ThreadedBufferingBase):
+ __test__ = False
+
def __init__(self, *args, **kwargs):
kwargs.setdefault('env', os.environ)
kwargs.setdefault('bufsize', 1)
@@ -125,6 +124,7 @@
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
+ close_fds=sys.platform != "win32",
**kwargs
)
super(TestProcess, self).__init__(self.proc.stdout)
@@ -136,6 +136,9 @@
def signal(self, sig):
self.proc.send_signal(sig)
+ def __repr__(self):
+ return "TestProcess(pid=%s, is_alive=%s)" % (self.proc.pid,
self.is_alive)
+
def __enter__(self):
return self
@@ -153,12 +156,12 @@
if exc.errno == errno.ESRCH:
return
else:
- print("Failed to terminate %s: %s" %
(self.proc.pid, exc))
+ logger.exception("%r failed to terminate process:
%r", self, exc)
else:
return
time.sleep(0.2)
try:
- print('Killing %s !' % self, file=sys.stderr)
+ logger.critical('%s killing unresponsive process!', self)
self.proc.kill()
except OSError as exc:
if exc.errno != errno.ESRCH:
@@ -168,27 +171,25 @@
data, _ = self.proc.communicate()
try:
data = data.decode(self.ENCODING)
- except Exception:
- logger.exception("Failed to decode %r" % data)
+ except Exception as exc:
+ logger.exception("%s failed to decode %r: %r", self, data,
exc)
raise
self.buff.write(data)
except IOError as exc:
if exc.errno != errno.EAGAIN:
- print('\nFailed to cleanup process:\n', file=sys.stderr)
- traceback.print_exc()
- except Exception:
- print('\nFailed to cleanup process:\n', file=sys.stderr)
- traceback.print_exc()
+ logger.exception('%s failed to cleanup buffers: %r', self,
exc)
+ except Exception as exc:
+ logger.exception('%s failed to cleanup buffers: %r', self, exc)
try:
self.cleanup()
- except Exception:
- print('\nFailed to cleanup process:\n', file=sys.stderr)
- traceback.print_exc()
+ except Exception as exc:
+ logger.exception('%s failed to cleanup: %r', self, exc)
close = __exit__
class TestSocket(BufferingBase if fcntl else ThreadedBufferingBase):
+ __test__ = False
BUFFSIZE = 8192
def __init__(self, sock):
@@ -222,8 +223,6 @@
"""
This checks that *string appear in cb(), IN THE GIVEN ORDER !
"""
- buff = '<UNINITIALIZED>'
-
start = time.time()
while True:
buff = cb()
@@ -270,50 +269,3 @@
dump_on_error = staticmethod(dump_on_error)
wait_for_strings = staticmethod(wait_for_strings)
-
-_cov = None
-
-
-def restart_coverage():
- logger.critical("(RE)STARTING COVERAGE.")
- global _cov
- try:
- from coverage.control import coverage
- from coverage.collector import Collector
- except ImportError:
- _cov = None
- return
- if _cov:
- _cov.save()
- _cov.stop()
- if Collector._collectors:
- Collector._collectors[-1].stop()
-
- _cov = coverage(auto_data=True, data_suffix=True)
- _cov.start()
-
-
-def setup_coverage(env_var="WITH_COVERAGE"):
- """
- Patch fork and forkpty to restart coverage measurement after fork. Expects
to have a environment variable named WITH_COVERAGE set to a
- non-empty value.
- """
- if os.environ.get(env_var) == 'yes': # don't even bother if not set
- restart_coverage()
-
- handler = signal.getsignal(signal.SIGTERM)
- if handler is None:
- logger.critical("SIGTERM handler not installed from python. It's
getting overriden !")
- print("SIGTERM handler not installed from python. It's getting
overriden !", file=sys.__stderr__)
-
- @partial(signal.signal, signal.SIGTERM)
- def on_atexit(signo, frame):
- if _cov:
- _cov._atexit()
- if handler == signal.SIG_DFL:
- signal.signal(signo, signal.SIG_DFL)
- os.kill(os.getpid(), signo)
- elif handler == signal.SIG_IGN:
- pass
- elif handler:
- handler(signo, frame)