question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CherryPy - Pytest hangs with default "interactive" mode

See original GitHub issue

I’m submitting a …

  • bug report
  • feature request
  • question about the decisions made in the repository

Do you want to request a feature or report a bug? A “feature” request, mostly for the documentation rather than for the actual code of Cherrypy.

What is the current behavior? Running Cherrypy helper.CPWebCase tests hangs on failed assertions due to interactive mode, that can be disabled with helper.CPWebCase.interactive = False or through an enviroment variable (WEBTEST_INTERACTIVE). But I had to look at the source code of CPWebCase to understand what was going on, with trial and error. I was not able to find documentation about this behaviour until I found this page: https://schneide.blog/2017/02/06/integration-tests-with-cherrypy-and-requests/ that reported my exact problem (read the first lines of the article).

If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.

A minimal example to reproduce the problem (tries to get a not existing url):

from cherrypy.test import helper

class TestSample(helper.CPWebCase):

    def test_sample(self):
        self.getPage('/')
        self.assertStatus("200 OK")

The test will hang forever if “interactive” is True.

What is the expected behavior? Please tell why “interactive” is true by default and why there is no documentation about the possibility to disable it/how to disable it.

Please tell us about your environment:

  • Cheroot version: 6.5.5
  • CherryPy version: 18.1.2
  • Python version: 3.7.3
  • OS: Windows
  • Browser: not relevant.
  • pytest: 5.0.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
stemosercommented, Aug 12, 2019

Ok! Not sure when, but I will try to do it. 😃

0reactions
webknjazcommented, Aug 12, 2019

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

pycharm pytest hangs with python subprocess.run() using ...
I want to test a subprocess call in python that uses the interactive shell in linux. The interactive shell is necessary in order...
Read more >
On putting the test suite in order - Google Groups
Now it's always on, and doesn't hang only because ``old_settings = termios.tcgetattr(fd)`` throws some terminal exception in ``webtest.getchar``. I'll turn `` ...
Read more >
Advanced — CherryPy 18.6.1.dev49+g98929b51.d20210117 ...
The default dispatcher cannot deal with that scenario on its own because it ... inside an IDE) is to disable the interactive mode...
Read more >
PyPy test hangs on test_conn · Issue #21 · cherrypy/cheroot
Beginning with 3e1efa3, in test_conn, the test is consistently hanging in Travis. As you can see, the only changes were to the project ......
Read more >
CherryPy Documentation - Read the Docs
Notice how we benefit from Python's default arguments' values to support URLs ... so that they are called when the server starts and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found