feat: basefiles
This commit is contained in:
commit
bdf9e90efa
16 changed files with 1299 additions and 0 deletions
26
tests/test_muzzle.py
Normal file
26
tests/test_muzzle.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import pytest
|
||||
|
||||
import shush
|
||||
|
||||
|
||||
def test_muzzle(caplog, logger):
|
||||
@shush.muzzle("foo")
|
||||
def muzzled_func():
|
||||
logger.info("this contains `foo` so it should be muzzled out")
|
||||
logger.info("this doesn't contain it so it should be showing")
|
||||
|
||||
muzzled_func()
|
||||
assert caplog.text == ("INFO test_logger:test_muzzle.py:10 "
|
||||
"this doesn't contain it so it should be showing\n")
|
||||
|
||||
|
||||
@pytest.mark.anyio()
|
||||
async def test_muzzle_async(caplog, logger):
|
||||
@shush.muzzle("foo")
|
||||
async def muzzled_func():
|
||||
logger.info("this contains `foo` so it should be muzzled out")
|
||||
logger.info("this doesn't contain it so it should be showing")
|
||||
|
||||
await muzzled_func()
|
||||
assert caplog.text == ("INFO test_logger:test_muzzle.py:22 "
|
||||
"this doesn't contain it so it should be showing\n")
|
||||
Loading…
Add table
Add a link
Reference in a new issue