Replace httpretty with requests-mock, update runtimes and add type annotations#24
Merged
rkoopmans merged 5 commits intotinify:masterfrom Mar 18, 2025
Merged
Replace httpretty with requests-mock, update runtimes and add type annotations#24rkoopmans merged 5 commits intotinify:masterfrom
rkoopmans merged 5 commits intotinify:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the test suite to replace HTTPretty with requests-mock and adjusts the supported runtimes. Key changes include converting tests from unittest to pytest style, revising mocking handlers and fixtures accordingly, and updating runtime support (dropping Python 3.7 and adding Python 3.12/3.13).
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/conftest.py | Introduces new pytest fixtures including dummy_file and reset_tinify fixtures; adds a mock_requests fixture using requests-mock. |
| test/integration.py | Refactors integration tests to pytest-style functions and updates assertions. |
| test/tinify_test.py | Converts tests from HTTPretty-based mocking to using requests-mock; updates client and app identifier tests. |
| test/tinify_result_meta_test.py | Updates meta tests to use pytest fixtures and assertions. |
| test/tinify_result_test.py | Rewrites result tests in pytest style with streamlined assertions. |
| setup.py | Updates installation and test dependencies; revises package metadata and classifiers. |
| CHANGES.md | Documents runtime support changes and the switch from HTTPretty to requests-mock. |
| .github/workflows/ci-cd.yml | Adjusts the testing matrix to match the new runtime support. |
| test/tinify_source_test.py | Refactors source tests to pytest style; updates mocking logic and helper functions. |
| tinify/version.py | Bumps the version to 1.6.1. |
| test/helper.py | Removes deprecated helper methods previously based on HTTPretty. |
Comments suppressed due to low confidence (2)
setup.py:40
- The classifiers still list Python 2.7 even though the changelog indicates dropping Python 3.7; please verify the intended supported Python versions and update the classifiers accordingly to avoid confusion.
"Programming Language :: Python :: 2.7",
test/tinify_source_test.py:11
- [nitpick] Consider removing this duplicate helper function if a shared version exists in the conftest.py to reduce code duplication and maintain a single source of truth for temporary file creation.
def create_named_tmpfile():
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.