• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

amoffat / HeimdaLLM / 5502557808

pending completion
5502557808

push

github

web-flow
Merge pull request #8 from amoffat/feature/mysql

Feature/mysql

320 of 362 branches covered (88.4%)

Branch coverage included in aggregate %.

159 of 159 new or added lines in 14 files covered. (100.0%)

1533 of 1605 relevant lines covered (95.51%)

0.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.85
/heimdallm/bifrosts/sql/sqlite/tests/sql/utils.py
1
import pytest
1✔
2

3

4
def dialects(*dialects, bifrost=True, envelope=False, conn=False):
1✔
5
    """
6
    Decorator to run a test against multiple SQL dialects.
7

8
    :param dialects: dialects to test, defaults to ``("sqlite", "mysql")`` if not
9
        specified.
10
    :param bifrost: Whether to pass a ``Bifrost`` class into the test.
11
    :param envelope: Whether to pass a ``PromptEnvelope`` class into the test.
12
    """
13
    dialects = dialects or ("sqlite", "mysql")
1✔
14

15
    def map_dialect(d: str):
1✔
16
        args = []
1✔
17

18
        if bifrost:
1✔
19
            bf_mod = __import__(f"heimdallm.bifrosts.sql.{d}.select.bifrost")
1✔
20
            bifrost_cls = getattr(bf_mod.bifrosts.sql, d).select.bifrost.Bifrost
1✔
21
            bifrost_cls.dialect = d
1✔
22
            args.append(bifrost_cls)
1✔
23

24
        if envelope:
1✔
25
            env_mod = __import__(f"heimdallm.bifrosts.sql.{d}.select.envelope")
1✔
26
            envelope_cls = getattr(
1✔
27
                env_mod.bifrosts.sql, d
28
            ).select.envelope.PromptEnvelope
29
            envelope_cls.dialect = d
1✔
30
            args.append(envelope_cls)
1✔
31

32
        if conn:
1!
33
            if d == "sqlite":
×
34
                pass
×
35

36
        if len(args) == 1:
1!
37
            return args[0]
1✔
38
        return args
×
39

40
    args = []
1✔
41
    if bifrost:
1✔
42
        args.append("Bifrost")
1✔
43
    if envelope:
1✔
44
        args.append("PromptEnvelope")
1✔
45
    if conn:
1!
46
        args.append("conn")
×
47

48
    return pytest.mark.parametrize(
1✔
49
        ",".join(args),
50
        [map_dialect(d) for d in dialects],
51
        ids=dialects,
52
    )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc