Skip to content
Myr

Fixed a broken test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent fb62238 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:flask/testsuite/basic.py+6 added-6 removed
9 unmodified lines
10"""1112import re13import uuid14import time15import flask16import pickle17import unittest18from datetime import datetime18from threading import Thread, Condition19from threading import Thread20from flask.testsuite import FlaskTestCase, emits_module_deprecation_warning21from flask._compat import text_type22from werkzeug.exceptions import BadRequest, NotFound23from werkzeug.http import parse_date
994 unmodified lines
10181019 def test_before_first_request_functions_concurrent(self):1020 got = []1021 app = flask.Flask(__name__)1021 cv = Condition()10221023 @app.before_first_request1024 def foo():1024 with cv:1025 cv.wait()1025 time.sleep(0.2)1026 got.append(42)10271028 c = app.test_client()1029 def get_and_assert():1029 with cv:1030 cv.notify()1030 c.get("/")1031 self.assert_equal(got, [42])10321033 t = Thread(target=get_and_assert)1034 t.start()1035 get_and_assert()1036 t.join()
239 unmodified lines