miguelgrinberg / flasky

Companion code to my O'Reilly book "Flask Web Development", second edition.
MIT License
8.54k stars 4.21k forks source link

Testing Chapter - Selenium Code is not executing via unittest test runner #494

Closed ParthiBa closed 3 years ago

ParthiBa commented 3 years ago

Code version Tag 15d File path : tests/test_seleninum.py

image

Unit test runner is not executing app.run() . So I have headless chrome opened and as per selenium script . URL is changing as per script . But Since application is not started and entire test script fails

miguelgrinberg commented 3 years ago

Unfortunately this is an issue in Flask. See https://github.com/pallets/flask/issues/2776.

ParthiBa commented 3 years ago

Is there any way to overcome this issue and execute the test_selenium ? Is there any other code that I can change and exexute that file ? How about flask shell ?

miguelgrinberg commented 3 years ago

You can make it work if you revert to an older version of Flask that does not have this bug. The version in the requirements works fine, if I remember correctly.

Aside from that, you can manually start the server via flask run, and then run your test suite while the manually started server is active.