Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix session param in tests #652

Merged
merged 3 commits into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,13 @@ def sess():
return session


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


@pytest.fixture(scope="session")
def account():
def account(sess):
if SERVER_TOKEN:
return get_account()
return MyPlexAccount(session=sess)
assert MYPLEX_USERNAME, "Required MYPLEX_USERNAME not specified."
assert MYPLEX_PASSWORD, "Required MYPLEX_PASSWORD not specified."
return get_account()
return MyPlexAccount(session=sess)


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -163,7 +159,7 @@ def plex(request, sess):
assert SERVER_BASEURL, "Required SERVER_BASEURL not specified."

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