mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-20 20:44:17 +02:00
fix: filter warnings by message in KEY_PREFIX test (#3549)
This commit is contained in:
parent
62dcea64c2
commit
a50dcd8705
1 changed files with 8 additions and 3 deletions
|
|
@ -237,8 +237,10 @@ class TestKeyPrefix:
|
|||
class NoPrefix(FastMCPComponent):
|
||||
pass
|
||||
|
||||
assert len(w) == 1
|
||||
assert "NoPrefix does not define KEY_PREFIX" in str(w[0].message)
|
||||
key_prefix_warnings = [
|
||||
x for x in w if "does not define KEY_PREFIX" in str(x.message)
|
||||
]
|
||||
assert len(key_prefix_warnings) == 1
|
||||
|
||||
def test_no_warning_when_key_prefix_defined(self):
|
||||
"""Test that subclassing with KEY_PREFIX does not emit a warning."""
|
||||
|
|
@ -248,7 +250,10 @@ class TestKeyPrefix:
|
|||
class WithPrefix(FastMCPComponent):
|
||||
KEY_PREFIX = "custom"
|
||||
|
||||
assert len(w) == 0
|
||||
key_prefix_warnings = [
|
||||
x for x in w if "does not define KEY_PREFIX" in str(x.message)
|
||||
]
|
||||
assert len(key_prefix_warnings) == 0
|
||||
assert WithPrefix.make_key("test") == "custom:test"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue