Hello community,

here is the log from the commit of package python-pytest-timeout for 
openSUSE:Factory checked in at 2020-06-30 21:54:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-timeout (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-timeout.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-timeout"

Tue Jun 30 21:54:38 2020 rev:9 rq:817717 version:1.4.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-timeout/python-pytest-timeout.changes  
    2020-01-16 18:13:51.128724043 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-timeout.new.3060/python-pytest-timeout.changes
    2020-06-30 21:54:40.050425099 +0200
@@ -1,0 +2,6 @@
+Mon Jun 29 12:15:28 UTC 2020 - Marketa Calabkova <mcalabk...@suse.com>
+
+- Update to 1.4.1
+  * Better detection of when we are debugging, thanks Mattwmaster58.
+
+-------------------------------------------------------------------

Old:
----
  pytest-timeout-1.3.4.tar.gz

New:
----
  pytest-timeout-1.4.1.tar.gz

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

Other differences:
------------------
++++++ python-pytest-timeout.spec ++++++
--- /var/tmp/diff_new_pack.loASUW/_old  2020-06-30 21:54:41.282428912 +0200
+++ /var/tmp/diff_new_pack.loASUW/_new  2020-06-30 21:54:41.286428924 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pytest-timeout
-Version:        1.3.4
+Version:        1.4.1
 Release:        0
 Summary:        Pytest plugin to abort hanging tests
 License:        MIT
@@ -26,6 +26,7 @@
 Source:         
https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-%{version}.tar.gz
 BuildRequires:  %{python_module pexpect}
 BuildRequires:  %{python_module pytest >= 3.6.0}
+BuildRequires:  %{python_module pytest-cov}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros

++++++ pytest-timeout-1.3.4.tar.gz -> pytest-timeout-1.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/PKG-INFO 
new/pytest-timeout-1.4.1/PKG-INFO
--- old/pytest-timeout-1.3.4/PKG-INFO   2020-01-06 20:23:39.000000000 +0100
+++ new/pytest-timeout-1.4.1/PKG-INFO   2020-06-15 21:23:07.425450000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pytest-timeout
-Version: 1.3.4
+Version: 1.4.1
 Summary: py.test plugin to abort hanging tests
 Home-page: http://github.com/pytest-dev/pytest-timeout/
 Author: Floris Bruynooghe
@@ -12,7 +12,7 @@
         
         |python| |version| |anaconda| |ci|
         
-        .. |version| image:: http://img.shields.io/pypi/v/pytest-timeout.svg
+        .. |version| image:: https://img.shields.io/pypi/v/pytest-timeout.svg
           :target: https://pypi.python.org/pypi/pytest-timeout
         
         .. |anaconda| image:: 
https://img.shields.io/conda/vn/conda-forge/pytest-timeout.svg
@@ -24,21 +24,31 @@
         .. |python| image:: 
https://img.shields.io/pypi/pyversions/pytest-timeout.svg
           :target: https://pypi.python.org/pypi/pytest-timeout/
         
-        This is a plugin which will terminate tests after a certain timeout.
-        When doing so it will show a stack dump of all threads running at the
-        time.  This is useful when running tests under a continuous
-        integration server or simply if you don't know why the test suite
-        hangs.
-        
-        Note that while by default on POSIX systems py.test will continue to
-        execute the tests after a test has timed, out this is not always
-        possible.  Often the only sure way to interrupt a hanging test is by
-        terminating the entire process.  As this is a hard termination
-        (``os._exit()``) it will result in no teardown, JUnit XML output etc.
-        But the plugin will ensure you will have the debugging output on
-        stderr nevertheless, which is the most important part at this stage.
-        See below for detailed information on the timeout methods and their
-        side-effects.
+        This is a plugin which will terminate tests after a certain timeout,
+        assuming the test session isn't being debugged. When aborting a test
+        it will show a stack dump of all threads running at the time.
+        This is useful when running tests under a continuous
+        integration server or simply if you don't know why the test suite 
hangs.
+        
+        .. note::
+        
+           The way this plugin detects whether or not a debugging session is
+           active is by checking if a trace function is set and if one is, it
+           check to see if the module it belongs to is present in a set of
+           known debugging frameworks modules OR if pytest itself drops you
+           into a pbd session.
+        
+        .. note::
+        
+           While by default on POSIX systems pytest will continue to execute
+           the tests after a test has timed out this is not always possible.
+           Often the only sure way to interrupt a hanging test is by
+           terminating the entire process.  As this is a hard termination
+           (``os._exit()``) it will result in no teardown, JUnit XML output
+           etc.  But the plugin will ensure you will have the debugging output
+           on stderr nevertheless, which is the most important part at this
+           stage.  See below for detailed information on the timeout methods
+           and their side-effects.
         
         The pytest-timeout plugin has been tested on python 2.7 or higher,
         including 3.X, pypy and pypy3.  See tox.ini for currently tested
@@ -55,7 +65,7 @@
         Now you can run tests using a timeout, in seconds, after which they
         will be terminated::
         
-           py.test --timeout=300
+           pytest --timeout=300
         
         Alternatively you can mark individual tests as having a timeout::
         
@@ -65,10 +75,10 @@
         
         By default the plugin will not time out any tests, you must specify a
         valid timeout for the plugin to interrupt long-running tests.  A
-        timeout is always specified as an integer number of seconds and can be
+        timeout is always specified as a number of seconds, and can be
         defined in a number of ways, from low to high priority:
         
-        1. You can set a global timeout in the `py.test configuration file`__
+        1. You can set a global timeout in the `pytest configuration file`__
            using the ``timeout`` option.  E.g.::
         
               [pytest]
@@ -87,9 +97,9 @@
               def test_foo():
                   pass
         
-        __ 
http://pytest.org/latest/customize.html#how-test-configuration-is-read-from-configuration-ini-files
+        __ https://docs.pytest.org/en/latest/reference.html#ini-options-ref
         
-        .. _marker: http://pytest.org/latest/mark.html
+        .. _marker: https://docs.pytest.org/en/latest/mark.html
         
         Setting a timeout to 0 seconds disables the timeout, so if you have a
         global timeout set you can still disable the timeout by using the
@@ -119,12 +129,12 @@
         
         The downsides of this method are that there is a relatively large
         overhead for running each test and that test runs are not completed.
-        This means that other py.test features, like e.g. JUnit XML output or
+        This means that other pytest features, like e.g. JUnit XML output or
         fixture teardown, will not function normally.  The second issue might
         be alleviated by using the ``--boxed`` option of the pytest-xdist_
         plugin.
         
-        .. _pytest-xdist: http://pypi.python.org/pypi/pytest-xdist
+        .. _pytest-xdist: https://pypi.org/project/pytest-xdist/
         
         The benefit of this method is that it will always work.  Furthermore
         it will still provide you debugging information by printing the stacks
@@ -139,7 +149,7 @@
         the test the signal handler will dump the stack of any other threads
         running to stderr and use ``pytest.fail()`` to interrupt the test.
         
-        The benefit of this method is that the py.test process is not
+        The benefit of this method is that the pytest process is not
         terminated and the test run can complete normally.
         
         The main issue to look out for with this method is that it may
@@ -151,7 +161,7 @@
         -----------------------------
         
         The timeout method can be specified by using the ``timeout_method``
-        option in the `py.test configuration file`__, the ``--timeout_method``
+        option in the `pytest configuration file`__, the ``--timeout_method``
         command line parameter or the ``timeout`` marker_.  Simply set their
         value to the string ``thread`` or ``signal`` to override the default
         method.  On a marker this is done using the ``method`` keyword::
@@ -160,9 +170,9 @@
            def test_foo():
                pass
         
-        __ 
http://pytest.org/latest/customize.html#how-test-configuration-is-read-from-configuration-ini-files
+        __ https://docs.pytest.org/en/latest/reference.html#ini-options-ref
         
-        .. _marker: http://pytest.org/latest/mark.html
+        .. _marker: https://docs.pytest.org/en/latest/mark.html
         
         The ``timeout`` Marker API
         ==========================
@@ -177,9 +187,9 @@
         See the marker api documentation_ and examples_ for the various ways
         markers can be applied to test items.
         
-        .. _documentation: http://pytest.org/latest/mark.html
+        .. _documentation: https://docs.pytest.org/en/latest/mark.html
         
-        .. _examples: 
http://pytest.org/latest/example/markers.html#marking-whole-classes-or-modules
+        .. _examples: 
https://docs.pytest.org/en/latest/example/markers.html#marking-whole-classes-or-modules
         
         
         Timeouts in Fixture Teardown
@@ -199,6 +209,16 @@
         Changelog
         =========
         
+        1.4.1
+        -----
+        
+        - Fix coverage compatibility which was broken by 1.4.0.
+        
+        1.4.0
+        -----
+        
+        - Better detection of when we are debugging, thanks Mattwmaster58.
+        
         1.3.4
         -----
         
@@ -261,9 +281,9 @@
         -----
         
         * Bump version to 1.0 to commit to semantic versioning.
-        * Fix issue #12: Now compatible with py.test 2.8, thanks Holger Krekel.
+        * Fix issue #12: Now compatible with pytest 2.8, thanks Holger Krekel.
         * No longer test with pexpect on py26 as it is no longer supported
-        * Require py.test 2.8 and use new hookimpl decorator
+        * Require pytest 2.8 and use new hookimpl decorator
         
         0.5
         ---
@@ -281,7 +301,7 @@
         * Support timeouts happening in (session scoped) finalizers.
         
         * Change command line option --timeout_method into --timeout-method
-          for consistency with py.test
+          for consistency with pytest
         
         0.3
         ---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/README.rst 
new/pytest-timeout-1.4.1/README.rst
--- old/pytest-timeout-1.3.4/README.rst 2019-11-20 23:17:07.000000000 +0100
+++ new/pytest-timeout-1.4.1/README.rst 2020-06-15 21:03:43.000000000 +0200
@@ -4,7 +4,7 @@
 
 |python| |version| |anaconda| |ci|
 
-.. |version| image:: http://img.shields.io/pypi/v/pytest-timeout.svg
+.. |version| image:: https://img.shields.io/pypi/v/pytest-timeout.svg
   :target: https://pypi.python.org/pypi/pytest-timeout
 
 .. |anaconda| image:: 
https://img.shields.io/conda/vn/conda-forge/pytest-timeout.svg
@@ -16,21 +16,31 @@
 .. |python| image:: https://img.shields.io/pypi/pyversions/pytest-timeout.svg
   :target: https://pypi.python.org/pypi/pytest-timeout/
 
-This is a plugin which will terminate tests after a certain timeout.
-When doing so it will show a stack dump of all threads running at the
-time.  This is useful when running tests under a continuous
-integration server or simply if you don't know why the test suite
-hangs.
-
-Note that while by default on POSIX systems py.test will continue to
-execute the tests after a test has timed, out this is not always
-possible.  Often the only sure way to interrupt a hanging test is by
-terminating the entire process.  As this is a hard termination
-(``os._exit()``) it will result in no teardown, JUnit XML output etc.
-But the plugin will ensure you will have the debugging output on
-stderr nevertheless, which is the most important part at this stage.
-See below for detailed information on the timeout methods and their
-side-effects.
+This is a plugin which will terminate tests after a certain timeout,
+assuming the test session isn't being debugged. When aborting a test
+it will show a stack dump of all threads running at the time.
+This is useful when running tests under a continuous
+integration server or simply if you don't know why the test suite hangs.
+
+.. note::
+
+   The way this plugin detects whether or not a debugging session is
+   active is by checking if a trace function is set and if one is, it
+   check to see if the module it belongs to is present in a set of
+   known debugging frameworks modules OR if pytest itself drops you
+   into a pbd session.
+
+.. note::
+
+   While by default on POSIX systems pytest will continue to execute
+   the tests after a test has timed out this is not always possible.
+   Often the only sure way to interrupt a hanging test is by
+   terminating the entire process.  As this is a hard termination
+   (``os._exit()``) it will result in no teardown, JUnit XML output
+   etc.  But the plugin will ensure you will have the debugging output
+   on stderr nevertheless, which is the most important part at this
+   stage.  See below for detailed information on the timeout methods
+   and their side-effects.
 
 The pytest-timeout plugin has been tested on python 2.7 or higher,
 including 3.X, pypy and pypy3.  See tox.ini for currently tested
@@ -47,7 +57,7 @@
 Now you can run tests using a timeout, in seconds, after which they
 will be terminated::
 
-   py.test --timeout=300
+   pytest --timeout=300
 
 Alternatively you can mark individual tests as having a timeout::
 
@@ -57,10 +67,10 @@
 
 By default the plugin will not time out any tests, you must specify a
 valid timeout for the plugin to interrupt long-running tests.  A
-timeout is always specified as an integer number of seconds and can be
+timeout is always specified as a number of seconds, and can be
 defined in a number of ways, from low to high priority:
 
-1. You can set a global timeout in the `py.test configuration file`__
+1. You can set a global timeout in the `pytest configuration file`__
    using the ``timeout`` option.  E.g.::
 
       [pytest]
@@ -79,9 +89,9 @@
       def test_foo():
           pass
 
-__ 
http://pytest.org/latest/customize.html#how-test-configuration-is-read-from-configuration-ini-files
+__ https://docs.pytest.org/en/latest/reference.html#ini-options-ref
 
-.. _marker: http://pytest.org/latest/mark.html
+.. _marker: https://docs.pytest.org/en/latest/mark.html
 
 Setting a timeout to 0 seconds disables the timeout, so if you have a
 global timeout set you can still disable the timeout by using the
@@ -111,12 +121,12 @@
 
 The downsides of this method are that there is a relatively large
 overhead for running each test and that test runs are not completed.
-This means that other py.test features, like e.g. JUnit XML output or
+This means that other pytest features, like e.g. JUnit XML output or
 fixture teardown, will not function normally.  The second issue might
 be alleviated by using the ``--boxed`` option of the pytest-xdist_
 plugin.
 
-.. _pytest-xdist: http://pypi.python.org/pypi/pytest-xdist
+.. _pytest-xdist: https://pypi.org/project/pytest-xdist/
 
 The benefit of this method is that it will always work.  Furthermore
 it will still provide you debugging information by printing the stacks
@@ -131,7 +141,7 @@
 the test the signal handler will dump the stack of any other threads
 running to stderr and use ``pytest.fail()`` to interrupt the test.
 
-The benefit of this method is that the py.test process is not
+The benefit of this method is that the pytest process is not
 terminated and the test run can complete normally.
 
 The main issue to look out for with this method is that it may
@@ -143,7 +153,7 @@
 -----------------------------
 
 The timeout method can be specified by using the ``timeout_method``
-option in the `py.test configuration file`__, the ``--timeout_method``
+option in the `pytest configuration file`__, the ``--timeout_method``
 command line parameter or the ``timeout`` marker_.  Simply set their
 value to the string ``thread`` or ``signal`` to override the default
 method.  On a marker this is done using the ``method`` keyword::
@@ -152,9 +162,9 @@
    def test_foo():
        pass
 
-__ 
http://pytest.org/latest/customize.html#how-test-configuration-is-read-from-configuration-ini-files
+__ https://docs.pytest.org/en/latest/reference.html#ini-options-ref
 
-.. _marker: http://pytest.org/latest/mark.html
+.. _marker: https://docs.pytest.org/en/latest/mark.html
 
 The ``timeout`` Marker API
 ==========================
@@ -169,9 +179,9 @@
 See the marker api documentation_ and examples_ for the various ways
 markers can be applied to test items.
 
-.. _documentation: http://pytest.org/latest/mark.html
+.. _documentation: https://docs.pytest.org/en/latest/mark.html
 
-.. _examples: 
http://pytest.org/latest/example/markers.html#marking-whole-classes-or-modules
+.. _examples: 
https://docs.pytest.org/en/latest/example/markers.html#marking-whole-classes-or-modules
 
 
 Timeouts in Fixture Teardown
@@ -191,6 +201,16 @@
 Changelog
 =========
 
+1.4.1
+-----
+
+- Fix coverage compatibility which was broken by 1.4.0.
+
+1.4.0
+-----
+
+- Better detection of when we are debugging, thanks Mattwmaster58.
+
 1.3.4
 -----
 
@@ -253,9 +273,9 @@
 -----
 
 * Bump version to 1.0 to commit to semantic versioning.
-* Fix issue #12: Now compatible with py.test 2.8, thanks Holger Krekel.
+* Fix issue #12: Now compatible with pytest 2.8, thanks Holger Krekel.
 * No longer test with pexpect on py26 as it is no longer supported
-* Require py.test 2.8 and use new hookimpl decorator
+* Require pytest 2.8 and use new hookimpl decorator
 
 0.5
 ---
@@ -273,7 +293,7 @@
 * Support timeouts happening in (session scoped) finalizers.
 
 * Change command line option --timeout_method into --timeout-method
-  for consistency with py.test
+  for consistency with pytest
 
 0.3
 ---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/failure_demo.py 
new/pytest-timeout-1.4.1/failure_demo.py
--- old/pytest-timeout-1.3.4/failure_demo.py    2019-11-20 21:55:37.000000000 
+0100
+++ new/pytest-timeout-1.4.1/failure_demo.py    2020-06-14 14:15:17.000000000 
+0200
@@ -1,4 +1,4 @@
-"""Demonstration of timeout failures using pytest_timeout
+"""Demonstration of timeout failures using pytest_timeout.
 
 To use this demo, invoke py.test on it::
 
@@ -11,21 +11,27 @@
 
 
 def sleep(s):
+    """Sleep for a while, possibly triggering a timeout.
+
+    Also adds another function on the stack showing off the stack.
+    """
     # Separate function to demonstrate nested calls
     time.sleep(s)
 
 
 @pytest.mark.timeout(1)
 def test_simple():
+    """Basic timeout demonstration."""
     sleep(2)
 
 
-def run():
+def _run():
     sleep(2)
 
 
 @pytest.mark.timeout(1)
 def test_thread():
-    t = threading.Thread(target=run)
+    """Timeout when multiple threads are running."""
+    t = threading.Thread(target=_run)
     t.start()
     sleep(2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pytest-timeout-1.3.4/pytest_timeout.egg-info/PKG-INFO 
new/pytest-timeout-1.4.1/pytest_timeout.egg-info/PKG-INFO
--- old/pytest-timeout-1.3.4/pytest_timeout.egg-info/PKG-INFO   2020-01-06 
20:23:39.000000000 +0100
+++ new/pytest-timeout-1.4.1/pytest_timeout.egg-info/PKG-INFO   2020-06-15 
21:23:07.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pytest-timeout
-Version: 1.3.4
+Version: 1.4.1
 Summary: py.test plugin to abort hanging tests
 Home-page: http://github.com/pytest-dev/pytest-timeout/
 Author: Floris Bruynooghe
@@ -12,7 +12,7 @@
         
         |python| |version| |anaconda| |ci|
         
-        .. |version| image:: http://img.shields.io/pypi/v/pytest-timeout.svg
+        .. |version| image:: https://img.shields.io/pypi/v/pytest-timeout.svg
           :target: https://pypi.python.org/pypi/pytest-timeout
         
         .. |anaconda| image:: 
https://img.shields.io/conda/vn/conda-forge/pytest-timeout.svg
@@ -24,21 +24,31 @@
         .. |python| image:: 
https://img.shields.io/pypi/pyversions/pytest-timeout.svg
           :target: https://pypi.python.org/pypi/pytest-timeout/
         
-        This is a plugin which will terminate tests after a certain timeout.
-        When doing so it will show a stack dump of all threads running at the
-        time.  This is useful when running tests under a continuous
-        integration server or simply if you don't know why the test suite
-        hangs.
-        
-        Note that while by default on POSIX systems py.test will continue to
-        execute the tests after a test has timed, out this is not always
-        possible.  Often the only sure way to interrupt a hanging test is by
-        terminating the entire process.  As this is a hard termination
-        (``os._exit()``) it will result in no teardown, JUnit XML output etc.
-        But the plugin will ensure you will have the debugging output on
-        stderr nevertheless, which is the most important part at this stage.
-        See below for detailed information on the timeout methods and their
-        side-effects.
+        This is a plugin which will terminate tests after a certain timeout,
+        assuming the test session isn't being debugged. When aborting a test
+        it will show a stack dump of all threads running at the time.
+        This is useful when running tests under a continuous
+        integration server or simply if you don't know why the test suite 
hangs.
+        
+        .. note::
+        
+           The way this plugin detects whether or not a debugging session is
+           active is by checking if a trace function is set and if one is, it
+           check to see if the module it belongs to is present in a set of
+           known debugging frameworks modules OR if pytest itself drops you
+           into a pbd session.
+        
+        .. note::
+        
+           While by default on POSIX systems pytest will continue to execute
+           the tests after a test has timed out this is not always possible.
+           Often the only sure way to interrupt a hanging test is by
+           terminating the entire process.  As this is a hard termination
+           (``os._exit()``) it will result in no teardown, JUnit XML output
+           etc.  But the plugin will ensure you will have the debugging output
+           on stderr nevertheless, which is the most important part at this
+           stage.  See below for detailed information on the timeout methods
+           and their side-effects.
         
         The pytest-timeout plugin has been tested on python 2.7 or higher,
         including 3.X, pypy and pypy3.  See tox.ini for currently tested
@@ -55,7 +65,7 @@
         Now you can run tests using a timeout, in seconds, after which they
         will be terminated::
         
-           py.test --timeout=300
+           pytest --timeout=300
         
         Alternatively you can mark individual tests as having a timeout::
         
@@ -65,10 +75,10 @@
         
         By default the plugin will not time out any tests, you must specify a
         valid timeout for the plugin to interrupt long-running tests.  A
-        timeout is always specified as an integer number of seconds and can be
+        timeout is always specified as a number of seconds, and can be
         defined in a number of ways, from low to high priority:
         
-        1. You can set a global timeout in the `py.test configuration file`__
+        1. You can set a global timeout in the `pytest configuration file`__
            using the ``timeout`` option.  E.g.::
         
               [pytest]
@@ -87,9 +97,9 @@
               def test_foo():
                   pass
         
-        __ 
http://pytest.org/latest/customize.html#how-test-configuration-is-read-from-configuration-ini-files
+        __ https://docs.pytest.org/en/latest/reference.html#ini-options-ref
         
-        .. _marker: http://pytest.org/latest/mark.html
+        .. _marker: https://docs.pytest.org/en/latest/mark.html
         
         Setting a timeout to 0 seconds disables the timeout, so if you have a
         global timeout set you can still disable the timeout by using the
@@ -119,12 +129,12 @@
         
         The downsides of this method are that there is a relatively large
         overhead for running each test and that test runs are not completed.
-        This means that other py.test features, like e.g. JUnit XML output or
+        This means that other pytest features, like e.g. JUnit XML output or
         fixture teardown, will not function normally.  The second issue might
         be alleviated by using the ``--boxed`` option of the pytest-xdist_
         plugin.
         
-        .. _pytest-xdist: http://pypi.python.org/pypi/pytest-xdist
+        .. _pytest-xdist: https://pypi.org/project/pytest-xdist/
         
         The benefit of this method is that it will always work.  Furthermore
         it will still provide you debugging information by printing the stacks
@@ -139,7 +149,7 @@
         the test the signal handler will dump the stack of any other threads
         running to stderr and use ``pytest.fail()`` to interrupt the test.
         
-        The benefit of this method is that the py.test process is not
+        The benefit of this method is that the pytest process is not
         terminated and the test run can complete normally.
         
         The main issue to look out for with this method is that it may
@@ -151,7 +161,7 @@
         -----------------------------
         
         The timeout method can be specified by using the ``timeout_method``
-        option in the `py.test configuration file`__, the ``--timeout_method``
+        option in the `pytest configuration file`__, the ``--timeout_method``
         command line parameter or the ``timeout`` marker_.  Simply set their
         value to the string ``thread`` or ``signal`` to override the default
         method.  On a marker this is done using the ``method`` keyword::
@@ -160,9 +170,9 @@
            def test_foo():
                pass
         
-        __ 
http://pytest.org/latest/customize.html#how-test-configuration-is-read-from-configuration-ini-files
+        __ https://docs.pytest.org/en/latest/reference.html#ini-options-ref
         
-        .. _marker: http://pytest.org/latest/mark.html
+        .. _marker: https://docs.pytest.org/en/latest/mark.html
         
         The ``timeout`` Marker API
         ==========================
@@ -177,9 +187,9 @@
         See the marker api documentation_ and examples_ for the various ways
         markers can be applied to test items.
         
-        .. _documentation: http://pytest.org/latest/mark.html
+        .. _documentation: https://docs.pytest.org/en/latest/mark.html
         
-        .. _examples: 
http://pytest.org/latest/example/markers.html#marking-whole-classes-or-modules
+        .. _examples: 
https://docs.pytest.org/en/latest/example/markers.html#marking-whole-classes-or-modules
         
         
         Timeouts in Fixture Teardown
@@ -199,6 +209,16 @@
         Changelog
         =========
         
+        1.4.1
+        -----
+        
+        - Fix coverage compatibility which was broken by 1.4.0.
+        
+        1.4.0
+        -----
+        
+        - Better detection of when we are debugging, thanks Mattwmaster58.
+        
         1.3.4
         -----
         
@@ -261,9 +281,9 @@
         -----
         
         * Bump version to 1.0 to commit to semantic versioning.
-        * Fix issue #12: Now compatible with py.test 2.8, thanks Holger Krekel.
+        * Fix issue #12: Now compatible with pytest 2.8, thanks Holger Krekel.
         * No longer test with pexpect on py26 as it is no longer supported
-        * Require py.test 2.8 and use new hookimpl decorator
+        * Require pytest 2.8 and use new hookimpl decorator
         
         0.5
         ---
@@ -281,7 +301,7 @@
         * Support timeouts happening in (session scoped) finalizers.
         
         * Change command line option --timeout_method into --timeout-method
-          for consistency with py.test
+          for consistency with pytest
         
         0.3
         ---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/pytest_timeout.py 
new/pytest-timeout-1.4.1/pytest_timeout.py
--- old/pytest-timeout-1.3.4/pytest_timeout.py  2019-11-20 21:55:37.000000000 
+0100
+++ new/pytest-timeout-1.4.1/pytest_timeout.py  2020-06-15 21:19:03.000000000 
+0200
@@ -1,4 +1,4 @@
-"""Timeout for tests to stop hanging testruns
+"""Timeout for tests to stop hanging testruns.
 
 This plugin will dump the stack and terminate the test.  This can be
 useful when running tests on a continuous integration server.
@@ -6,6 +6,7 @@
 If the platform supports SIGALRM this is used to raise an exception in
 the test, otherwise os._exit(1) is used.
 """
+import inspect
 import os
 import signal
 import sys
@@ -38,12 +39,15 @@
 used in the test.
 """.strip()
 
+# bdb covers pdb, ipdb, and possibly others
+# pydevd covers PyCharm, VSCode, and possibly others
+KNOWN_DEBUGGING_MODULES = {"pydevd", "bdb"}
 Settings = namedtuple("Settings", ["timeout", "method", "func_only"])
 
 
 @pytest.hookimpl
 def pytest_addoption(parser):
-    """Add options to control the timeout plugin"""
+    """Add options to control the timeout plugin."""
     group = parser.getgroup(
         "timeout",
         "Interrupt test run and dump stacks of all threads after a test times 
out",
@@ -69,7 +73,7 @@
 
 @pytest.hookimpl
 def pytest_configure(config):
-    # Register the marker so it shows up in --markers output.
+    """Register the marker so it shows up in --markers output."""
     config.addinivalue_line(
         "markers",
         "timeout(timeout, method=None, func_only=False): Set a timeout, 
timeout "
@@ -78,7 +82,7 @@
         "*method*, takes the same values as the --timeout_method option. The "
         "*func_only* keyword, when set to True, defers the timeout evaluation "
         "to only the test function body, ignoring the time it takes when "
-        "evaluating any fixrures used in the test.",
+        "evaluating any fixtures used in the test.",
     )
 
     settings = get_env_settings(config)
@@ -89,6 +93,12 @@
 
 @pytest.hookimpl(hookwrapper=True)
 def pytest_runtest_protocol(item):
+    """Hook in timeouts to the runtest protocol.
+
+    If the timeout is set on the entire test, including setup and
+    teardown, then this hook installs the timeout.  Otherwise
+    pytest_runtest_call is used.
+    """
     func_only = get_func_only_setting(item)
     if func_only is False:
         timeout_setup(item)
@@ -99,6 +109,11 @@
 
 @pytest.hookimpl(hookwrapper=True)
 def pytest_runtest_call(item):
+    """Hook in timeouts to the test function call only.
+
+    If the timeout is set on only the test function this hook installs
+    the timeout, otherwise pytest_runtest_protocol is used.
+    """
     func_only = get_func_only_setting(item)
     if func_only is True:
         timeout_setup(item)
@@ -109,6 +124,7 @@
 
 @pytest.hookimpl(tryfirst=True)
 def pytest_report_header(config):
+    """Add timeout config to pytest header."""
     if config._env_timeout:
         return [
             "timeout: %ss\ntimeout method: %s\ntimeout func_only: %s"
@@ -122,11 +138,17 @@
 
 @pytest.hookimpl(tryfirst=True)
 def pytest_exception_interact(node):
+    """Stop the timeout when pytest enters pdb in post-mortem mode."""
     timeout_teardown(node)
 
 
 @pytest.hookimpl
 def pytest_enter_pdb():
+    """Stop the timeouts when we entered pdb.
+
+    This stops timeouts from triggering when pytest's builting pdb
+    support notices we entered pdb.
+    """
     # Since pdb.set_trace happens outside of any pytest control, we don't have
     # any pytest ``item`` here, so we cannot use timeout_teardown. Thus, we
     # need another way to signify that the timeout should not be performed.
@@ -134,11 +156,35 @@
     SUPPRESS_TIMEOUT = True
 
 
+def is_debugging():
+    """Detect if a debugging session is in progress.
+
+    This looks at both pytest's builtin pdb support as well as
+    externally installed debuggers using some heuristics.
+
+     This is done by checking if either of the following conditions is
+     true:
+
+     1. Examines the trace function to see if the module it originates
+        from is in KNOWN_DEBUGGING_MODULES.
+     2. Check is SUPPRESS_TIMEOUT is set to True.
+    """
+    global SUPPRESS_TIMEOUT, KNOWN_DEBUGGING_MODULES
+    if SUPPRESS_TIMEOUT:
+        return True
+    trace_func = sys.gettrace()
+    if trace_func and inspect.getmodule(trace_func):
+        for name in KNOWN_DEBUGGING_MODULES:
+            if name in inspect.getmodule(trace_func):
+                return True
+    return False
+
+
 SUPPRESS_TIMEOUT = False
 
 
 def timeout_setup(item):
-    """Setup up a timeout trigger and handler"""
+    """Setup up a timeout trigger and handler."""
     params = get_params(item)
     if params.timeout is None or params.timeout <= 0:
         return
@@ -168,7 +214,7 @@
 
 
 def timeout_teardown(item):
-    """Cancel the timeout trigger if it was set"""
+    """Cancel the timeout trigger if it was set."""
     # When skipping is raised from a pytest_runtest_setup function
     # (as is the case when using the pytest.mark.skipif marker) we
     # may be called without our setup counterpart having been
@@ -179,6 +225,10 @@
 
 
 def get_env_settings(config):
+    """Return the configured timeout settings.
+
+    This looks up the settings in the environment and config file.
+    """
     timeout = config.getvalue("timeout")
     if timeout is None:
         timeout = _validate_timeout(
@@ -207,7 +257,7 @@
 
 
 def get_func_only_setting(item):
-    """Return the func_only setting for an item"""
+    """Return the func_only setting for an item."""
     func_only = None
     marker = item.get_closest_marker("timeout")
     if marker:
@@ -221,7 +271,7 @@
 
 
 def get_params(item, marker=None):
-    """Return (timeout, method) for an item"""
+    """Return (timeout, method) for an item."""
     timeout = method = func_only = None
     if not marker:
         marker = item.get_closest_marker("timeout")
@@ -240,7 +290,7 @@
 
 
 def _parse_marker(marker):
-    """Return (timeout, method) tuple from marker
+    """Return (timeout, method) tuple from marker.
 
     Either could be None.  The values are not interpreted, so
     could still be bogus and even the wrong type.
@@ -277,7 +327,6 @@
 
 
 def _validate_timeout(timeout, where):
-    """Helper for get_params()"""
     if timeout is None:
         return None
     try:
@@ -287,7 +336,6 @@
 
 
 def _validate_method(method, where):
-    """Helper for get_params()"""
     if method is None:
         return None
     if method not in ["signal", "thread"]:
@@ -296,7 +344,6 @@
 
 
 def _validate_func_only(func_only, where):
-    """Helper for get_params()"""
     if func_only is None:
         return False
     if not isinstance(func_only, bool):
@@ -305,13 +352,13 @@
 
 
 def timeout_sigalrm(item, timeout):
-    """Dump stack of threads and raise an exception
+    """Dump stack of threads and raise an exception.
 
     This will output the stacks of any threads other then the
     current to stderr and then raise an AssertionError, thus
     terminating the test.
     """
-    if SUPPRESS_TIMEOUT:
+    if is_debugging():
         return
     __tracebackhide__ = True
     nthreads = len(threading.enumerate())
@@ -324,12 +371,12 @@
 
 
 def timeout_timer(item, timeout):
-    """Dump stack of threads and call os._exit()
+    """Dump stack of threads and call os._exit().
 
     This disables the capturemanager and dumps stdout and stderr.
     Then the stacks are dumped and os._exit(1) is called.
     """
-    if SUPPRESS_TIMEOUT:
+    if is_debugging():
         return
     try:
         capman = item.config.pluginmanager.getplugin("capturemanager")
@@ -366,7 +413,7 @@
 
 
 def dump_stacks():
-    """Dump the stacks of all threads except the current thread"""
+    """Dump the stacks of all threads except the current thread."""
     current_ident = threading.current_thread().ident
     for thread_ident, frame in sys._current_frames().items():
         if thread_ident == current_ident:
@@ -382,7 +429,7 @@
 
 
 def write_title(title, stream=None, sep="~"):
-    """Write a section title
+    """Write a section title.
 
     If *stream* is None sys.stderr will be used, *sep* is used to
     draw the line.
@@ -398,7 +445,7 @@
 
 
 def write(text, stream=None):
-    """Write text to stream
+    """Write text to stream.
 
     Pretty stupid really, only here for symetry with .write_title().
     """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/setup.py 
new/pytest-timeout-1.4.1/setup.py
--- old/pytest-timeout-1.3.4/setup.py   2019-11-20 23:19:15.000000000 +0100
+++ new/pytest-timeout-1.4.1/setup.py   2020-06-15 21:22:37.000000000 +0200
@@ -1,3 +1,4 @@
+"""Setuptools install script for pytest-timeout."""
 import io
 
 from setuptools import setup
@@ -10,7 +11,7 @@
     name="pytest-timeout",
     description="py.test plugin to abort hanging tests",
     long_description=long_description,
-    version="1.3.4",
+    version="1.4.1",
     author="Floris Bruynooghe",
     author_email="f...@devork.be",
     url="http://github.com/pytest-dev/pytest-timeout/";,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/test_pytest_timeout.py 
new/pytest-timeout-1.4.1/test_pytest_timeout.py
--- old/pytest-timeout-1.3.4/test_pytest_timeout.py     2019-11-20 
21:55:37.000000000 +0100
+++ new/pytest-timeout-1.4.1/test_pytest_timeout.py     2020-06-15 
21:19:02.000000000 +0200
@@ -1,5 +1,6 @@
 import os.path
 import signal
+import sys
 import time
 
 import pexpect
@@ -71,6 +72,33 @@
     assert "++ Timeout ++" in result.stderr.lines[-1]
 
 
+@pytest.mark.skipif(
+    hasattr(sys, "pypy_version_info"), reason="pypy coverage seems broken 
currently"
+)
+def test_cov(testdir):
+    # This test requires pytest-cov
+    testdir.makepyfile(
+        """
+        import time
+
+        def test_foo():
+            time.sleep(2)
+    """
+    )
+    result = testdir.runpytest(
+        "--timeout=1", "--cov=test_cov.py", "--timeout-method=thread"
+    )
+    result.stderr.fnmatch_lines(
+        [
+            "*++ Timeout ++*",
+            "*~~ Stack of MainThread* ~~*",
+            "*File *, line *, in *",
+            "*++ Timeout ++*",
+        ]
+    )
+    assert "++ Timeout ++" in result.stderr.lines[-1]
+
+
 def test_timeout_env(testdir, monkeypatch):
     testdir.makepyfile(
         """
@@ -389,24 +417,47 @@
     result.stdout.fnmatch_lines(["@pytest.mark.timeout(*"])
 
 
+@pytest.mark.parametrize(
+    ["debugging_module", "debugging_set_trace"],
+    [
+        ("pdb", "set_trace()"),
+        pytest.param(
+            "ipdb",
+            "set_trace()",
+            marks=pytest.mark.xfail(
+                reason="waiting on 
https://github.com/pytest-dev/pytest/pull/7207";
+                " to allow proper testing"
+            ),
+        ),
+        pytest.param(
+            "pydevd",
+            "settrace(port=4678)",
+            marks=pytest.mark.xfail(reason="in need of way to setup pydevd 
server"),
+        ),
+    ],
+)
 @have_spawn
-def test_suppresses_timeout_when_pdb_is_entered(testdir):
-    pytest.importorskip("pexpect")
+def test_suppresses_timeout_when_debugger_is_entered(
+    testdir, debugging_module, debugging_set_trace
+):
     p1 = testdir.makepyfile(
         """
-        import pytest, pdb
+        import pytest, {debugging_module}
 
         @pytest.mark.timeout(1)
         def test_foo():
-            pdb.set_trace()
-    """
+            {debugging_module}.{debugging_set_trace}
+    """.format(
+            debugging_module=debugging_module, 
debugging_set_trace=debugging_set_trace
+        )
     )
     child = testdir.spawn_pytest(str(p1))
     child.expect("test_foo")
     time.sleep(2)
     child.send("c\n")
     child.sendeof()
-    result = child.read()
+    result = child.read().decode().lower()
     if child.isalive():
-        child.wait()
-    assert b"Timeout >1.0s" not in result
+        child.terminate(force=True)
+    assert "timeout >1.0s" not in result
+    assert "fail" not in result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pytest-timeout-1.3.4/tox.ini 
new/pytest-timeout-1.4.1/tox.ini
--- old/pytest-timeout-1.3.4/tox.ini    2020-01-06 20:20:12.000000000 +0100
+++ new/pytest-timeout-1.4.1/tox.ini    2020-06-15 20:55:30.000000000 +0200
@@ -8,7 +8,9 @@
 [testenv]
 deps = pytest
     pexpect
-commands = py.test {posargs}
+    ipdb
+    pytest-cov
+commands = pytest {posargs}
 
 [testenv:linting]
 skip_install = True


Reply via email to