Simplify test by removing ThreadPool

This commit is contained in:
richard-dds 2018-06-14 13:10:19 -04:00
parent e89be59d3e
commit 606bd61d3a

View File

@ -1,7 +1,7 @@
import re
import pytest
import tornado.web
from concurrent.futures import ThreadPoolExecutor
import tornado.gen
@pytest.mark.gen_test
@ -17,10 +17,13 @@ def test_redirects_when_not_logged_in(http_client, base_url):
@pytest.mark.gen_test
def test_login_with_valid_bearer_token(app, monkeypatch, http_client, base_url):
with ThreadPoolExecutor(max_workers=1) as executor:
@tornado.gen.coroutine
def _validate_login_token(c, t):
return True
monkeypatch.setattr(
"atst.handlers.login.Login._validate_login_token",
lambda c,t: executor.submit(lambda: True),
_validate_login_token
)
response = yield http_client.fetch(
base_url + "/login?bearer-token=abc-123",