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

Update code to ensure tests pass correctly in more modern verisons of python #134

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

MoralCode
Copy link

This PR attempts to fix the unit tests in the cleanest way possible with minimal changes to existing functionality.

Changes include:

  • sqlite databases used for tests are now saved to the output directory with the generated images (instead of in-memory) to allow failed tests to be more easily debugged
  • some fixes were made to attachments.py to correct an issue where thumbnails were not being correctly saved to an Image object, causing test failures (fixes unit tests failing in newer python versions (3.8) because self.thumbnails cannot be appended to #133)
  • more assertions were added to better detect the previous issue
  • some tweaks were mane to the Image unit tests to ensure that objects from the previous session weren't being reused in a new session (seemingly intended to simulate retrieval from the DB at a later time) and causing sqlalchemy to crash
  • small tweaks to variable names in image tests to make the intention clearer and prevent potential issues with variable shadowing
  • corrected typos in file and class naming for the GoogleCloudStorage class to allow the test to properly load
  • updated mocks and the file paths to the stuff/cat.jpg image in GoogleCloudStorage tests so the tests actually run

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.

unit tests failing in newer python versions (3.8) because self.thumbnails cannot be appended to
1 participant