Skip to content

fix(testing): MockContext ignores its dialect argument #399

Description

@gazorby

MockContext.__post_init__ (src/strawchemy/testing/__init__.py:19) sets dialect.name = "postgresql" whatever dialect is given, so its dialect field is never read.

MockContext("sqlite").session.get_bind().dialect.name  # "postgresql"

This predates the pytest plugin removal (d1d5bbf); the old pytest_plugin.py did the same. Every test passes "postgresql", so nothing catches it.

Fix: use self.dialect. Now that the plugin is gone, it may also be worth deciding whether MockContext stays public.

Activity

  1. added a commit that references this issue on Sep 30, 2026
  2. gazorby commented on Sep 30, 2026

    @gazorby
    OwnerAuthor

    Fixed in #404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions