Skip to content

Conversation

@igorcoding
Copy link
Owner

No description provided.

igorcoding and others added 2 commits January 19, 2026 12:56
- Replace unittest.TestCase with pytest-style test classes
- Add conftest.py with fixtures for Tarantool instances and connections
- Convert ensure_version from inline function to decorator
- Add min_bin_version marker for binary version checks at collection time
- Move assertions to tests/utils/assertions.py
- Remove _testbase.py (replaced by conftest.py fixtures)
- Update all test files to use pytest fixtures and decorators

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@igorcoding igorcoding changed the base branch from main to python314-support January 20, 2026 08:31
igorcoding and others added 10 commits January 20, 2026 12:42
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- test_connect_wait_tnt_started
- test_connect_waiting_for_spaces
- test_connect_waiting_for_spaces_no_reconnect
- test_connect_waiting_for_spaces_no_reconnect_1_6
- test_connect_err_loading
- test_connect_err_loading_1_6
- test_connect_invalid_user_no_reconnect
- test_connect_invalid_user_with_reconnect

Also add replication_source parameter to create_tarantool_instance()

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add pytest hooks to register and handle the min_bin_version marker:
- pytest_configure: registers the marker
- pytest_collection_modifyitems: skips tests based on Tarantool binary version
- get_tarantool_bin_version: caches the version from a temporary instance

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Separates version-checking logic into a reusable check_version function
that can be called directly in tests, while ensure_version decorator
now delegates to it for cleaner code organization.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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 pull request migrates the test suite from unittest to pytest, a significant refactoring effort that modernizes the testing infrastructure.

Changes:

  • Replaced unittest framework with pytest and pytest-asyncio
  • Created new conftest.py with pytest fixtures for Tarantool instances and connections
  • Added utility modules for assertions and test parameters
  • Migrated all test files to use pytest-style fixtures and assertions
  • Updated documentation and project configuration

Reviewed changes

Copilot reviewed 23 out of 25 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
tests/conftest.py New pytest configuration with fixtures for Tarantool instances, connections, and version checking
tests/utils/params.py Helper functions for generating test parameters
tests/utils/assertions.py Custom assertion helpers replacing unittest assertions
tests/test_*.py All test files migrated from unittest to pytest style
tests/init.py Simplified after removing unittest infrastructure
tests/_testbase.py Deleted old unittest base classes
pyproject.toml Updated pytest configuration and dependencies
CLAUDE.md Updated documentation to reflect pytest usage
asynctnt/instance.py Added missing extra_box_cfg parameter to TarantoolSyncDockerInstance

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


import pytest

import asynctnt
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Module 'asynctnt' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.

import pytest

import asynctnt
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Module 'asynctnt' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.

import pytest

import asynctnt
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Module 'asynctnt' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.

import pytest

import asynctnt
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Module 'asynctnt' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.

import pytest

import asynctnt
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Module 'asynctnt' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.
finally:
try:
await conn.call("truncate", timeout=5)
except Exception:
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except Exception:
except Exception:
# Best-effort cleanup: ignore errors during truncate to not mask test result.

Copilot uses AI. Check for mistakes.
finally:
try:
await conn.call("truncate", timeout=5)
except Exception:
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except Exception:
except Exception:
# Ignore errors during cleanup: truncate may fail if the helper
# function/space is missing or the connection is already closed.

Copilot uses AI. Check for mistakes.
finally:
try:
await conn.call("truncate", timeout=5)
except Exception:
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except Exception:
except Exception:
# Best-effort cleanup: ignore errors during truncate in test teardown.

Copilot uses AI. Check for mistakes.
finally:
try:
await conn.call("truncate", timeout=5)
except Exception:
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except Exception:
except Exception:
# Best-effort cleanup: ignore errors during truncate so they don't mask test results.

Copilot uses AI. Check for mistakes.
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