-
Notifications
You must be signed in to change notification settings - Fork 46
test(pytest): significantly increased amout of tests #108
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
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this 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 significantly expands the test suite for pycouchdb by adding comprehensive pytest-based unit tests across all major components. The testing infrastructure was completely rewritten to use modern pytest fixtures and mocking patterns.
- Complete refactoring from the old functional tests to comprehensive unit test coverage
- Addition of extensive test coverage for all core modules (client, resource, utils, exceptions, feedreader)
- Implementation of proper pytest configuration with fixtures, markers, and CI integration improvements
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_utils.py | Comprehensive unit tests for utility functions including URL handling, encoding, and data conversion |
| test/test_server.py | Complete test coverage for Server class including initialization, database operations, and changes feed |
| test/test_resource.py | Full test suite for Resource class covering HTTP operations, authentication, and error handling |
| test/test_functional.py | Legacy functional test file removed in favor of new comprehensive unit tests |
| test/test_feedreader.py | Tests for feed reader classes including inheritance and callback handling |
| test/test_exceptions.py | Tests for all exception classes and their inheritance hierarchy |
| test/test_database.py | Extensive Database class tests covering all CRUD operations, views, and attachments |
| test/integration/conftest.py | Integration test fixtures and configuration for CouchDB-dependent tests |
| test/integration/README.md | Documentation for running integration tests with CouchDB requirements |
| test/conftest.py | Shared pytest fixtures and configuration for unit tests |
| pyproject.toml | Updated pytest configuration with comprehensive testing dependencies and settings |
| README.md | Updated coverage badge to use codecov instead of coveralls |
| .github/workflows/main.yml | Restructured CI workflow with separate unit and integration test jobs plus coverage reporting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| """ | ||
| Unit tests for pycouchdb.utils module. | ||
| """ |
Copilot
AI
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title in the PR metadata contains a spelling error: 'amout' should be 'amount'.
| doc = db.get("kk1") | ||
| att = tmpdir.join('sample.txt') | ||
| att.write(b"Hello") | ||
| with open(str(att)) as f: |
Copilot
AI
Sep 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is opened in text mode but the fixture earlier writes bytes to the file. This will cause an encoding error. Either write text to the file or open it in binary mode with 'rb'.
| with open(str(att)) as f: | |
| with open(str(att), "rb") as f: |
No description provided.