You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using the "Dynamic LiveServerTestCase port" feature as described in the docs. I am setting the LIVESERVER_PORT setting to 0 but the test server always falls back to flask default, port 5000. This failing python2 test case illustrates this:
from urllib2 import urlopen
from flask import Flask
from flask_testing import LiveServerTestCase
class MyTest(LiveServerTestCase):
def create_app(self):
app = Flask(__name__)
app.config['TESTING'] = True
# Default port is 5000
app.config['LIVESERVER_PORT'] = 0
# Default timeout is 5 seconds
app.config['LIVESERVER_TIMEOUT'] = 10
return app
def test_server_doesnt_use_flask_default_port(self):
self.assertNotEqual(self.get_server_url(), 'http://localhost:5000')
The text was updated successfully, but these errors were encountered:
I tried using the "Dynamic LiveServerTestCase port" feature as described in the docs. I am setting the
LIVESERVER_PORT
setting to0
but the test server always falls back to flask default, port 5000. This failing python2 test case illustrates this:The text was updated successfully, but these errors were encountered: