Skip to content

Commit

Permalink
increase the timeout. (#634)
Browse files Browse the repository at this point in the history
* Lets try to increate the timeout.

* fix typo
  • Loading branch information
Hellowlol authored Jan 27, 2021
1 parent d3fbc4f commit 5b4add3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ def pytest_runtest_setup(item):
# ---------------------------------


def get_account():
return MyPlexAccount()
@pytest.fixture(scope="session")
def sess():
session = requests.Session()
session.request = partial(session.request, timeout=120)
return session


def get_account(sess):
return MyPlexAccount(session=sess)


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -152,14 +159,14 @@ def mocked_account(requests_mock):


@pytest.fixture(scope="session")
def plex(request):
def plex(request, sess):
assert SERVER_BASEURL, "Required SERVER_BASEURL not specified."
session = requests.Session()

if request.param == TEST_AUTHENTICATED:
token = get_account().authenticationToken
else:
token = None
return PlexServer(SERVER_BASEURL, token, session=session)
return PlexServer(SERVER_BASEURL, token, session=sess)


@pytest.fixture(scope="session")
Expand All @@ -168,7 +175,7 @@ def sync_device(account_synctarget):
device = account_synctarget.device(clientId=SYNC_DEVICE_IDENTIFIER)
except NotFound:
device = createMyPlexDevice(SYNC_DEVICE_HEADERS, account_synctarget)

assert device
assert "sync-target" in device.provides
return device
Expand Down

0 comments on commit 5b4add3

Please sign in to comment.