Skip to content

Fix tests#1587

Merged
JonnyWong16 merged 3 commits intopushingkarmaorg:masterfrom
JonnyWong16:hotfix/fix_tests
Feb 14, 2026
Merged

Fix tests#1587
JonnyWong16 merged 3 commits intopushingkarmaorg:masterfrom
JonnyWong16:hotfix/fix_tests

Conversation

@JonnyWong16
Copy link
Collaborator

Description

  • Change Pillow Image.getdata() to Image.get_flattened_data()
  • Mark Movie on-demand subtitle test as xfail
  • Fix JWT login test

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

Pillow DeprecationWarning: Image.Image.getdata is deprecated and will be removed in Pillow 14 (2027-10-15). Use get_flattened_data instead.
Copilot AI review requested due to automatic review settings February 14, 2026 02:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to fix three test-related issues: changing a Pillow API method call, marking a flaky test as xfail, and refactoring the JWT login test to not depend on the createMyPlexDevice utility function. However, one of the changes introduces a critical bug.

Changes:

  • Added @pytest.mark.xfail to the on-demand subtitles test to handle intermittent OpenSubtitles timeouts
  • Refactored JWT login test to manually create device using MyPlexPinLogin instead of createMyPlexDevice helper
  • Attempted to update Pillow API from getdata() to get_flattened_data() (this is incorrect)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_video.py Marks flaky OpenSubtitles test as expected failure
tests/test_myplex.py Refactors JWT test to manually implement device creation/deletion with MyPlexPinLogin and generateUUID
tests/conftest.py Attempts to change Pillow Image API method (introduces a bug)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bias = ImageStat.Stat(thumb).mean[:3]
bias = [b - sum(bias) / 3 for b in bias]
for pixel in thumb.getdata():
for pixel in thumb.get_flattened_data():
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method get_flattened_data() does not exist in the Pillow (PIL) library. The correct method is getdata(), which returns a sequence of pixel values. This change will cause a runtime AttributeError when the function is called. The original code using thumb.getdata() was correct and should be reverted.

Suggested change
for pixel in thumb.get_flattened_data():
for pixel in thumb.getdata():

Copilot uses AI. Check for mistakes.
@JonnyWong16 JonnyWong16 merged commit 1c47a8f into pushingkarmaorg:master Feb 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant