Skip to content

Conversation

@histrio
Copy link
Owner

@histrio histrio commented Sep 8, 2025

No description provided.

@codecov-commenter
Copy link

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 ☂️

@histrio histrio requested a review from Copilot September 8, 2025 12:16
Copy link

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 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.

Comment on lines +1 to +3
"""
Unit tests for pycouchdb.utils module.
"""
Copy link

Copilot AI Sep 8, 2025

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'.

Copilot uses AI. Check for mistakes.
doc = db.get("kk1")
att = tmpdir.join('sample.txt')
att.write(b"Hello")
with open(str(att)) as f:
Copy link

Copilot AI Sep 8, 2025

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'.

Suggested change
with open(str(att)) as f:
with open(str(att), "rb") as f:

Copilot uses AI. Check for mistakes.
@histrio histrio merged commit 1159476 into master Sep 8, 2025
24 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.

2 participants