Skip to content

back to OpenHands summary

OpenHands: loguru

Pytest Summary for test tests

status count
passed 218
failed 1217
skipped 38
total 1473
collected 1473

Failed pytests:

test_activation.py::test_disable[test-True]

test_activation.py::test_disable[test-True]
writer = .w at 0x7fac0b7520e0>, name = 'test'
should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", False),
            ("tests", False),
            ("test", True),
            ("testss", True),
            ("tests.", True),
            ("tests.test_activation", False),
            ("tests.test_activation.", True),
            ("test_activation", True),
            (".", True),
        ],
    )
    def test_disable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'test'
result     = ''
should_log = True
writer     = .w at 0x7fac0b7520e0>

tests/test_activation.py:27: AssertionError

test_activation.py::test_disable[testss-True]

test_activation.py::test_disable[testss-True]
writer = .w at 0x7fac0b753b50>, name = 'testss'
should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", False),
            ("tests", False),
            ("test", True),
            ("testss", True),
            ("tests.", True),
            ("tests.test_activation", False),
            ("tests.test_activation.", True),
            ("test_activation", True),
            (".", True),
        ],
    )
    def test_disable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'testss'
result     = ''
should_log = True
writer     = .w at 0x7fac0b753b50>

tests/test_activation.py:27: AssertionError

test_activation.py::test_disable[tests.-True]

test_activation.py::test_disable[tests.-True]
writer = .w at 0x7fac0b753ac0>, name = 'tests.'
should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", False),
            ("tests", False),
            ("test", True),
            ("testss", True),
            ("tests.", True),
            ("tests.test_activation", False),
            ("tests.test_activation.", True),
            ("test_activation", True),
            (".", True),
        ],
    )
    def test_disable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'tests.'
result     = ''
should_log = True
writer     = .w at 0x7fac0b753ac0>

tests/test_activation.py:27: AssertionError

test_activation.py::test_disable[tests.test_activation.-True]

test_activation.py::test_disable[tests.test_activation.-True]
writer = .w at 0x7fac0b753c70>
name = 'tests.test_activation.', should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", False),
            ("tests", False),
            ("test", True),
            ("testss", True),
            ("tests.", True),
            ("tests.test_activation", False),
            ("tests.test_activation.", True),
            ("test_activation", True),
            (".", True),
        ],
    )
    def test_disable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'tests.test_activation.'
result     = ''
should_log = True
writer     = .w at 0x7fac0b753c70>

tests/test_activation.py:27: AssertionError

test_activation.py::test_disable[test_activation-True]

test_activation.py::test_disable[test_activation-True]
writer = .w at 0x7fac0b753e20>
name = 'test_activation', should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", False),
            ("tests", False),
            ("test", True),
            ("testss", True),
            ("tests.", True),
            ("tests.test_activation", False),
            ("tests.test_activation.", True),
            ("test_activation", True),
            (".", True),
        ],
    )
    def test_disable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'test_activation'
result     = ''
should_log = True
writer     = .w at 0x7fac0b753e20>

tests/test_activation.py:27: AssertionError

test_activation.py::test_disable[.-True]

test_activation.py::test_disable[.-True]
writer = .w at 0x7fac0b753490>, name = '.'
should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", False),
            ("tests", False),
            ("test", True),
            ("testss", True),
            ("tests.", True),
            ("tests.test_activation", False),
            ("tests.test_activation.", True),
            ("test_activation", True),
            (".", True),
        ],
    )
    def test_disable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = '.'
result     = ''
should_log = True
writer     = .w at 0x7fac0b753490>

tests/test_activation.py:27: AssertionError

test_activation.py::test_enable[-True]

test_activation.py::test_enable[-True]
writer = .w at 0x7fac0b7536d0>, name = ''
should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", True),
            ("tests", True),
            ("test", False),
            ("testss", False),
            ("tests.", False),
            ("tests.test_activation", True),
            ("tests.test_activation.", False),
            ("test_activation", False),
            (".", False),
        ],
    )
    def test_enable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable("")
        logger.enable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = ''
result     = ''
should_log = True
writer     = .w at 0x7fac0b7536d0>

tests/test_activation.py:54: AssertionError

test_activation.py::test_enable[tests-True]

test_activation.py::test_enable[tests-True]
writer = .w at 0x7fac0b753760>, name = 'tests'
should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", True),
            ("tests", True),
            ("test", False),
            ("testss", False),
            ("tests.", False),
            ("tests.test_activation", True),
            ("tests.test_activation.", False),
            ("test_activation", False),
            (".", False),
        ],
    )
    def test_enable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable("")
        logger.enable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'tests'
result     = ''
should_log = True
writer     = .w at 0x7fac0b753760>

tests/test_activation.py:54: AssertionError

test_activation.py::test_enable[tests.test_activation-True]

test_activation.py::test_enable[tests.test_activation-True]
writer = .w at 0x7fac0b752b90>
name = 'tests.test_activation', should_log = True

    @pytest.mark.parametrize(
        "name, should_log",
        [
            ("", True),
            ("tests", True),
            ("test", False),
            ("testss", False),
            ("tests.", False),
            ("tests.test_activation", True),
            ("tests.test_activation.", False),
            ("test_activation", False),
            (".", False),
        ],
    )
    def test_enable(writer, name, should_log):
        logger.add(writer, format="{message}")
        logger.disable("")
        logger.enable(name)
        logger.debug("message")
        result = writer.read()

        if should_log:
>           assert result == "message\n"
E           AssertionError: assert '' == 'message\n'
E             
E             - message

name       = 'tests.test_activation'
result     = ''
should_log = True
writer     = .w at 0x7fac0b752b90>

tests/test_activation.py:54: AssertionError

test_activation.py::test_log_before_enable

test_activation.py::test_log_before_enable
writer = .w at 0x7fac0b752320>

    def test_log_before_enable(writer):
        logger.add(writer, format="{message}")
        logger.disable("")
        logger.debug("nope")
        logger.enable("tests")
        logger.debug("yes")
        result = writer.read()
>       assert result == "yes\n"
E       AssertionError: assert '' == 'yes\n'
E         
E         - yes

result     = ''
writer     = .w at 0x7fac0b752320>

tests/test_activation.py:66: AssertionError

test_activation.py::test_log_before_disable

test_activation.py::test_log_before_disable
writer = .w at 0x7fac0b72eef0>

    def test_log_before_disable(writer):
        logger.add(writer, format="{message}")
        logger.enable("")
        logger.debug("yes")
        logger.disable("tests")
        logger.debug("nope")
        result = writer.read()
>       assert result == "yes\n"
E       AssertionError: assert '' == 'yes\n'
E         
E         - yes

result     = ''
writer     = .w at 0x7fac0b72eef0>

tests/test_activation.py:76: AssertionError

test_activation.py::test_multiple_activations

test_activation.py::test_multiple_activations
def test_multiple_activations():
        def n():
            return len(logger._core.activation_list)

        assert n() == 0
        logger.enable("")
        assert n() == 0
        logger.disable("")
>       assert n() == 1
E       assert 0 == 1
E        +  where 0 = .n at 0x7fac0b72f010>()

n          = .n at 0x7fac0b72f010>

tests/test_activation.py:87: AssertionError

test_activation.py::test_log_before_enable_f_globals_name_absent

test_activation.py::test_log_before_enable_f_globals_name_absent
writer = .w at 0x7fac0b752710>
f_globals_name_absent = None

    def test_log_before_enable_f_globals_name_absent(writer, f_globals_name_absent):
        logger.add(writer, format="{message}")
        logger.disable(None)
        logger.debug("nope")
        logger.enable(None)
        logger.debug("yes")
        result = writer.read()
>       assert result == "yes\n"
E       AssertionError: assert '' == 'yes\n'
E         
E         - yes

f_globals_name_absent = None
result     = ''
writer     = .w at 0x7fac0b752710>

tests/test_activation.py:117: AssertionError

test_activation.py::test_log_before_disable_f_globals_name_absent

test_activation.py::test_log_before_disable_f_globals_name_absent
writer = .w at 0x7fac0b753520>
f_globals_name_absent = None

    def test_log_before_disable_f_globals_name_absent(writer, f_globals_name_absent):
        logger.add(writer, format="{message}")
        logger.enable(None)
        logger.debug("yes")
        logger.disable(None)
        logger.debug("nope")
        result = writer.read()
>       assert result == "yes\n"
E       AssertionError: assert '' == 'yes\n'
E         
E         - yes

f_globals_name_absent = None
result     = ''
writer     = .w at 0x7fac0b753520>

tests/test_activation.py:127: AssertionError

test_activation.py::test_f_globals_name_absent_with_others

test_activation.py::test_f_globals_name_absent_with_others
writer = .w at 0x7fac0b7529e0>
f_globals_name_absent = None

    def test_f_globals_name_absent_with_others(writer, f_globals_name_absent):
        logger.add(writer, format="{message}")
        logger.info("1")
        logger.enable(None)
        logger.disable("foobar")
        logger.enable("foo.bar")
        logger.disable(None)
        logger.info("2")
        logger.enable("foobar")
        logger.enable(None)
        logger.info("3")
>       assert writer.read() == "1\n3\n"
E       AssertionError: assert '' == '1\n3\n'
E         
E         - 1
E         - 3

f_globals_name_absent = None
writer     = .w at 0x7fac0b7529e0>

tests/test_activation.py:141: AssertionError

test_activation.py::test_invalid_enable_name[42]

test_activation.py::test_invalid_enable_name[42]
name = 42

    @pytest.mark.parametrize("name", [42, [], object()])
    def test_invalid_enable_name(name):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

name       = 42

tests/test_activation.py:146: Failed

test_activation.py::test_invalid_enable_name[name1]

test_activation.py::test_invalid_enable_name[name1]
name = []

    @pytest.mark.parametrize("name", [42, [], object()])
    def test_invalid_enable_name(name):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

name       = []

tests/test_activation.py:146: Failed

test_activation.py::test_invalid_enable_name[name2]

test_activation.py::test_invalid_enable_name[name2]
name = 

    @pytest.mark.parametrize("name", [42, [], object()])
    def test_invalid_enable_name(name):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

name       = 

tests/test_activation.py:146: Failed


test_activation.py::test_invalid_disable_name[42]

test_activation.py::test_invalid_disable_name[42]
name = 42

    @pytest.mark.parametrize("name", [42, [], object()])
    def test_invalid_disable_name(name):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

name       = 42

tests/test_activation.py:152: Failed

test_activation.py::test_invalid_disable_name[name1]

test_activation.py::test_invalid_disable_name[name1]
name = []

    @pytest.mark.parametrize("name", [42, [], object()])
    def test_invalid_disable_name(name):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

name       = []

tests/test_activation.py:152: Failed

test_activation.py::test_invalid_disable_name[name2]

test_activation.py::test_invalid_disable_name[name2]
name = 

    @pytest.mark.parametrize("name", [42, [], object()])
    def test_invalid_disable_name(name):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

name       = 

tests/test_activation.py:152: Failed


test_add_option_backtrace.py::test_backtrace

test_add_option_backtrace.py::test_backtrace
writer = .w at 0x7fac0b72f010>

    def test_backtrace(writer):
        logger.add(writer, format="{message}", backtrace=True)
        try:
            1 / 0  # noqa: B018
        except Exception:
            logger.exception("")
        result_with = writer.read().strip()

        logger.remove()
        writer.clear()

        logger.add(writer, format="{message}", backtrace=False)
        try:
            1 / 0  # noqa: B018
        except Exception:
            logger.exception("")
        result_without = writer.read().strip()

>       assert len(result_with.splitlines()) > len(result_without.splitlines())
E       AssertionError: assert 0 > 0
E        +  where 0 = len([])
E        +    where [] = ()
E        +      where  = ''.splitlines
E        +  and   0 = len([])
E        +    where [] = ()
E        +      where  = ''.splitlines

result_with = ''
result_without = ''
writer     = .w at 0x7fac0b72f010>

tests/test_add_option_backtrace.py:24: AssertionError

test_add_option_catch.py::test_catch_is_true

test_add_option_catch.py::test_catch_is_true
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b97a590>

    def test_catch_is_true(capsys):
        logger.add(broken_sink, catch=True)
        logger.debug("Fail")
        out, err = capsys.readouterr()
        assert out == ""
>       assert err != ""
E       AssertionError: assert '' != ''

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b97a590>
err        = ''
out        = ''

tests/test_add_option_catch.py:21: AssertionError

test_add_option_catch.py::test_catch_is_false

test_add_option_catch.py::test_catch_is_false
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b5533d0>

    def test_catch_is_false(capsys):
        logger.add(broken_sink, catch=False)
>       with pytest.raises(ValueError, match="Error!"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b5533d0>

tests/test_add_option_catch.py:26: Failed

test_add_option_catch.py::test_encoding_error

test_add_option_catch.py::test_encoding_error
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0c463d60>

    def test_encoding_error(capsys):
        def sink(m):
            raise UnicodeEncodeError("utf8", "", 10, 11, "too bad")

        logger.add(sink, catch=True)
        logger.debug("test")

        out, err = capsys.readouterr()
        lines = err.strip().splitlines()

        assert out == ""
>       assert lines[0] == "--- Logging error in Loguru Handler #0 ---"
E       IndexError: list index out of range

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0c463d60>
err        = ''
lines      = []
out        = ''
sink       = .sink at 0x7fac0b72f010>

tests/test_add_option_catch.py:64: IndexError

test_add_option_catch.py::test_unprintable_record

test_add_option_catch.py::test_unprintable_record
writer = .w at 0x7fac0b7536d0>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b52b130>

    def test_unprintable_record(writer, capsys):
        class Unprintable:
            def __repr__(self):
                raise ValueError("Failed")

        logger.add(writer, format="{message} {extra[unprintable]}", catch=True)
>       logger.bind(unprintable=1).debug("a")
E       AttributeError: 'NoneType' object has no attribute 'debug'

Unprintable = .Unprintable'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b52b130>
writer     = .w at 0x7fac0b7536d0>

tests/test_add_option_catch.py:77: AttributeError

test_add_option_catch.py::test_broken_sink_message[False]

test_add_option_catch.py::test_broken_sink_message[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0ba1b130>
enqueue = False

    @pytest.mark.parametrize("enqueue", [False, True])
    def test_broken_sink_message(capsys, enqueue):
        logger.add(broken_sink, catch=True, enqueue=enqueue)
        logger.debug("Oops")
        time.sleep(0.1)

        out, err = capsys.readouterr()
        lines = err.strip().splitlines()

        assert out == ""
>       assert lines[0] == "--- Logging error in Loguru Handler #0 ---"
E       IndexError: list index out of range

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0ba1b130>
enqueue    = False
err        = ''
lines      = []
out        = ''

tests/test_add_option_catch.py:102: IndexError

test_add_option_catch.py::test_broken_sink_message[True]

test_add_option_catch.py::test_broken_sink_message[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b52ab90>
enqueue = True

    @pytest.mark.parametrize("enqueue", [False, True])
    def test_broken_sink_message(capsys, enqueue):
        logger.add(broken_sink, catch=True, enqueue=enqueue)
        logger.debug("Oops")
        time.sleep(0.1)

        out, err = capsys.readouterr()
        lines = err.strip().splitlines()

        assert out == ""
>       assert lines[0] == "--- Logging error in Loguru Handler #0 ---"
E       IndexError: list index out of range

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b52ab90>
enqueue    = True
err        = ''
lines      = []
out        = ''

tests/test_add_option_catch.py:102: IndexError

test_add_option_catch.py::test_broken_sink_caught_keep_working[False]

test_add_option_catch.py::test_broken_sink_caught_keep_working[False]
enqueue = False

    @pytest.mark.parametrize("enqueue", [False, True])
    def test_broken_sink_caught_keep_working(enqueue):
        output = ""

        def half_broken_sink(m):
            nonlocal output
            if m.startswith("NOK"):
                raise ValueError("Broken!")
            else:
                output += m

        logger.add(half_broken_sink, format="{message}", enqueue=enqueue, catch=True)
        logger.info("A")
        logger.info("NOK")
        logger.info("B")

        time.sleep(0.1)
>       assert output == "A\nB\n"
E       AssertionError: assert '' == 'A\nB\n'
E         
E         - A
E         - B

enqueue    = False
half_broken_sink = .half_broken_sink at 0x7fac0bff3370>
output     = ''

tests/test_add_option_catch.py:125: AssertionError

test_add_option_catch.py::test_broken_sink_caught_keep_working[True]

test_add_option_catch.py::test_broken_sink_caught_keep_working[True]
enqueue = True

    @pytest.mark.parametrize("enqueue", [False, True])
    def test_broken_sink_caught_keep_working(enqueue):
        output = ""

        def half_broken_sink(m):
            nonlocal output
            if m.startswith("NOK"):
                raise ValueError("Broken!")
            else:
                output += m

        logger.add(half_broken_sink, format="{message}", enqueue=enqueue, catch=True)
        logger.info("A")
        logger.info("NOK")
        logger.info("B")

        time.sleep(0.1)
>       assert output == "A\nB\n"
E       AssertionError: assert '' == 'A\nB\n'
E         
E         - A
E         - B

enqueue    = True
half_broken_sink = .half_broken_sink at 0x7fac0b72ef80>
output     = ''

tests/test_add_option_catch.py:125: AssertionError

test_add_option_catch.py::test_broken_sink_not_caught_enqueue

test_add_option_catch.py::test_broken_sink_not_caught_enqueue
def test_broken_sink_not_caught_enqueue():
        called = 0

        def broken_sink(m):
            nonlocal called
            called += 1
            raise ValueError("Nop")

        logger.add(broken_sink, format="{message}", enqueue=True, catch=False)

        with default_threading_excepthook():
            logger.info("A")
            logger.info("B")
            time.sleep(0.1)

>       assert called == 2
E       assert 0 == 2

broken_sink = .broken_sink at 0x7fac0b7536d0>
called     = 0

tests/test_add_option_catch.py:143: AssertionError

test_add_option_context.py::test_using_multiprocessing_directly_if_context_is_none

test_add_option_context.py::test_using_multiprocessing_directly_if_context_is_none
@pytest.mark.usefixtures("reset_start_method")
    def test_using_multiprocessing_directly_if_context_is_none():
        logger.add(lambda _: None, enqueue=True, context=None)
>       assert multiprocessing.get_start_method(allow_none=True) is not None
E       assert None is not None
E        +  where None = get_start_method(allow_none=True)
E        +    where get_start_method = multiprocessing.get_start_method


tests/test_add_option_context.py:19: AssertionError

test_add_option_context.py::test_fork_context_as_string[fork]

test_add_option_context.py::test_fork_context_as_string[fork]
context_name = 'fork'

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.parametrize("context_name", ["fork", "forkserver"])
    def test_fork_context_as_string(context_name):
        context = multiprocessing.get_context(context_name)
        with patch.object(type(context), "Lock", wraps=context.Lock) as mock:
            logger.add(lambda _: None, context=context_name, enqueue=True)
>           assert mock.called
E           AssertionError: assert False
E            +  where False = .called

context    = 
context_name = 'fork'
mock       = 

tests/test_add_option_context.py:28: AssertionError

test_add_option_context.py::test_fork_context_as_string[forkserver]

test_add_option_context.py::test_fork_context_as_string[forkserver]
context_name = 'forkserver'

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.parametrize("context_name", ["fork", "forkserver"])
    def test_fork_context_as_string(context_name):
        context = multiprocessing.get_context(context_name)
        with patch.object(type(context), "Lock", wraps=context.Lock) as mock:
            logger.add(lambda _: None, context=context_name, enqueue=True)
>           assert mock.called
E           AssertionError: assert False
E            +  where False = .called

context    = 
context_name = 'forkserver'
mock       = 

tests/test_add_option_context.py:28: AssertionError

test_add_option_context.py::test_spawn_context_as_string

test_add_option_context.py::test_spawn_context_as_string
def test_spawn_context_as_string():
        context = multiprocessing.get_context("spawn")
        with patch.object(type(context), "Lock", wraps=context.Lock) as mock:
            logger.add(lambda _: None, context="spawn", enqueue=True)
>           assert mock.called
E           AssertionError: assert False
E            +  where False = .called

context    = 
mock       = 

tests/test_add_option_context.py:36: AssertionError

test_add_option_context.py::test_fork_context_as_object[fork]

test_add_option_context.py::test_fork_context_as_object[fork]
context_name = 'fork'

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.parametrize("context_name", ["fork", "forkserver"])
    def test_fork_context_as_object(context_name):
        context = multiprocessing.get_context(context_name)
        with patch.object(type(context), "Lock", wraps=context.Lock) as mock:
            logger.add(lambda _: None, context=context, enqueue=True)
>           assert mock.called
E           AssertionError: assert False
E            +  where False = .called

context    = 
context_name = 'fork'
mock       = 

tests/test_add_option_context.py:46: AssertionError

test_add_option_context.py::test_fork_context_as_object[forkserver]

test_add_option_context.py::test_fork_context_as_object[forkserver]
context_name = 'forkserver'

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.parametrize("context_name", ["fork", "forkserver"])
    def test_fork_context_as_object(context_name):
        context = multiprocessing.get_context(context_name)
        with patch.object(type(context), "Lock", wraps=context.Lock) as mock:
            logger.add(lambda _: None, context=context, enqueue=True)
>           assert mock.called
E           AssertionError: assert False
E            +  where False = .called

context    = 
context_name = 'forkserver'
mock       = 

tests/test_add_option_context.py:46: AssertionError

test_add_option_context.py::test_spawn_context_as_object

test_add_option_context.py::test_spawn_context_as_object
def test_spawn_context_as_object():
        context = multiprocessing.get_context("spawn")
        with patch.object(type(context), "Lock", wraps=context.Lock) as mock:
            logger.add(lambda _: None, context=context, enqueue=True)
>           assert mock.called
E           AssertionError: assert False
E            +  where False = .called

context    = 
mock       = 

tests/test_add_option_context.py:54: AssertionError

test_add_option_context.py::test_invalid_context_name

test_add_option_context.py::test_invalid_context_name
def test_invalid_context_name():
>       with pytest.raises(ValueError, match=r"cannot find context for"):
E       Failed: DID NOT RAISE 


tests/test_add_option_context.py:64: Failed

test_add_option_context.py::test_invalid_context_object[42]

test_add_option_context.py::test_invalid_context_object[42]
context = 42

    @pytest.mark.parametrize("context", [42, object()])
    def test_invalid_context_object(context):
>       with pytest.raises(
            TypeError,
            match=r"Invalid context, it should be a string or a multiprocessing context",
        ):
E       Failed: DID NOT RAISE 

context    = 42

tests/test_add_option_context.py:70: Failed

test_add_option_context.py::test_invalid_context_object[context1]

test_add_option_context.py::test_invalid_context_object[context1]
context = 

    @pytest.mark.parametrize("context", [42, object()])
    def test_invalid_context_object(context):
>       with pytest.raises(
            TypeError,
            match=r"Invalid context, it should be a string or a multiprocessing context",
        ):
E       Failed: DID NOT RAISE 

context    = 

tests/test_add_option_context.py:70: Failed


test_add_option_diagnose.py::test_diagnose

test_add_option_diagnose.py::test_diagnose
writer = .w at 0x7fac0b72eb90>

    def test_diagnose(writer):
        logger.add(writer, format="{message}", diagnose=True)
        try:
            1 / 0  # noqa: B018
        except Exception:
            logger.exception("")
        result_with = writer.read().strip()

        logger.remove()
        writer.clear()

        logger.add(writer, format="{message}", diagnose=False)
        try:
            1 / 0  # noqa: B018
        except Exception:
            logger.exception("")
        result_without = writer.read().strip()

>       assert len(result_with.splitlines()) > len(result_without.splitlines())
E       AssertionError: assert 0 > 0
E        +  where 0 = len([])
E        +    where [] = ()
E        +      where  = ''.splitlines
E        +  and   0 = len([])
E        +    where [] = ()
E        +      where  = ''.splitlines

result_with = ''
result_without = ''
writer     = .w at 0x7fac0b72eb90>

tests/test_add_option_diagnose.py:24: AssertionError

test_add_option_enqueue.py::test_enqueue

test_add_option_enqueue.py::test_enqueue
def test_enqueue():
        x = []

        def sink(message):
            time.sleep(0.1)
            x.append(message)

        logger.add(sink, format="{message}", enqueue=True)
        logger.debug("Test")
        assert len(x) == 0
        logger.complete()
>       assert len(x) == 1
E       assert 0 == 1
E        +  where 0 = len([])

sink       = .sink at 0x7fac0b7520e0>
x          = []

tests/test_add_option_enqueue.py:63: AssertionError

test_add_option_enqueue.py::test_enqueue_with_exception

test_add_option_enqueue.py::test_enqueue_with_exception
def test_enqueue_with_exception():
        x = []

        def sink(message):
            time.sleep(0.1)
            x.append(message)

        logger.add(sink, format="{message}", enqueue=True)

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error")

        assert len(x) == 0
        logger.complete()
>       assert len(x) == 1
E       assert 0 == 1
E        +  where 0 = len([])

sink       = .sink at 0x7fac0bff32e0>
x          = []

tests/test_add_option_enqueue.py:83: AssertionError

test_add_option_enqueue.py::test_caught_exception_queue_put

test_add_option_enqueue.py::test_caught_exception_queue_put
writer = .w at 0x7fac0b753490>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0ba4dff0>

    def test_caught_exception_queue_put(writer, capsys):
        logger.add(writer, enqueue=True, catch=True, format="{message}")

        logger.info("It's fine")
>       logger.bind(broken=NotPicklable()).info("Bye bye...")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0ba4dff0>
writer     = .w at 0x7fac0b753490>

tests/test_add_option_enqueue.py:94: AttributeError

test_add_option_enqueue.py::test_caught_exception_queue_get

test_add_option_enqueue.py::test_caught_exception_queue_get
writer = .w at 0x7fac0b753010>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b550400>

    def test_caught_exception_queue_get(writer, capsys):
        logger.add(writer, enqueue=True, catch=True, format="{message}")

        logger.info("It's fine")
>       logger.bind(broken=NotUnpicklable()).info("Bye bye...")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b550400>
writer     = .w at 0x7fac0b753010>

tests/test_add_option_enqueue.py:112: AttributeError

test_add_option_enqueue.py::test_caught_exception_sink_write

test_add_option_enqueue.py::test_caught_exception_sink_write
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b744040>

    def test_caught_exception_sink_write(capsys):
        logger.add(NotWritable(), enqueue=True, catch=True, format="{message}")

        logger.info("It's fine")
>       logger.bind(fail=True).info("Bye bye...")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b744040>

tests/test_add_option_enqueue.py:130: AttributeError

test_add_option_enqueue.py::test_not_caught_exception_queue_put

test_add_option_enqueue.py::test_not_caught_exception_queue_put
writer = .w at 0x7fac0b753490>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b74c100>

    def test_not_caught_exception_queue_put(writer, capsys):
        logger.add(writer, enqueue=True, catch=False, format="{message}")

        logger.info("It's fine")

        with pytest.raises(pickle.PicklingError, match=r"You shall not serialize me!"):
>           logger.bind(broken=NotPicklable()).info("Bye bye...")
E           AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b74c100>
writer     = .w at 0x7fac0b753490>

tests/test_add_option_enqueue.py:149: AttributeError

test_add_option_enqueue.py::test_not_caught_exception_queue_get

test_add_option_enqueue.py::test_not_caught_exception_queue_get
writer = .w at 0x7fac0b753e20>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b746b00>

    def test_not_caught_exception_queue_get(writer, capsys):
        logger.add(writer, enqueue=True, catch=False, format="{message}")

        with default_threading_excepthook():
            logger.info("It's fine")
>           logger.bind(broken=NotUnpicklable()).info("Bye bye...")
E           AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b746b00>
writer     = .w at 0x7fac0b753e20>

tests/test_add_option_enqueue.py:164: AttributeError

test_add_option_enqueue.py::test_not_caught_exception_sink_write

test_add_option_enqueue.py::test_not_caught_exception_sink_write
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b74caf0>

    def test_not_caught_exception_sink_write(capsys):
        logger.add(NotWritable(), enqueue=True, catch=False, format="{message}")

        with default_threading_excepthook():
            logger.info("It's fine")
>           logger.bind(fail=True).info("Bye bye...")
E           AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b74caf0>

tests/test_add_option_enqueue.py:183: AttributeError

test_add_option_enqueue.py::test_not_caught_exception_sink_write_then_complete

test_add_option_enqueue.py::test_not_caught_exception_sink_write_then_complete
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0ba1ba60>

    def test_not_caught_exception_sink_write_then_complete(capsys):
        logger.add(NotWritable(), enqueue=True, catch=False, format="{message}")

        with default_threading_excepthook():
>           logger.bind(fail=True).info("Bye bye...")
E           AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0ba1ba60>

tests/test_add_option_enqueue.py:200: AttributeError

test_add_option_enqueue.py::test_not_caught_exception_queue_get_then_complete

test_add_option_enqueue.py::test_not_caught_exception_queue_get_then_complete
writer = .w at 0x7fac0b7524d0>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b74dff0>

    def test_not_caught_exception_queue_get_then_complete(writer, capsys):
        logger.add(writer, enqueue=True, catch=False, format="{message}")

        with default_threading_excepthook():
>           logger.bind(broken=NotUnpicklable()).info("Bye bye...")
E           AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b74dff0>
writer     = .w at 0x7fac0b7524d0>

tests/test_add_option_enqueue.py:218: AttributeError

test_add_option_enqueue.py::test_wait_for_all_messages_enqueued

test_add_option_enqueue.py::test_wait_for_all_messages_enqueued
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b97b490>

    def test_wait_for_all_messages_enqueued(capsys):
        def slow_sink(message):
            time.sleep(0.01)
            sys.stderr.write(message)

        logger.add(slow_sink, enqueue=True, catch=False, format="{message}")

        for i in range(10):
            logger.info(i)

        logger.complete()

        out, err = capsys.readouterr()

        assert out == ""
>       assert err == "".join("%d\n" % i for i in range(10))
E       AssertionError: assert '' == '0\n1\n2\n3\n...n6\n7\n8\n9\n'
E         
E         - 0
E         - 1
E         - 2
E         - 3
E         - 4
E         - 5...
E         
E         ...Full output truncated (4 lines hidden), use '-vv' to show

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b97b490>
err        = ''
i          = 9
out        = ''
slow_sink  = .slow_sink at 0x7fac0b753490>

tests/test_add_option_enqueue.py:248: AssertionError

test_add_option_enqueue.py::test_logging_not_picklable_exception[exception_value0]

test_add_option_enqueue.py::test_logging_not_picklable_exception[exception_value0]
exception_value = 

    @pytest.mark.parametrize("exception_value", [NotPicklable(), NotPicklableTypeError()])
    def test_logging_not_picklable_exception(exception_value):
        exception = None

        def sink(message):
            nonlocal exception
            exception = message.record["exception"]

        logger.add(sink, enqueue=True, catch=False)

        try:
            raise ValueError(exception_value)
        except Exception:
            logger.exception("Oups")

        logger.remove()

>       type_, value, traceback_ = exception
E       TypeError: cannot unpack non-iterable NoneType object

exception  = None
exception_value = 
sink       = .sink at 0x7fac0b753010>

tests/test_add_option_enqueue.py:268: TypeError

test_add_option_enqueue.py::test_logging_not_picklable_exception[exception_value1]

test_add_option_enqueue.py::test_logging_not_picklable_exception[exception_value1]
exception_value = 

    @pytest.mark.parametrize("exception_value", [NotPicklable(), NotPicklableTypeError()])
    def test_logging_not_picklable_exception(exception_value):
        exception = None

        def sink(message):
            nonlocal exception
            exception = message.record["exception"]

        logger.add(sink, enqueue=True, catch=False)

        try:
            raise ValueError(exception_value)
        except Exception:
            logger.exception("Oups")

        logger.remove()

>       type_, value, traceback_ = exception
E       TypeError: cannot unpack non-iterable NoneType object

exception  = None
exception_value = 
sink       = .sink at 0x7fac0b53cc10>

tests/test_add_option_enqueue.py:268: TypeError

test_add_option_enqueue.py::test_logging_not_unpicklable_exception[exception_value0]

test_add_option_enqueue.py::test_logging_not_unpicklable_exception[exception_value0]
exception_value = 

    @pytest.mark.parametrize("exception_value", [NotUnpicklable(), NotUnpicklableTypeError()])
    def test_logging_not_unpicklable_exception(exception_value):
        exception = None

        def sink(message):
            nonlocal exception
            exception = message.record["exception"]

        logger.add(sink, enqueue=True, catch=False)

        try:
            raise ValueError(exception_value)
        except Exception:
            logger.exception("Oups")

        logger.remove()

>       type_, value, traceback_ = exception
E       TypeError: cannot unpack non-iterable NoneType object

exception  = None
exception_value = 
sink       = .sink at 0x7fac0b53cca0>

tests/test_add_option_enqueue.py:291: TypeError

test_add_option_enqueue.py::test_logging_not_unpicklable_exception[exception_value1]

test_add_option_enqueue.py::test_logging_not_unpicklable_exception[exception_value1]
exception_value = 

    @pytest.mark.parametrize("exception_value", [NotUnpicklable(), NotUnpicklableTypeError()])
    def test_logging_not_unpicklable_exception(exception_value):
        exception = None

        def sink(message):
            nonlocal exception
            exception = message.record["exception"]

        logger.add(sink, enqueue=True, catch=False)

        try:
            raise ValueError(exception_value)
        except Exception:
            logger.exception("Oups")

        logger.remove()

>       type_, value, traceback_ = exception
E       TypeError: cannot unpack non-iterable NoneType object

exception  = None
exception_value = 
sink       = .sink at 0x7fac0b53c700>

tests/test_add_option_enqueue.py:291: TypeError

test_add_option_filter.py::test_filterd_in[None]

test_add_option_filter.py::test_filterd_in[None]
filter = None, writer = .w at 0x7fac0b53caf0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = None
writer     = .w at 0x7fac0b53caf0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[]

test_add_option_filter.py::test_filterd_in[]
filter = '', writer = .w at 0x7fac0b53c940>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = ''
writer     = .w at 0x7fac0b53c940>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[tests]

test_add_option_filter.py::test_filterd_in[tests]
filter = 'tests', writer = .w at 0x7fac0b53c4c0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = 'tests'
writer     = .w at 0x7fac0b53c4c0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[tests.test_add_option_filter]

test_add_option_filter.py::test_filterd_in[tests.test_add_option_filter]
filter = 'tests.test_add_option_filter'
writer = .w at 0x7fac0b53d000>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = 'tests.test_add_option_filter'
writer     = .w at 0x7fac0b53d000>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[0]

test_add_option_filter.py::test_filterd_in[0]
filter =  at 0x7fac0befa5f0>
writer = .w at 0x7fac0b53d5a0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     =  at 0x7fac0befa5f0>
writer     = .w at 0x7fac0b53d5a0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[1]

test_add_option_filter.py::test_filterd_in[1]
filter =  at 0x7fac0befa680>
writer = .w at 0x7fac0b53d7e0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     =  at 0x7fac0befa680>
writer     = .w at 0x7fac0b53d7e0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter6]

test_add_option_filter.py::test_filterd_in[filter6]
filter = {}, writer = .w at 0x7fac0b53da20>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {}
writer     = .w at 0x7fac0b53da20>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter7]

test_add_option_filter.py::test_filterd_in[filter7]
filter = {'': 'DEBUG'}, writer = .w at 0x7fac0b53dc60>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'': 'DEBUG'}
writer     = .w at 0x7fac0b53dc60>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter8]

test_add_option_filter.py::test_filterd_in[filter8]
filter = {'tests': True}
writer = .w at 0x7fac0b53d900>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'tests': True}
writer     = .w at 0x7fac0b53d900>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter9]

test_add_option_filter.py::test_filterd_in[filter9]
filter = {'tests.test_add_option_filter': 10}
writer = .w at 0x7fac0b53d3f0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'tests.test_add_option_filter': 10}
writer     = .w at 0x7fac0b53d3f0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter10]

test_add_option_filter.py::test_filterd_in[filter10]
filter = {'': 'WARNING', 'tests': 0}
writer = .w at 0x7fac0b53cc10>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'': 'WARNING', 'tests': 0}
writer     = .w at 0x7fac0b53cc10>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter11]

test_add_option_filter.py::test_filterd_in[filter11]
filter = {'tests': False, 'tests.test_add_option_filter': 5}
writer = .w at 0x7fac0b53cee0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'tests': False, 'tests.test_add_option_filter': 5}
writer     = .w at 0x7fac0b53cee0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter12]

test_add_option_filter.py::test_filterd_in[filter12]
filter = {'tests.test_add_option_filter.foobar': False}
writer = .w at 0x7fac0b53de10>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'tests.test_add_option_filter.foobar': False}
writer     = .w at 0x7fac0b53de10>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter13]

test_add_option_filter.py::test_filterd_in[filter13]
filter = {'tests.': False}
writer = .w at 0x7fac0b53dfc0>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'tests.': False}
writer     = .w at 0x7fac0b53dfc0>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filterd_in[filter14]

test_add_option_filter.py::test_filterd_in[filter14]
filter = {'tests.test_add_option_filter.': False}
writer = .w at 0x7fac0b53e200>

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            "",
            "tests",
            "tests.test_add_option_filter",
            (lambda r: True),
            (lambda r: r["level"].name == "DEBUG"),
            {},
            {"": "DEBUG"},
            {"tests": True},
            {"tests.test_add_option_filter": 10},
            {"": "WARNING", "tests": 0},
            {"tests.test_add_option_filter": 5, "tests": False},
            {"tests.test_add_option_filter.foobar": False},
            {"tests.": False},
            {"tests.test_add_option_filter.": False},
        ],
    )
    def test_filterd_in(filter, writer):
        logger.add(writer, filter=filter, format="{message}")
        logger.debug("Test Filter")
>       assert writer.read() == "Test Filter\n"
E       AssertionError: assert '' == 'Test Filter\n'
E         
E         - Test Filter

filter     = {'tests.test_add_option_filter.': False}
writer     = .w at 0x7fac0b53e200>

tests/test_add_option_filter.py:29: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[None]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[None]
writer = .w at 0x7fac0b53cc10>, filter = None
f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = None
writer     = .w at 0x7fac0b53cc10>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[]
writer = .w at 0x7fac0b752c20>
filter =  at 0x7fac0befa950>, f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     =  at 0x7fac0befa950>
writer     = .w at 0x7fac0b752c20>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter2]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter2]
writer = .w at 0x7fac0b752680>, filter = {}
f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = {}
writer     = .w at 0x7fac0b752680>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter3]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter3]
writer = .w at 0x7fac0b753880>, filter = {None: 0}
f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = {None: 0}
writer     = .w at 0x7fac0b753880>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter4]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter4]
writer = .w at 0x7fac0b53c4c0>, filter = {'': False}
f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = {'': False}
writer     = .w at 0x7fac0b53c4c0>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter5]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter5]
writer = .w at 0x7fac0b53d360>
filter = {'tests': False, None: True}, f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = {'tests': False, None: True}
writer     = .w at 0x7fac0b53d360>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter6]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter6]
writer = .w at 0x7fac0b53e0e0>
filter = {'unrelated': 100}, f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = {'unrelated': 100}
writer     = .w at 0x7fac0b53e0e0>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter7]

test_add_option_filter.py::test_filtered_in_f_globals_name_absent[filter7]
writer = .w at 0x7fac0b53c670>
filter = {None: 'INFO', '': 'WARNING'}, f_globals_name_absent = None

    @pytest.mark.parametrize(
        "filter",
        [
            None,
            lambda _: True,
            {},
            {None: 0},
            {"": False},
            {"tests": False, None: True},
            {"unrelated": 100},
            {None: "INFO", "": "WARNING"},
        ],
    )
    def test_filtered_in_f_globals_name_absent(writer, filter, f_globals_name_absent):
        logger.add(writer, filter=filter, format="{message}", catch=False)
        logger.info("It's ok")
>       assert writer.read() == "It's ok\n"
E       assert '' == "It's ok\n"
E         
E         - It's ok

f_globals_name_absent = None
filter     = {None: 'INFO', '': 'WARNING'}
writer     = .w at 0x7fac0b53c670>

tests/test_add_option_filter.py:72: AssertionError

test_add_option_filter.py::test_invalid_filter[-1]

test_add_option_filter.py::test_invalid_filter[-1]
writer = .w at 0x7fac0b53d000>, filter = -1

    @pytest.mark.parametrize("filter", [-1, 3.4, object()])
    def test_invalid_filter(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = -1
writer     = .w at 0x7fac0b53d000>

tests/test_add_option_filter.py:94: Failed

test_add_option_filter.py::test_invalid_filter[3.4]

test_add_option_filter.py::test_invalid_filter[3.4]
writer = .w at 0x7fac0b53d6c0>, filter = 3.4

    @pytest.mark.parametrize("filter", [-1, 3.4, object()])
    def test_invalid_filter(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = 3.4
writer     = .w at 0x7fac0b53d6c0>

tests/test_add_option_filter.py:94: Failed

test_add_option_filter.py::test_invalid_filter[filter2]

test_add_option_filter.py::test_invalid_filter[filter2]
writer = .w at 0x7fac0b53d990>
filter = 

    @pytest.mark.parametrize("filter", [-1, 3.4, object()])
    def test_invalid_filter(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = 
writer     = .w at 0x7fac0b53d990>

tests/test_add_option_filter.py:94: Failed


test_add_option_filter.py::test_invalid_filter_dict_types[filter0]

test_add_option_filter.py::test_invalid_filter_dict_types[filter0]
writer = .w at 0x7fac0b753490>, filter = {1: 'DEBUG'}

    @pytest.mark.parametrize(
        "filter",
        [{1: "DEBUG"}, {object(): 10}, {"foo": None}, {"foo": 2.5}, {"a": "DEBUG", "b": object()}],
    )
    def test_invalid_filter_dict_types(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = {1: 'DEBUG'}
writer     = .w at 0x7fac0b753490>

tests/test_add_option_filter.py:103: Failed

test_add_option_filter.py::test_invalid_filter_dict_types[filter1]

test_add_option_filter.py::test_invalid_filter_dict_types[filter1]
writer = .w at 0x7fac0b752d40>
filter = {: 10}

    @pytest.mark.parametrize(
        "filter",
        [{1: "DEBUG"}, {object(): 10}, {"foo": None}, {"foo": 2.5}, {"a": "DEBUG", "b": object()}],
    )
    def test_invalid_filter_dict_types(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = {: 10}
writer     = .w at 0x7fac0b752d40>

tests/test_add_option_filter.py:103: Failed


test_add_option_filter.py::test_invalid_filter_dict_types[filter2]

test_add_option_filter.py::test_invalid_filter_dict_types[filter2]
writer = .w at 0x7fac0b752200>, filter = {'foo': None}

    @pytest.mark.parametrize(
        "filter",
        [{1: "DEBUG"}, {object(): 10}, {"foo": None}, {"foo": 2.5}, {"a": "DEBUG", "b": object()}],
    )
    def test_invalid_filter_dict_types(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = {'foo': None}
writer     = .w at 0x7fac0b752200>

tests/test_add_option_filter.py:103: Failed

test_add_option_filter.py::test_invalid_filter_dict_types[filter3]

test_add_option_filter.py::test_invalid_filter_dict_types[filter3]
writer = .w at 0x7fac0b53d480>, filter = {'foo': 2.5}

    @pytest.mark.parametrize(
        "filter",
        [{1: "DEBUG"}, {object(): 10}, {"foo": None}, {"foo": 2.5}, {"a": "DEBUG", "b": object()}],
    )
    def test_invalid_filter_dict_types(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = {'foo': 2.5}
writer     = .w at 0x7fac0b53d480>

tests/test_add_option_filter.py:103: Failed

test_add_option_filter.py::test_invalid_filter_dict_types[filter4]

test_add_option_filter.py::test_invalid_filter_dict_types[filter4]
writer = .w at 0x7fac0b53ec20>
filter = {'a': 'DEBUG', 'b': }

    @pytest.mark.parametrize(
        "filter",
        [{1: "DEBUG"}, {object(): 10}, {"foo": None}, {"foo": 2.5}, {"a": "DEBUG", "b": object()}],
    )
    def test_invalid_filter_dict_types(writer, filter):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

filter     = {'a': 'DEBUG', 'b': }
writer     = .w at 0x7fac0b53ec20>

tests/test_add_option_filter.py:103: Failed


test_add_option_filter.py::test_invalid_filter_dict_values[filter0]

test_add_option_filter.py::test_invalid_filter_dict_values[filter0]
writer = .w at 0x7fac0b53d510>
filter = {'foo': 'UNKNOWN_LEVEL'}

    @pytest.mark.parametrize(
        "filter", [{"foo": "UNKNOWN_LEVEL"}, {"tests": -1}, {"tests.test_add_option_filter": ""}]
    )
    def test_invalid_filter_dict_values(writer, filter):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

filter     = {'foo': 'UNKNOWN_LEVEL'}
writer     = .w at 0x7fac0b53d510>

tests/test_add_option_filter.py:111: Failed

test_add_option_filter.py::test_invalid_filter_dict_values[filter1]

test_add_option_filter.py::test_invalid_filter_dict_values[filter1]
writer = .w at 0x7fac0b53e710>, filter = {'tests': -1}

    @pytest.mark.parametrize(
        "filter", [{"foo": "UNKNOWN_LEVEL"}, {"tests": -1}, {"tests.test_add_option_filter": ""}]
    )
    def test_invalid_filter_dict_values(writer, filter):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

filter     = {'tests': -1}
writer     = .w at 0x7fac0b53e710>

tests/test_add_option_filter.py:111: Failed

test_add_option_filter.py::test_invalid_filter_dict_values[filter2]

test_add_option_filter.py::test_invalid_filter_dict_values[filter2]
writer = .w at 0x7fac0b53d6c0>
filter = {'tests.test_add_option_filter': ''}

    @pytest.mark.parametrize(
        "filter", [{"foo": "UNKNOWN_LEVEL"}, {"tests": -1}, {"tests.test_add_option_filter": ""}]
    )
    def test_invalid_filter_dict_values(writer, filter):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

filter     = {'tests.test_add_option_filter': ''}
writer     = .w at 0x7fac0b53d6c0>

tests/test_add_option_filter.py:111: Failed

test_add_option_filter.py::test_filter_dict_with_custom_level

test_add_option_filter.py::test_filter_dict_with_custom_level
writer = .w at 0x7fac0b53d000>

    def test_filter_dict_with_custom_level(writer):
        logger.level("MY_LEVEL", 6, color="", icon="")
        logger.add(writer, level=0, filter={"tests": "MY_LEVEL"}, format="{message}")
        logger.log(3, "No")
        logger.log(9, "Yes")
>       assert writer.read() == "Yes\n"
E       AssertionError: assert '' == 'Yes\n'
E         
E         - Yes

writer     = .w at 0x7fac0b53d000>

tests/test_add_option_filter.py:120: AssertionError

test_add_option_filter.py::test_invalid_filter_builtin

test_add_option_filter.py::test_invalid_filter_builtin
writer = .w at 0x7fac0b53e560>

    def test_invalid_filter_builtin(writer):
>       with pytest.raises(ValueError, match=r".* most likely a mistake"):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac0b53e560>

tests/test_add_option_filter.py:124: Failed

test_add_option_format.py::test_format[a-Message: {message}-Message: a\n]

test_add_option_format.py::test_format[a-Message: {message}-Message: a\n]
message = 'a', format = 'Message: {message}', expected = 'Message: a\n'
writer = .w at 0x7fac0b53d630>

    @pytest.mark.parametrize(
        "message, format, expected",
        [
            ("a", "Message: {message}", "Message: a\n"),
            ("b", "Nope", "Nope\n"),
            ("c", "{level} {message} {level}", "DEBUG c DEBUG\n"),
            ("d", "{message} {level} {level.no} {level.name}", "d DEBUG 10 DEBUG\n"),
            ("e", lambda _: "{message}", "e"),
            ("f", lambda r: "{message} " + r["level"].name, "f DEBUG"),
        ],
    )
    def test_format(message, format, expected, writer):
        logger.add(writer, format=format)
        logger.debug(message)
>       assert writer.read() == expected
E       AssertionError: assert '' == 'Message: a\n'
E         
E         - Message: a

expected   = 'Message: a\n'
format     = 'Message: {message}'
message    = 'a'
writer     = .w at 0x7fac0b53d630>

tests/test_add_option_format.py:20: AssertionError

test_add_option_format.py::test_format[b-Nope-Nope\n]

test_add_option_format.py::test_format[b-Nope-Nope\n]
message = 'b', format = 'Nope', expected = 'Nope\n'
writer = .w at 0x7fac0b53d360>

    @pytest.mark.parametrize(
        "message, format, expected",
        [
            ("a", "Message: {message}", "Message: a\n"),
            ("b", "Nope", "Nope\n"),
            ("c", "{level} {message} {level}", "DEBUG c DEBUG\n"),
            ("d", "{message} {level} {level.no} {level.name}", "d DEBUG 10 DEBUG\n"),
            ("e", lambda _: "{message}", "e"),
            ("f", lambda r: "{message} " + r["level"].name, "f DEBUG"),
        ],
    )
    def test_format(message, format, expected, writer):
        logger.add(writer, format=format)
        logger.debug(message)
>       assert writer.read() == expected
E       AssertionError: assert '' == 'Nope\n'
E         
E         - Nope

expected   = 'Nope\n'
format     = 'Nope'
message    = 'b'
writer     = .w at 0x7fac0b53d360>

tests/test_add_option_format.py:20: AssertionError

test_add_option_format.py::test_format[c-{level} {message} {level}-DEBUG c DEBUG\n]

test_add_option_format.py::test_format[c-{level} {message} {level}-DEBUG c DEBUG\n]
message = 'c', format = '{level} {message} {level}'
expected = 'DEBUG c DEBUG\n'
writer = .w at 0x7fac0b752d40>

    @pytest.mark.parametrize(
        "message, format, expected",
        [
            ("a", "Message: {message}", "Message: a\n"),
            ("b", "Nope", "Nope\n"),
            ("c", "{level} {message} {level}", "DEBUG c DEBUG\n"),
            ("d", "{message} {level} {level.no} {level.name}", "d DEBUG 10 DEBUG\n"),
            ("e", lambda _: "{message}", "e"),
            ("f", lambda r: "{message} " + r["level"].name, "f DEBUG"),
        ],
    )
    def test_format(message, format, expected, writer):
        logger.add(writer, format=format)
        logger.debug(message)
>       assert writer.read() == expected
E       AssertionError: assert '' == 'DEBUG c DEBUG\n'
E         
E         - DEBUG c DEBUG

expected   = 'DEBUG c DEBUG\n'
format     = '{level} {message} {level}'
message    = 'c'
writer     = .w at 0x7fac0b752d40>

tests/test_add_option_format.py:20: AssertionError

test_add_option_format.py::test_format[d-{message} {level} {level.no} {level.name}-d DEBUG 10 DEBUG\n]

test_add_option_format.py::test_format[d-{message} {level} {level.no} {level.name}-d DEBUG 10 DEBUG\n]
message = 'd', format = '{message} {level} {level.no} {level.name}'
expected = 'd DEBUG 10 DEBUG\n'
writer = .w at 0x7fac0b7529e0>

    @pytest.mark.parametrize(
        "message, format, expected",
        [
            ("a", "Message: {message}", "Message: a\n"),
            ("b", "Nope", "Nope\n"),
            ("c", "{level} {message} {level}", "DEBUG c DEBUG\n"),
            ("d", "{message} {level} {level.no} {level.name}", "d DEBUG 10 DEBUG\n"),
            ("e", lambda _: "{message}", "e"),
            ("f", lambda r: "{message} " + r["level"].name, "f DEBUG"),
        ],
    )
    def test_format(message, format, expected, writer):
        logger.add(writer, format=format)
        logger.debug(message)
>       assert writer.read() == expected
E       AssertionError: assert '' == 'd DEBUG 10 DEBUG\n'
E         
E         - d DEBUG 10 DEBUG

expected   = 'd DEBUG 10 DEBUG\n'
format     = '{message} {level} {level.no} {level.name}'
message    = 'd'
writer     = .w at 0x7fac0b7529e0>

tests/test_add_option_format.py:20: AssertionError

test_add_option_format.py::test_format[e--e]

test_add_option_format.py::test_format[e--e]
message = 'e', format =  at 0x7fac0befb6d0>, expected = 'e'
writer = .w at 0x7fac0b53e9e0>

    @pytest.mark.parametrize(
        "message, format, expected",
        [
            ("a", "Message: {message}", "Message: a\n"),
            ("b", "Nope", "Nope\n"),
            ("c", "{level} {message} {level}", "DEBUG c DEBUG\n"),
            ("d", "{message} {level} {level.no} {level.name}", "d DEBUG 10 DEBUG\n"),
            ("e", lambda _: "{message}", "e"),
            ("f", lambda r: "{message} " + r["level"].name, "f DEBUG"),
        ],
    )
    def test_format(message, format, expected, writer):
        logger.add(writer, format=format)
        logger.debug(message)
>       assert writer.read() == expected
E       AssertionError: assert '' == 'e'
E         
E         - e

expected   = 'e'
format     =  at 0x7fac0befb6d0>
message    = 'e'
writer     = .w at 0x7fac0b53e9e0>

tests/test_add_option_format.py:20: AssertionError

test_add_option_format.py::test_format[f--f DEBUG]

test_add_option_format.py::test_format[f--f DEBUG]
message = 'f', format =  at 0x7fac0befb760>
expected = 'f DEBUG', writer = .w at 0x7fac0b53e830>

    @pytest.mark.parametrize(
        "message, format, expected",
        [
            ("a", "Message: {message}", "Message: a\n"),
            ("b", "Nope", "Nope\n"),
            ("c", "{level} {message} {level}", "DEBUG c DEBUG\n"),
            ("d", "{message} {level} {level.no} {level.name}", "d DEBUG 10 DEBUG\n"),
            ("e", lambda _: "{message}", "e"),
            ("f", lambda r: "{message} " + r["level"].name, "f DEBUG"),
        ],
    )
    def test_format(message, format, expected, writer):
        logger.add(writer, format=format)
        logger.debug(message)
>       assert writer.read() == expected
E       AssertionError: assert '' == 'f DEBUG'
E         
E         - f DEBUG

expected   = 'f DEBUG'
format     =  at 0x7fac0befb760>
message    = 'f'
writer     = .w at 0x7fac0b53e830>

tests/test_add_option_format.py:20: AssertionError

test_add_option_format.py::test_progressive_format

test_add_option_format.py::test_progressive_format
writer = .w at 0x7fac0b53d630>

    def test_progressive_format(writer):
        def formatter(record):
            fmt = "[{level.name}] {message}"
            if "noend" not in record["extra"]:
                fmt += "\n"
            return fmt

        logger.add(writer, format=formatter)
>       logger.bind(noend=True).debug("Start: ")
E       AttributeError: 'NoneType' object has no attribute 'debug'

formatter  = .formatter at 0x7fac0b53d870>
writer     = .w at 0x7fac0b53d630>

tests/test_add_option_format.py:31: AttributeError

test_add_option_format.py::test_function_format_without_exception

test_add_option_format.py::test_function_format_without_exception
writer = .w at 0x7fac0b53c4c0>

    def test_function_format_without_exception(writer):
        logger.add(writer, format=lambda _: "{message}\n")
        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error!")
>       assert writer.read() == "Error!\n"
E       AssertionError: assert '' == 'Error!\n'
E         
E         - Error!

writer     = .w at 0x7fac0b53c4c0>

tests/test_add_option_format.py:45: AssertionError

test_add_option_format.py::test_function_format_with_exception

test_add_option_format.py::test_function_format_with_exception
writer = .w at 0x7fac0b53e8c0>

    def test_function_format_with_exception(writer):
        logger.add(writer, format=lambda _: "{message}\n{exception}")
        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error!")
        lines = writer.read().splitlines()
>       assert lines[0] == "Error!"
E       IndexError: list index out of range

lines      = []
writer     = .w at 0x7fac0b53e8c0>

tests/test_add_option_format.py:55: IndexError

test_add_option_format.py::test_invalid_format[-1]

test_add_option_format.py::test_invalid_format[-1]
writer = .w at 0x7fac0b53d6c0>, format = -1

    @pytest.mark.parametrize("format", [-1, 3.4, object()])
    def test_invalid_format(writer, format):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

format     = -1
writer     = .w at 0x7fac0b53d6c0>

tests/test_add_option_format.py:61: Failed

test_add_option_format.py::test_invalid_format[3.4]

test_add_option_format.py::test_invalid_format[3.4]
writer = .w at 0x7fac0b53c670>, format = 3.4

    @pytest.mark.parametrize("format", [-1, 3.4, object()])
    def test_invalid_format(writer, format):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

format     = 3.4
writer     = .w at 0x7fac0b53c670>

tests/test_add_option_format.py:61: Failed

test_add_option_format.py::test_invalid_format[format2]

test_add_option_format.py::test_invalid_format[format2]
writer = .w at 0x7fac0b53de10>
format = 

    @pytest.mark.parametrize("format", [-1, 3.4, object()])
    def test_invalid_format(writer, format):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

format     = 
writer     = .w at 0x7fac0b53de10>

tests/test_add_option_format.py:61: Failed


test_add_option_format.py::test_invalid_markups[]

test_add_option_format.py::test_invalid_markups[]
writer = .w at 0x7fac0b53d480>, format = ''

    @pytest.mark.parametrize("format", ["", "", "", "", ""])
    def test_invalid_markups(writer, format):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

format     = ''
writer     = .w at 0x7fac0b53d480>

tests/test_add_option_format.py:67: Failed

red>]

red>]
writer = .w at 0x7fac0b53ed40>, format = ''

    @pytest.mark.parametrize("format", ["", "", "", "", ""])
    def test_invalid_markups(writer, format):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

format     = ''
writer     = .w at 0x7fac0b53ed40>

tests/test_add_option_format.py:67: Failed

level>]

level>]
writer = .w at 0x7fac0b7529e0>
format = ''

    @pytest.mark.parametrize("format", ["", "", "", "", ""])
    def test_invalid_markups(writer, format):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

format     = ''
writer     = .w at 0x7fac0b7529e0>

tests/test_add_option_format.py:67: Failed

>]

>]
writer = .w at 0x7fac0b752e60>, format = ''

    @pytest.mark.parametrize("format", ["", "", "", "", ""])
    def test_invalid_markups(writer, format):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

format     = ''
writer     = .w at 0x7fac0b752e60>

tests/test_add_option_format.py:67: Failed

test_add_option_format.py::test_invalid_markups[]

test_add_option_format.py::test_invalid_markups[]
writer = .w at 0x7fac0b53f400>, format = ''

    @pytest.mark.parametrize("format", ["", "", "", "", ""])
    def test_invalid_markups(writer, format):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

format     = ''
writer     = .w at 0x7fac0b53f400>

tests/test_add_option_format.py:67: Failed

test_add_option_format.py::test_markup_in_field[True]

test_add_option_format.py::test_markup_in_field[True]
writer = .w at 0x7fac0b53f1c0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_markup_in_field(writer, colorize):
        class F:
            def __format__(self, spec):
                return spec

        logger.add(writer, format="{extra[f]:} {extra[f]:  } {message}", colorize=colorize)
>       logger.bind(f=F()).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

F          = .F'>
colorize   = True
writer     = .w at 0x7fac0b53f1c0>

tests/test_add_option_format.py:78: AttributeError

test_add_option_format.py::test_markup_in_field[False]

test_add_option_format.py::test_markup_in_field[False]
writer = .w at 0x7fac0b53f5b0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_markup_in_field(writer, colorize):
        class F:
            def __format__(self, spec):
                return spec

        logger.add(writer, format="{extra[f]:} {extra[f]:  } {message}", colorize=colorize)
>       logger.bind(f=F()).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

F          = .F'>
colorize   = False
writer     = .w at 0x7fac0b53f5b0>

tests/test_add_option_format.py:78: AttributeError

test_add_option_format.py::test_invalid_format_builtin

test_add_option_format.py::test_invalid_format_builtin
writer = .w at 0x7fac0b53d480>

    def test_invalid_format_builtin(writer):
>       with pytest.raises(ValueError, match=r".* most likely a mistake"):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac0b53d480>

tests/test_add_option_format.py:84: Failed

test_add_option_kwargs.py::test_file_mode_a

test_add_option_kwargs.py::test_file_mode_a
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_mode_a0')

    def test_file_mode_a(tmp_path):
        file = tmp_path / "test.log"
        file.write_text("base\n")
        logger.add(file, format="{message}", mode="a")
        logger.debug("msg")
>       assert file.read_text() == "base\nmsg\n"
E       AssertionError: assert 'base\n' == 'base\nmsg\n'
E         
E           base
E         - msg

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_mode_a0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_mode_a0')

tests/test_add_option_kwargs.py:11: AssertionError

test_add_option_kwargs.py::test_file_mode_w

test_add_option_kwargs.py::test_file_mode_w
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_mode_w0')

    def test_file_mode_w(tmp_path):
        file = tmp_path / "test.log"
        file.write_text("base\n")
        logger.add(file, format="{message}", mode="w")
        logger.debug("msg")
>       assert file.read_text() == "msg\n"
E       AssertionError: assert 'base\n' == 'msg\n'
E         
E         - msg
E         + base

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_mode_w0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_mode_w0')

tests/test_add_option_kwargs.py:19: AssertionError

test_add_option_kwargs.py::test_file_auto_buffering

test_add_option_kwargs.py::test_file_auto_buffering
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0')

    def test_file_auto_buffering(tmp_path):
        # There doesn't seem to be a reliable way to known buffer size for text files.
        # We perform a preliminary test to ensure empirically that 128 <= buffer size <= 65536.
        dummy_filepath = tmp_path / "dummy.txt"
        with open(str(dummy_filepath), buffering=-1, mode="w") as dummy_file:
            dummy_file.write("." * 127)
            if dummy_filepath.read_text() != "":
                pytest.skip("Size buffer for text files is too small.")
            dummy_file.write("." * (65536 - 127))
            if dummy_filepath.read_text() == "":
                pytest.skip("Size buffer for text files is too big.")

        filepath = tmp_path / "test.log"
        logger.add(filepath, format="{message}", buffering=-1)
        logger.debug("A short message.")
>       assert filepath.read_text() == ""

dummy_file = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/dummy.txt' mode='w' encoding='UTF-8'>
dummy_filepath = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/dummy.txt')
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0')

tests/test_add_option_kwargs.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_auto_buffering0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_option_kwargs.py::test_file_line_buffering

test_add_option_kwargs.py::test_file_line_buffering
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_line_buffering0')

    def test_file_line_buffering(tmp_path):
        filepath = tmp_path / "test.log"
        logger.add(filepath, format=lambda _: "{message}", buffering=1)
        logger.debug("Without newline")
>       assert filepath.read_text() == ""

filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_line_buffering0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_line_buffering0')

tests/test_add_option_kwargs.py:46: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_line_buffering0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_line_buffering0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_line_buffering0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_line_buffering0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_option_kwargs.py::test_invalid_function_kwargs

test_add_option_kwargs.py::test_invalid_function_kwargs
def test_invalid_function_kwargs():
        def function(message):
            pass

>       with pytest.raises(TypeError, match=r"add\(\) got an unexpected keyword argument"):
E       Failed: DID NOT RAISE 

function   = .function at 0x7fac0b752200>

tests/test_add_option_kwargs.py:55: Failed

test_add_option_kwargs.py::test_invalid_file_object_kwargs

test_add_option_kwargs.py::test_invalid_file_object_kwargs
def test_invalid_file_object_kwargs():
        class Writer:
            def __init__(self):
                self.out = ""

            def write(self, m):
                pass

        writer = Writer()

>       with pytest.raises(TypeError, match=r"add\(\) got an unexpected keyword argument"):
E       Failed: DID NOT RAISE 

Writer     = .Writer'>
writer     = .Writer object at 0x7fac0b5505e0>

tests/test_add_option_kwargs.py:69: Failed

test_add_option_kwargs.py::test_invalid_file_kwargs

test_add_option_kwargs.py::test_invalid_file_kwargs
def test_invalid_file_kwargs():
>       with pytest.raises(TypeError, match=r".*keyword argument;*"):
E       Failed: DID NOT RAISE 


tests/test_add_option_kwargs.py:74: Failed

test_add_option_kwargs.py::test_invalid_coroutine_kwargs

test_add_option_kwargs.py::test_invalid_coroutine_kwargs
def test_invalid_coroutine_kwargs():
        async def foo():
            pass

>       with pytest.raises(TypeError, match=r"add\(\) got an unexpected keyword argument"):
E       Failed: DID NOT RAISE 

foo        = .foo at 0x7fac0b7527a0>

tests/test_add_option_kwargs.py:82: Failed

test_add_option_level.py::test_level_low_enough[0]

test_add_option_level.py::test_level_low_enough[0]
writer = .w at 0x7fac0b53d750>, level = 0

    @pytest.mark.parametrize("level", [0, "TRACE", "INFO", 20])
    def test_level_low_enough(writer, level):
        logger.add(writer, level=level, format="{message}")
        logger.info("Test level")
>       assert writer.read() == "Test level\n"
E       AssertionError: assert '' == 'Test level\n'
E         
E         - Test level

level      = 0
writer     = .w at 0x7fac0b53d750>

tests/test_add_option_level.py:10: AssertionError

test_add_option_level.py::test_level_low_enough[TRACE]

test_add_option_level.py::test_level_low_enough[TRACE]
writer = .w at 0x7fac0b53ee60>, level = 'TRACE'

    @pytest.mark.parametrize("level", [0, "TRACE", "INFO", 20])
    def test_level_low_enough(writer, level):
        logger.add(writer, level=level, format="{message}")
        logger.info("Test level")
>       assert writer.read() == "Test level\n"
E       AssertionError: assert '' == 'Test level\n'
E         
E         - Test level

level      = 'TRACE'
writer     = .w at 0x7fac0b53ee60>

tests/test_add_option_level.py:10: AssertionError

test_add_option_level.py::test_level_low_enough[INFO]

test_add_option_level.py::test_level_low_enough[INFO]
writer = .w at 0x7fac0b1fd2d0>, level = 'INFO'

    @pytest.mark.parametrize("level", [0, "TRACE", "INFO", 20])
    def test_level_low_enough(writer, level):
        logger.add(writer, level=level, format="{message}")
        logger.info("Test level")
>       assert writer.read() == "Test level\n"
E       AssertionError: assert '' == 'Test level\n'
E         
E         - Test level

level      = 'INFO'
writer     = .w at 0x7fac0b1fd2d0>

tests/test_add_option_level.py:10: AssertionError

test_add_option_level.py::test_level_low_enough[20]

test_add_option_level.py::test_level_low_enough[20]
writer = .w at 0x7fac0b53cca0>, level = 20

    @pytest.mark.parametrize("level", [0, "TRACE", "INFO", 20])
    def test_level_low_enough(writer, level):
        logger.add(writer, level=level, format="{message}")
        logger.info("Test level")
>       assert writer.read() == "Test level\n"
E       AssertionError: assert '' == 'Test level\n'
E         
E         - Test level

level      = 20
writer     = .w at 0x7fac0b53cca0>

tests/test_add_option_level.py:10: AssertionError

test_add_option_level.py::test_invalid_level[3.4]

test_add_option_level.py::test_invalid_level[3.4]
writer = .w at 0x7fac0b1fd3f0>, level = 3.4

    @pytest.mark.parametrize("level", [3.4, object()])
    def test_invalid_level(writer, level):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

level      = 3.4
writer     = .w at 0x7fac0b1fd3f0>

tests/test_add_option_level.py:22: Failed

test_add_option_level.py::test_invalid_level[level1]

test_add_option_level.py::test_invalid_level[level1]
writer = .w at 0x7fac0b1fc8b0>
level = 

    @pytest.mark.parametrize("level", [3.4, object()])
    def test_invalid_level(writer, level):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

level      = 
writer     = .w at 0x7fac0b1fc8b0>

tests/test_add_option_level.py:22: Failed


test_add_option_level.py::test_unknown_level[foo]

test_add_option_level.py::test_unknown_level[foo]
writer = .w at 0x7fac0b53ecb0>, level = 'foo'

    @pytest.mark.parametrize("level", ["foo", -1])
    def test_unknown_level(writer, level):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

level      = 'foo'
writer     = .w at 0x7fac0b53ecb0>

tests/test_add_option_level.py:28: Failed

test_add_option_level.py::test_unknown_level[-1]

test_add_option_level.py::test_unknown_level[-1]
writer = .w at 0x7fac0b53d6c0>, level = -1

    @pytest.mark.parametrize("level", ["foo", -1])
    def test_unknown_level(writer, level):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

level      = -1
writer     = .w at 0x7fac0b53d6c0>

tests/test_add_option_level.py:28: Failed

test_add_option_serialize.py::test_serialize

test_add_option_serialize.py::test_serialize
def test_serialize():
        sink = JsonSink()
        logger.add(sink, format="{level} {message}", serialize=True)
        logger.debug("Test")
>       assert sink.json["text"] == "DEBUG Test\n"
E       TypeError: 'NoneType' object is not subscriptable

sink       = 

tests/test_add_option_serialize.py:24: TypeError

test_add_option_serialize.py::test_serialize_non_ascii_characters

test_add_option_serialize.py::test_serialize_non_ascii_characters
def test_serialize_non_ascii_characters():
        sink = JsonSink()
        logger.add(sink, format="{level.icon} {message}", serialize=True)
        logger.debug("天")
>       assert re.search(r'"message": "([^\"]+)"', sink.message).group(1) == "天"

sink       = 

tests/test_add_option_serialize.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pattern = '"message": "([^\\"]+)"', string = None, flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

flags      = 0
pattern    = '"message": "([^\\"]+)"'
string     = None

/usr/lib/python3.10/re.py:200: TypeError

test_add_option_serialize.py::test_serialize_exception

test_add_option_serialize.py::test_serialize_exception
def test_serialize_exception():
        sink = JsonSink()
        logger.add(sink, format="{message}", serialize=True, catch=False)

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error")

>       lines = sink.json["text"].splitlines()
E       TypeError: 'NoneType' object is not subscriptable

sink       = 

tests/test_add_option_serialize.py:49: TypeError

test_add_option_serialize.py::test_serialize_exception_without_context

test_add_option_serialize.py::test_serialize_exception_without_context
def test_serialize_exception_without_context():
        sink = JsonSink()
        logger.add(sink, format="{message}", serialize=True, catch=False)

        logger.exception("No Error")

>       lines = sink.json["text"].splitlines()
E       TypeError: 'NoneType' object is not subscriptable

sink       = 

tests/test_add_option_serialize.py:66: TypeError

test_add_option_serialize.py::test_serialize_exception_none_tuple

test_add_option_serialize.py::test_serialize_exception_none_tuple
def test_serialize_exception_none_tuple():
        sink = JsonSink()
        logger.add(sink, format="{message}", serialize=True, catch=False)

>       logger.opt(exception=(None, None, None)).error("No Error")
E       AttributeError: 'NoneType' object has no attribute 'error'

sink       = 

tests/test_add_option_serialize.py:81: AttributeError

test_add_option_serialize.py::test_serialize_exception_instance

test_add_option_serialize.py::test_serialize_exception_instance
def test_serialize_exception_instance():
        sink = JsonSink()
        logger.add(sink, format="{message}", serialize=True, catch=False)

>       logger.opt(exception=ZeroDivisionError("Oops")).error("Failure")
E       AttributeError: 'NoneType' object has no attribute 'error'

sink       = 

tests/test_add_option_serialize.py:98: AttributeError

test_add_option_serialize.py::test_serialize_with_catch_decorator

test_add_option_serialize.py::test_serialize_with_catch_decorator
def test_serialize_with_catch_decorator():
        sink = JsonSink()
        logger.add(sink, format="{message}", serialize=True, catch=False)

        @logger.catch
        def foo():
            1 / 0  # noqa: B018

>       foo()
E       TypeError: 'NoneType' object is not callable

foo        = None
sink       = 

tests/test_add_option_serialize.py:119: TypeError

test_add_option_serialize.py::test_serialize_with_record_option

test_add_option_serialize.py::test_serialize_with_record_option
def test_serialize_with_record_option():
        sink = JsonSink()
        logger.add(sink, format="{message}", serialize=True, catch=False)

>       logger.opt(record=True).info("Test", foo=123)
E       AttributeError: 'NoneType' object has no attribute 'info'

sink       = 

tests/test_add_option_serialize.py:131: AttributeError

test_add_option_serialize.py::test_serialize_not_serializable

test_add_option_serialize.py::test_serialize_not_serializable
def test_serialize_not_serializable():
        sink = JsonSink()
        logger.add(sink, format="{message}", catch=False, serialize=True)
        not_serializable = object()
>       logger.bind(not_serializable=not_serializable).debug("Test")
E       AttributeError: 'NoneType' object has no attribute 'debug'

not_serializable = 
sink       = 

tests/test_add_option_serialize.py:141: AttributeError


test_add_sinks.py::test_stdout_sink[1]

test_add_sinks.py::test_stdout_sink[1]
rep = 1, capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b1062f0>

    @repetitions
    def test_stdout_sink(rep, capsys):
        log(sys.stdout, rep)
        out, err = capsys.readouterr()
>       assert out == expected * rep
E       AssertionError: assert '' == 'test message\n'
E         
E         - test message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b1062f0>
err        = ''
out        = ''
rep        = 1

tests/test_add_sinks.py:40: AssertionError

test_add_sinks.py::test_stdout_sink[2]

test_add_sinks.py::test_stdout_sink[2]
rep = 2, capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b18b490>

    @repetitions
    def test_stdout_sink(rep, capsys):
        log(sys.stdout, rep)
        out, err = capsys.readouterr()
>       assert out == expected * rep
E       AssertionError: assert '' == 'test message\ntest message\n'
E         
E         - test message
E         - test message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b18b490>
err        = ''
out        = ''
rep        = 2

tests/test_add_sinks.py:40: AssertionError

test_add_sinks.py::test_stderr_sink[1]

test_add_sinks.py::test_stderr_sink[1]
rep = 1, capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b744250>

    @repetitions
    def test_stderr_sink(rep, capsys):
        log(sys.stderr, rep)
        out, err = capsys.readouterr()
        assert out == ""
>       assert err == expected * rep
E       AssertionError: assert '' == 'test message\n'
E         
E         - test message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b744250>
err        = ''
out        = ''
rep        = 1

tests/test_add_sinks.py:49: AssertionError

test_add_sinks.py::test_stderr_sink[2]

test_add_sinks.py::test_stderr_sink[2]
rep = 2, capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b9787f0>

    @repetitions
    def test_stderr_sink(rep, capsys):
        log(sys.stderr, rep)
        out, err = capsys.readouterr()
        assert out == ""
>       assert err == expected * rep
E       AssertionError: assert '' == 'test message\ntest message\n'
E         
E         - test message
E         - test message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b9787f0>
err        = ''
out        = ''
rep        = 2

tests/test_add_sinks.py:49: AssertionError

test_add_sinks.py::test_file_sink[str-0]

test_add_sinks.py::test_file_sink[str-0]
rep = 0, sink_from_path = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0/test.log')
rep        = 0
sink       = '/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0/test.log'
sink_from_path = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0')

tests/test_add_sinks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_0_0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink[str-1]

test_add_sinks.py::test_file_sink[str-1]
rep = 1, sink_from_path = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0/test.log')
rep        = 1
sink       = '/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0/test.log'
sink_from_path = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0')

tests/test_add_sinks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_1_0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink[str-2]

test_add_sinks.py::test_file_sink[str-2]
rep = 2, sink_from_path = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0/test.log')
rep        = 2
sink       = '/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0/test.log'
sink_from_path = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0')

tests/test_add_sinks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_str_2_0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink[Path-0]

test_add_sinks.py::test_file_sink[Path-0]
rep = 0, sink_from_path = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0/test.log')
rep        = 0
sink       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0/test.log')
sink_from_path = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0')

tests/test_add_sinks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_0_0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink[Path-1]

test_add_sinks.py::test_file_sink[Path-1]
rep = 1, sink_from_path = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0/test.log')
rep        = 1
sink       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0/test.log')
sink_from_path = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0')

tests/test_add_sinks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_1_0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink[Path-2]

test_add_sinks.py::test_file_sink[Path-2]
rep = 2, sink_from_path = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0/test.log')
rep        = 2
sink       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0/test.log')
sink_from_path = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0')

tests/test_add_sinks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_Path_2_0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink[0-1]

test_add_sinks.py::test_file_sink[0-1]
rep = 1, sink_from_path =  at 0x7fac0bf1a050>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_1_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep
E       AssertionError: assert '' == 'test message\n'
E         
E         - test message

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_1_0/test.log')
rep        = 1
sink       = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_1_0/test.log' mode='a' encoding='UTF-8'>
sink_from_path =  at 0x7fac0bf1a050>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_1_0')

tests/test_add_sinks.py:66: AssertionError

test_add_sinks.py::test_file_sink[0-2]

test_add_sinks.py::test_file_sink[0-2]
rep = 2, sink_from_path =  at 0x7fac0bf1a050>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_2_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep
E       AssertionError: assert '' == 'test message\ntest message\n'
E         
E         - test message
E         - test message

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_2_0/test.log')
rep        = 2
sink       = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_2_0/test.log' mode='a' encoding='UTF-8'>
sink_from_path =  at 0x7fac0bf1a050>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_0_2_0')

tests/test_add_sinks.py:66: AssertionError

test_add_sinks.py::test_file_sink[1-1]

test_add_sinks.py::test_file_sink[1-1]
rep = 1, sink_from_path =  at 0x7fac0bf1a0e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_1_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep
E       AssertionError: assert '' == 'test message\n'
E         
E         - test message

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_1_0/test.log')
rep        = 1
sink       = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_1_0/test.log' mode='a' encoding='UTF-8'>
sink_from_path =  at 0x7fac0bf1a0e0>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_1_0')

tests/test_add_sinks.py:66: AssertionError

test_add_sinks.py::test_file_sink[1-2]

test_add_sinks.py::test_file_sink[1-2]
rep = 2, sink_from_path =  at 0x7fac0bf1a0e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_2_0')

    @repetitions
    @pytest.mark.parametrize(
        "sink_from_path",
        [str, pathlib.Path, lambda path: open(path, "a"), lambda path: pathlib.Path(path).open("a")],
    )
    def test_file_sink(rep, sink_from_path, tmp_path):
        file = tmp_path / "test.log"
        sink = sink_from_path(str(file))
        log(sink, rep)
>       assert file.read_text() == expected * rep
E       AssertionError: assert '' == 'test message\ntest message\n'
E         
E         - test message
E         - test message

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_2_0/test.log')
rep        = 2
sink       = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_2_0/test.log' mode='a' encoding='UTF-8'>
sink_from_path =  at 0x7fac0bf1a0e0>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink__lambda_1_2_0')

tests/test_add_sinks.py:66: AssertionError

test_add_sinks.py::test_file_sink_folder_creation[0]

test_add_sinks.py::test_file_sink_folder_creation[0]
rep = 0
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0')

    @repetitions
    def test_file_sink_folder_creation(rep, tmp_path):
        file = tmp_path.joinpath("some", "sub", "folder", "not", "existing", "test.log")
        log(file, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0/some/sub/folder/not/existing/test.log')
rep        = 0
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0')

tests/test_add_sinks.py:73: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0/some/sub/folder/not/existing/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0/some/sub/folder/not/existing/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0/some/sub/folder/not/existing/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation0/some/sub/folder/not/existing/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink_folder_creation[1]

test_add_sinks.py::test_file_sink_folder_creation[1]
rep = 1
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1')

    @repetitions
    def test_file_sink_folder_creation(rep, tmp_path):
        file = tmp_path.joinpath("some", "sub", "folder", "not", "existing", "test.log")
        log(file, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1/some/sub/folder/not/existing/test.log')
rep        = 1
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1')

tests/test_add_sinks.py:73: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1/some/sub/folder/not/existing/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1/some/sub/folder/not/existing/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1/some/sub/folder/not/existing/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation1/some/sub/folder/not/existing/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink_folder_creation[2]

test_add_sinks.py::test_file_sink_folder_creation[2]
rep = 2
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2')

    @repetitions
    def test_file_sink_folder_creation(rep, tmp_path):
        file = tmp_path.joinpath("some", "sub", "folder", "not", "existing", "test.log")
        log(file, rep)
>       assert file.read_text() == expected * rep

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2/some/sub/folder/not/existing/test.log')
rep        = 2
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2')

tests/test_add_sinks.py:73: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2/some/sub/folder/not/existing/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2/some/sub/folder/not/existing/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2/some/sub/folder/not/existing/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_folder_creation2/some/sub/folder/not/existing/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_function_sink[1]

test_add_sinks.py::test_function_sink[1]
rep = 1

    @repetitions
    def test_function_sink(rep):
        a = []

        def func(log_message):
            a.append(log_message)

        log(func, rep)
>       assert a == [expected] * rep
E       AssertionError: assert [] == ['test message\n']
E         
E         Right contains one more item: 'test message\n'
E         Use -v to get more diff

a          = []
func       = .func at 0x7fac0b53e9e0>
rep        = 1

tests/test_add_sinks.py:84: AssertionError

test_add_sinks.py::test_function_sink[2]

test_add_sinks.py::test_function_sink[2]
rep = 2

    @repetitions
    def test_function_sink(rep):
        a = []

        def func(log_message):
            a.append(log_message)

        log(func, rep)
>       assert a == [expected] * rep
E       AssertionError: assert [] == ['test messag...st message\n']
E         
E         Right contains 2 more items, first extra item: 'test message\n'
E         Use -v to get more diff

a          = []
func       = .func at 0x7fac0b1fd000>
rep        = 2

tests/test_add_sinks.py:84: AssertionError

test_add_sinks.py::test_coroutine_sink[0]

test_add_sinks.py::test_coroutine_sink[0]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0cf721d0>, rep = 0

    @repetitions
    def test_coroutine_sink(capsys, rep):
        async def async_print(msg):
            await asyncio.sleep(0.01)
            print(msg, end="")
            await asyncio.sleep(0.01)

>       asyncio.run(async_log(async_print, rep))

async_print = .async_print at 0x7fac0b1fdea0>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0cf721d0>
rep        = 0

tests/test_add_sinks.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     =  exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

sink = .async_print at 0x7fac0b1fdea0>
rep = 0

    async def async_log(sink, rep=1):
        logger.debug("This shouldn't be printed.")
        i = logger.add(sink, format="{message}")
        for _ in range(rep):
            logger.debug(message)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

i          = None
rep        = 0
sink       = .async_print at 0x7fac0b1fdea0>

tests/test_add_sinks.py:31: TypeError

test_add_sinks.py::test_coroutine_sink[1]

test_add_sinks.py::test_coroutine_sink[1]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b123af0>, rep = 1

    @repetitions
    def test_coroutine_sink(capsys, rep):
        async def async_print(msg):
            await asyncio.sleep(0.01)
            print(msg, end="")
            await asyncio.sleep(0.01)

>       asyncio.run(async_log(async_print, rep))

async_print = .async_print at 0x7fac0b1fdc60>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b123af0>
rep        = 1

tests/test_add_sinks.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     =  exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

sink = .async_print at 0x7fac0b1fdc60>
rep = 1

    async def async_log(sink, rep=1):
        logger.debug("This shouldn't be printed.")
        i = logger.add(sink, format="{message}")
        for _ in range(rep):
            logger.debug(message)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

_          = 0
i          = None
rep        = 1
sink       = .async_print at 0x7fac0b1fdc60>

tests/test_add_sinks.py:31: TypeError

test_add_sinks.py::test_coroutine_sink[2]

test_add_sinks.py::test_coroutine_sink[2]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b1883a0>, rep = 2

    @repetitions
    def test_coroutine_sink(capsys, rep):
        async def async_print(msg):
            await asyncio.sleep(0.01)
            print(msg, end="")
            await asyncio.sleep(0.01)

>       asyncio.run(async_log(async_print, rep))

async_print = .async_print at 0x7fac0b1fe290>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b1883a0>
rep        = 2

tests/test_add_sinks.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     =  exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

sink = .async_print at 0x7fac0b1fe290>
rep = 2

    async def async_log(sink, rep=1):
        logger.debug("This shouldn't be printed.")
        i = logger.add(sink, format="{message}")
        for _ in range(rep):
            logger.debug(message)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

_          = 1
i          = None
rep        = 2
sink       = .async_print at 0x7fac0b1fe290>

tests/test_add_sinks.py:31: TypeError

test_add_sinks.py::test_file_object_sink[1]

test_add_sinks.py::test_file_object_sink[1]
rep = 1

    @repetitions
    def test_file_object_sink(rep):
        class A:
            def __init__(self):
                self.out = ""

            def write(self, m):
                self.out += m

        a = A()
        log(a, rep)
>       assert a.out == expected * rep
E       AssertionError: assert '' == 'test message\n'
E         
E         - test message

A          = .A'>
a          = .A object at 0x7fac0b538df0>
rep        = 1

tests/test_add_sinks.py:112: AssertionError

test_add_sinks.py::test_file_object_sink[2]

test_add_sinks.py::test_file_object_sink[2]
rep = 2

    @repetitions
    def test_file_object_sink(rep):
        class A:
            def __init__(self):
                self.out = ""

            def write(self, m):
                self.out += m

        a = A()
        log(a, rep)
>       assert a.out == expected * rep
E       AssertionError: assert '' == 'test message\ntest message\n'
E         
E         - test message
E         - test message

A          = .A'>
a          = .A object at 0x7fac0b18b310>
rep        = 2

tests/test_add_sinks.py:112: AssertionError

test_add_sinks.py::test_standard_handler_sink[1]

test_add_sinks.py::test_standard_handler_sink[1]
rep = 1

    @repetitions
    def test_standard_handler_sink(rep):
        out = []

        class H(logging.Handler):
            def emit(self, record):
                out.append(record.getMessage() + "\n")

        h = H()
        log(h, rep)
>       assert out == [expected] * rep
E       AssertionError: assert [] == ['test message\n']
E         
E         Right contains one more item: 'test message\n'
E         Use -v to get more diff

H          = .H'>
h          = 
out        = []
rep        = 1

tests/test_add_sinks.py:125: AssertionError

test_add_sinks.py::test_standard_handler_sink[2]

test_add_sinks.py::test_standard_handler_sink[2]
rep = 2

    @repetitions
    def test_standard_handler_sink(rep):
        out = []

        class H(logging.Handler):
            def emit(self, record):
                out.append(record.getMessage() + "\n")

        h = H()
        log(h, rep)
>       assert out == [expected] * rep
E       AssertionError: assert [] == ['test messag...st message\n']
E         
E         Right contains 2 more items, first extra item: 'test message\n'
E         Use -v to get more diff

H          = .H'>
h          = 
out        = []
rep        = 2

tests/test_add_sinks.py:125: AssertionError

test_add_sinks.py::test_flush[1]

test_add_sinks.py::test_flush[1]
rep = 1

    @repetitions
    def test_flush(rep):
        flushed = []
        out = []

        class A:
            def write(self, m):
                out.append(m)

            def flush(self):
                flushed.append(out[-1])

        log(A(), rep)
>       assert flushed == [expected] * rep
E       AssertionError: assert [] == ['test message\n']
E         
E         Right contains one more item: 'test message\n'
E         Use -v to get more diff

A          = .A'>
flushed    = []
out        = []
rep        = 1

tests/test_add_sinks.py:141: AssertionError

test_add_sinks.py::test_flush[2]

test_add_sinks.py::test_flush[2]
rep = 2

    @repetitions
    def test_flush(rep):
        flushed = []
        out = []

        class A:
            def write(self, m):
                out.append(m)

            def flush(self):
                flushed.append(out[-1])

        log(A(), rep)
>       assert flushed == [expected] * rep
E       AssertionError: assert [] == ['test messag...st message\n']
E         
E         Right contains 2 more items, first extra item: 'test message\n'
E         Use -v to get more diff

A          = .A'>
flushed    = []
out        = []
rep        = 2

tests/test_add_sinks.py:141: AssertionError

test_add_sinks.py::test_file_sink_ascii_encoding

test_add_sinks.py::test_file_sink_ascii_encoding
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0')

    def test_file_sink_ascii_encoding(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, encoding="ascii", format="{message}", errors="backslashreplace", catch=False)
        logger.info("天")
        logger.remove()
>       assert file.read_text("ascii") == "\\u5929\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0')

tests/test_add_sinks.py:149: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'ascii'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0/test.log')
mode = 'r', buffering = -1, encoding = 'ascii', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0/test.log'

buffering  = -1
encoding   = 'ascii'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink_utf8_encoding

test_add_sinks.py::test_file_sink_utf8_encoding
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0')

    def test_file_sink_utf8_encoding(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, encoding="utf8", format="{message}", errors="strict", catch=False)
        logger.info("天")
        logger.remove()
>       assert file.read_text("utf8") == "天\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0')

tests/test_add_sinks.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'utf8'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0/test.log')
mode = 'r', buffering = -1, encoding = 'utf8', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0/test.log'

buffering  = -1
encoding   = 'utf8'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_file_sink_default_encoding

test_add_sinks.py::test_file_sink_default_encoding
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0')

    def test_file_sink_default_encoding(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", errors="strict", catch=False)
        logger.info("天")
        logger.remove()
>       assert file.read_text("utf8") == "天\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0')

tests/test_add_sinks.py:165: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'utf8'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0/test.log')
mode = 'r', buffering = -1, encoding = 'utf8', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0/test.log'

buffering  = -1
encoding   = 'utf8'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_default_encodin0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_add_sinks.py::test_disabled_logger_in_sink

test_add_sinks.py::test_disabled_logger_in_sink
sink_with_logger = .SinkWithLogger'>

    def test_disabled_logger_in_sink(sink_with_logger):
        sink = sink_with_logger(logger)
        logger.disable("tests.conftest")
        logger.add(sink, format="{message}")
        logger.info("Disabled test")
>       assert sink.out == "Disabled test\n"
E       AssertionError: assert '' == 'Disabled test\n'
E         
E         - Disabled test

sink       = .SinkWithLogger object at 0x7fac0b06c940>
sink_with_logger = .SinkWithLogger'>

tests/test_add_sinks.py:173: AssertionError

test_add_sinks.py::test_custom_sink_invalid_flush[123]

test_add_sinks.py::test_custom_sink_invalid_flush[123]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b0788b0>, flush = 123

    @pytest.mark.parametrize("flush", [123, None])
    def test_custom_sink_invalid_flush(capsys, flush):
        class Sink:
            def __init__(self):
                self.flush = flush

            def write(self, message):
                print(message, end="")

        logger.add(Sink(), format="{message}")
        logger.info("Test")

        out, err = capsys.readouterr()
>       assert out == "Test\n"
E       AssertionError: assert '' == 'Test\n'
E         
E         - Test

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b0788b0>
err        = ''
flush      = 123
out        = ''

tests/test_add_sinks.py:189: AssertionError

test_add_sinks.py::test_custom_sink_invalid_flush[None]

test_add_sinks.py::test_custom_sink_invalid_flush[None]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0ba4d810>, flush = None

    @pytest.mark.parametrize("flush", [123, None])
    def test_custom_sink_invalid_flush(capsys, flush):
        class Sink:
            def __init__(self):
                self.flush = flush

            def write(self, message):
                print(message, end="")

        logger.add(Sink(), format="{message}")
        logger.info("Test")

        out, err = capsys.readouterr()
>       assert out == "Test\n"
E       AssertionError: assert '' == 'Test\n'
E         
E         - Test

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0ba4d810>
err        = ''
flush      = None
out        = ''

tests/test_add_sinks.py:189: AssertionError

test_add_sinks.py::test_custom_sink_invalid_stop[123]

test_add_sinks.py::test_custom_sink_invalid_stop[123]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b0cd0c0>, stop = 123

    @pytest.mark.parametrize("stop", [123, None])
    def test_custom_sink_invalid_stop(capsys, stop):
        class Sink:
            def __init__(self):
                self.stop = stop

            def write(self, message):
                print(message, end="")

        logger.add(Sink(), format="{message}")
        logger.info("Test")
        logger.remove()

        out, err = capsys.readouterr()
>       assert out == "Test\n"
E       AssertionError: assert '' == 'Test\n'
E         
E         - Test

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b0cd0c0>
err        = ''
out        = ''
stop       = 123

tests/test_add_sinks.py:207: AssertionError

test_add_sinks.py::test_custom_sink_invalid_stop[None]

test_add_sinks.py::test_custom_sink_invalid_stop[None]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b058af0>, stop = None

    @pytest.mark.parametrize("stop", [123, None])
    def test_custom_sink_invalid_stop(capsys, stop):
        class Sink:
            def __init__(self):
                self.stop = stop

            def write(self, message):
                print(message, end="")

        logger.add(Sink(), format="{message}")
        logger.info("Test")
        logger.remove()

        out, err = capsys.readouterr()
>       assert out == "Test\n"
E       AssertionError: assert '' == 'Test\n'
E         
E         - Test

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b058af0>
err        = ''
out        = ''
stop       = None

tests/test_add_sinks.py:207: AssertionError

test_add_sinks.py::test_custom_sink_invalid_complete[123]

test_add_sinks.py::test_custom_sink_invalid_complete[123]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b5b4d00>
complete = 123

    @pytest.mark.parametrize("complete", [123, None, lambda: None])
    def test_custom_sink_invalid_complete(capsys, complete):
        class Sink:
            def __init__(self):
                self.complete = complete

            def write(self, message):
                print(message, end="")

        async def worker():
            logger.info("Test")
            await logger.complete()

        logger.add(Sink(), format="{message}")
>       asyncio.run(worker())

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b5b4d00>
complete   = 123
worker     = .worker at 0x7fac0b1fdb40>

tests/test_add_sinks.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac0b0fe730>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_add_sinks.py:220> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("Test")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_add_sinks.py:222: TypeError

test_add_sinks.py::test_custom_sink_invalid_complete[None]

test_add_sinks.py::test_custom_sink_invalid_complete[None]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b550730>
complete = None

    @pytest.mark.parametrize("complete", [123, None, lambda: None])
    def test_custom_sink_invalid_complete(capsys, complete):
        class Sink:
            def __init__(self):
                self.complete = complete

            def write(self, message):
                print(message, end="")

        async def worker():
            logger.info("Test")
            await logger.complete()

        logger.add(Sink(), format="{message}")
>       asyncio.run(worker())

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b550730>
complete   = None
worker     = .worker at 0x7fac0b1feb00>

tests/test_add_sinks.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac0b0762d0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_add_sinks.py:220> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("Test")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_add_sinks.py:222: TypeError

test_add_sinks.py::test_custom_sink_invalid_complete[]

test_add_sinks.py::test_custom_sink_invalid_complete[]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b106770>
complete =  at 0x7fac0bf1a8c0>

    @pytest.mark.parametrize("complete", [123, None, lambda: None])
    def test_custom_sink_invalid_complete(capsys, complete):
        class Sink:
            def __init__(self):
                self.complete = complete

            def write(self, message):
                print(message, end="")

        async def worker():
            logger.info("Test")
            await logger.complete()

        logger.add(Sink(), format="{message}")
>       asyncio.run(worker())

Sink       = .Sink'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b106770>
complete   =  at 0x7fac0bf1a8c0>
worker     = .worker at 0x7fac0b1fd750>

tests/test_add_sinks.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac0b0fc580>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_add_sinks.py:220> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("Test")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_add_sinks.py:222: TypeError

test_add_sinks.py::test_deprecated_start_and_stop

test_add_sinks.py::test_deprecated_start_and_stop
writer = .w at 0x7fac09420280>

    def test_deprecated_start_and_stop(writer):
>       with pytest.warns(DeprecationWarning):
E       Failed: DID NOT WARN. No warnings of type (,) were emitted.
E        Emitted warnings: [].

i          = None
writer     = .w at 0x7fac09420280>

tests/test_add_sinks.py:239: Failed

bold>-\x1b[1m1\x1b[0m]

bold>-\x1b[1m1\x1b[0m]
text = '1', expected = '\x1b[1m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
        ],
    )
    def test_styles(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[1m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bold, bold

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

dim>-\x1b[2m1\x1b[0m]

dim>-\x1b[2m1\x1b[0m]
text = '1', expected = '\x1b[2m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
        ],
    )
    def test_styles(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[2m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: dim, dim

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

normal>-\x1b[22m1\x1b[0m]

normal>-\x1b[22m1\x1b[0m]
text = '1', expected = '\x1b[22m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
        ],
    )
    def test_styles(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[22m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: normal, normal

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

b>-\x1b[1m1\x1b[0m]

b>-\x1b[1m1\x1b[0m]
text = '1', expected = '\x1b[1m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
        ],
    )
    def test_styles(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[1m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: b, b

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

d>-\x1b[2m1\x1b[0m]

d>-\x1b[2m1\x1b[0m]
text = '1', expected = '\x1b[2m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
        ],
    )
    def test_styles(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[2m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: d, d

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

n>-\x1b[22m1\x1b[0m]

n>-\x1b[22m1\x1b[0m]
text = '1', expected = '\x1b[22m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
            ("1", Style.BRIGHT + "1" + Style.RESET_ALL),
            ("1", Style.DIM + "1" + Style.RESET_ALL),
            ("1", Style.NORMAL + "1" + Style.RESET_ALL),
        ],
    )
    def test_styles(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[22m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: n, n

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

RED>-\x1b[41m1\x1b[0m]

RED>-\x1b[41m1\x1b[0m]
text = '1', expected = '\x1b[41m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[41m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: RED, RED

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

R>-\x1b[41m1\x1b[0m]

R>-\x1b[41m1\x1b[0m]
text = '1', expected = '\x1b[41m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[41m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: R, R

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

LIGHT-GREEN>-\x1b[102m1\x1b[0m]

LIGHT-GREEN>-\x1b[102m1\x1b[0m]
text = '1', expected = '\x1b[102m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[102m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: LIGHT-GREEN, LIGHT-GREEN

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

LG>-\x1b[102m1\x1b[0m]

LG>-\x1b[102m1\x1b[0m]
text = '1', expected = '\x1b[102m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[102m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: LG, LG

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

yellow>-\x1b[33m1\x1b[0m]

yellow>-\x1b[33m1\x1b[0m]
text = '1', expected = '\x1b[33m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[33m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: yellow, yellow

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

y>-\x1b[33m1\x1b[0m]

y>-\x1b[33m1\x1b[0m]
text = '1', expected = '\x1b[33m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[33m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: y, y

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

light-white>-\x1b[97m1\x1b[0m]

light-white>-\x1b[97m1\x1b[0m]
text = '1', expected = '\x1b[97m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[97m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: light-white, light-white

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

lw>-\x1b[97m1\x1b[0m]

lw>-\x1b[97m1\x1b[0m]
text = '1', expected = '\x1b[97m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[97m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_basic.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: lw, lw

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

d>-\x1b[1m1\x1b[0m\x1b[2m2\x1b[0m]

d>-\x1b[1m1\x1b[0m\x1b[2m2\x1b[0m]
text = '12', expected = '\x1b[1m1\x1b[0m\x1b[2m2\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "12",
                Style.BRIGHT + "1" + Style.RESET_ALL + Style.DIM + "2" + Style.RESET_ALL,
            ),
            (
                "123",
                Style.BRIGHT + "1" + Style.RESET_ALL + "2" + Style.DIM + "3" + Style.RESET_ALL,
            ),
            (
                "01234",
                "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + "4",
            ),
            (
                "01234",
                Style.DIM
                + "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.DIM
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + Style.DIM
                + "4"
                + Style.RESET_ALL,
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[1m1\x1b[0m\x1b[2m2\x1b[0m'
text       = '12'

tests/test_ansimarkup_basic.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '12'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: b, b, d, d

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

d>-\x1b[1m1\x1b[0m2\x1b[2m3\x1b[0m]

d>-\x1b[1m1\x1b[0m2\x1b[2m3\x1b[0m]
text = '123', expected = '\x1b[1m1\x1b[0m2\x1b[2m3\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "12",
                Style.BRIGHT + "1" + Style.RESET_ALL + Style.DIM + "2" + Style.RESET_ALL,
            ),
            (
                "123",
                Style.BRIGHT + "1" + Style.RESET_ALL + "2" + Style.DIM + "3" + Style.RESET_ALL,
            ),
            (
                "01234",
                "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + "4",
            ),
            (
                "01234",
                Style.DIM
                + "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.DIM
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + Style.DIM
                + "4"
                + Style.RESET_ALL,
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[1m1\x1b[0m2\x1b[2m3\x1b[0m'
text       = '123'

tests/test_ansimarkup_basic.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '123'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: b, b, d, d

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

b>4-0\x1b[1m1\x1b[2m2\x1b[0m\x1b[1m3\x1b[0m4]

b>4-0\x1b[1m1\x1b[2m2\x1b[0m\x1b[1m3\x1b[0m4]
text = '01234'
expected = '0\x1b[1m1\x1b[2m2\x1b[0m\x1b[1m3\x1b[0m4'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "12",
                Style.BRIGHT + "1" + Style.RESET_ALL + Style.DIM + "2" + Style.RESET_ALL,
            ),
            (
                "123",
                Style.BRIGHT + "1" + Style.RESET_ALL + "2" + Style.DIM + "3" + Style.RESET_ALL,
            ),
            (
                "01234",
                "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + "4",
            ),
            (
                "01234",
                Style.DIM
                + "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.DIM
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + Style.DIM
                + "4"
                + Style.RESET_ALL,
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '0\x1b[1m1\x1b[2m2\x1b[0m\x1b[1m3\x1b[0m4'
text       = '01234'

tests/test_ansimarkup_basic.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '01234'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: b, d, d, b

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

d>-\x1b[2m0\x1b[1m1\x1b[2m2\x1b[0m\x1b[2m\x1b[1m3\x1b[0m\x1b[2m4\x1b[0m]

d>-\x1b[2m0\x1b[1m1\x1b[2m2\x1b[0m\x1b[2m\x1b[1m3\x1b[0m\x1b[2m4\x1b[0m]
text = '01234'
expected = '\x1b[2m0\x1b[1m1\x1b[2m2\x1b[0m\x1b[2m\x1b[1m3\x1b[0m\x1b[2m4\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "12",
                Style.BRIGHT + "1" + Style.RESET_ALL + Style.DIM + "2" + Style.RESET_ALL,
            ),
            (
                "123",
                Style.BRIGHT + "1" + Style.RESET_ALL + "2" + Style.DIM + "3" + Style.RESET_ALL,
            ),
            (
                "01234",
                "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + "4",
            ),
            (
                "01234",
                Style.DIM
                + "0"
                + Style.BRIGHT
                + "1"
                + Style.DIM
                + "2"
                + Style.RESET_ALL
                + Style.DIM
                + Style.BRIGHT
                + "3"
                + Style.RESET_ALL
                + Style.DIM
                + "4"
                + Style.RESET_ALL,
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[2m0\x1b[1m1\x1b[2m2\x1b[0m\x1b[2m\x1b[1m3\x1b[0m\x1b[2m4\x1b[0m'
text       = '01234'

tests/test_ansimarkup_basic.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '01234'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: d, b, d, d, b, d

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

test_ansimarkup_basic.py::test_permissive_parsing[-\x1b[1m]

test_ansimarkup_basic.py::test_permissive_parsing[-\x1b[1m]
text = '', expected = '\x1b[1m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("", Style.BRIGHT),
            ("", Back.YELLOW + Style.BRIGHT + Style.RESET_ALL + Back.YELLOW),
            ("", Style.BRIGHT + Style.BRIGHT + Style.RESET_ALL + Style.BRIGHT),
        ],
    )
    def test_permissive_parsing(text, expected):
>       assert parse(text, strip=False, strict=False) == expected
E       AssertionError: assert '' == '\x1b[1m'
E         
E         - 

expected   = '\x1b[1m'
text       = ''

tests/test_ansimarkup_basic.py:110: AssertionError

b>-\x1b[43m\x1b[1m\x1b[0m\x1b[43m]

b>-\x1b[43m\x1b[1m\x1b[0m\x1b[43m]
text = '', expected = '\x1b[43m\x1b[1m\x1b[0m\x1b[43m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("", Style.BRIGHT),
            ("", Back.YELLOW + Style.BRIGHT + Style.RESET_ALL + Back.YELLOW),
            ("", Style.BRIGHT + Style.BRIGHT + Style.RESET_ALL + Style.BRIGHT),
        ],
    )
    def test_permissive_parsing(text, expected):
>       assert parse(text, strip=False, strict=False) == expected
E       AssertionError: assert '' == '\x1b[43m\x1b...1b[0m\x1b[43m'
E         
E         - 

expected   = '\x1b[43m\x1b[1m\x1b[0m\x1b[43m'
text       = ''

tests/test_ansimarkup_basic.py:110: AssertionError

b>-\x1b[1m\x1b[1m\x1b[0m\x1b[1m]

b>-\x1b[1m\x1b[1m\x1b[0m\x1b[1m]
text = '', expected = '\x1b[1m\x1b[1m\x1b[0m\x1b[1m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("", Style.BRIGHT),
            ("", Back.YELLOW + Style.BRIGHT + Style.RESET_ALL + Back.YELLOW),
            ("", Style.BRIGHT + Style.BRIGHT + Style.RESET_ALL + Style.BRIGHT),
        ],
    )
    def test_permissive_parsing(text, expected):
>       assert parse(text, strip=False, strict=False) == expected
E       AssertionError: assert '' == '\x1b[1m\x1b[1m\x1b[0m\x1b[1m'
E         
E         - 

expected   = '\x1b[1m\x1b[1m\x1b[0m\x1b[1m'
text       = ''

tests/test_ansimarkup_basic.py:110: AssertionError

>-\x1b[31mfoo\x1b[0m]

>-\x1b[31mfoo\x1b[0m]
text = 'foo', expected = '\x1b[31mfoo\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", Fore.RED + "foo" + Style.RESET_ALL),
            (
                "bar",
                Fore.GREEN + Style.BRIGHT + "bar" + Style.RESET_ALL + Fore.GREEN + Style.RESET_ALL,
            ),
            (
                "abcde",
                "a"
                + Fore.YELLOW
                + "b"
                + Style.BRIGHT
                + "c"
                + Style.RESET_ALL
                + Fore.YELLOW
                + "d"
                + Style.RESET_ALL
                + "e",
            ),
        ],
    )
    def test_autoclose(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31mfoo\x1b[0m'
text       = 'foo'

tests/test_ansimarkup_basic.py:137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = 'foo'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red,

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

green>-\x1b[32m\x1b[1mbar\x1b[0m\x1b[32m\x1b[0m]

green>-\x1b[32m\x1b[1mbar\x1b[0m\x1b[32m\x1b[0m]
text = 'bar'
expected = '\x1b[32m\x1b[1mbar\x1b[0m\x1b[32m\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", Fore.RED + "foo" + Style.RESET_ALL),
            (
                "bar",
                Fore.GREEN + Style.BRIGHT + "bar" + Style.RESET_ALL + Fore.GREEN + Style.RESET_ALL,
            ),
            (
                "abcde",
                "a"
                + Fore.YELLOW
                + "b"
                + Style.BRIGHT
                + "c"
                + Style.RESET_ALL
                + Fore.YELLOW
                + "d"
                + Style.RESET_ALL
                + "e",
            ),
        ],
    )
    def test_autoclose(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[32m\x1b[1mbar\x1b[0m\x1b[32m\x1b[0m'
text       = 'bar'

tests/test_ansimarkup_basic.py:137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = 'bar'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: green, bold, , green

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

>e-a\x1b[33mb\x1b[1mc\x1b[0m\x1b[33md\x1b[0me]

>e-a\x1b[33mb\x1b[1mc\x1b[0m\x1b[33md\x1b[0me]
text = 'abcde'
expected = 'a\x1b[33mb\x1b[1mc\x1b[0m\x1b[33md\x1b[0me'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", Fore.RED + "foo" + Style.RESET_ALL),
            (
                "bar",
                Fore.GREEN + Style.BRIGHT + "bar" + Style.RESET_ALL + Fore.GREEN + Style.RESET_ALL,
            ),
            (
                "abcde",
                "a"
                + Fore.YELLOW
                + "b"
                + Style.BRIGHT
                + "c"
                + Style.RESET_ALL
                + Fore.YELLOW
                + "d"
                + Style.RESET_ALL
                + "e",
            ),
        ],
    )
    def test_autoclose(text, expected):
>       assert parse(text, strip=False) == expected

expected   = 'a\x1b[33mb\x1b[1mc\x1b[0m\x1b[33md\x1b[0me'
text       = 'abcde'

tests/test_ansimarkup_basic.py:137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = 'abcde'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: yellow, b, ,

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

red>bar\x1b[0m]

red>bar\x1b[0m]
text = 'foo\\bar', expected = '\x1b[31mfoobar\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (r"foo\bar", Fore.RED + "foobar" + Style.RESET_ALL),
            (r"foo\bar", Fore.RED + "foobar" + Style.RESET_ALL),
            (r"\\", ""),
            (r"foo\bar\baz", "foobarbaz"),
        ],
    )
    def test_escaping(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31mfoobar\x1b[0m'
text       = 'foo\\bar'

tests/test_ansimarkup_basic.py:150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = 'foo\\bar'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

red>-\x1b[31mfoobar\x1b[0m]

red>-\x1b[31mfoobar\x1b[0m]
text = 'foo\\bar', expected = '\x1b[31mfoobar\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (r"foo\bar", Fore.RED + "foobar" + Style.RESET_ALL),
            (r"foo\bar", Fore.RED + "foobar" + Style.RESET_ALL),
            (r"\\", ""),
            (r"foo\bar\baz", "foobarbaz"),
        ],
    )
    def test_escaping(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31mfoobar\x1b[0m'
text       = 'foo\\bar'

tests/test_ansimarkup_basic.py:150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = 'foo\\bar'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

red>-foo]

red>-foo]
text = 'foo', expected = 'foo'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", "foo"),
            ("bar", "bar"),
            ("baz", "baz"),
            ("123", "123"),
            ("foo", "foo"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'foo'
text       = 'foo'

tests/test_ansimarkup_basic.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'foo'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

BLACK>-bar]

BLACK>-bar]
text = 'bar', expected = 'bar'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", "foo"),
            ("bar", "bar"),
            ("baz", "baz"),
            ("123", "123"),
            ("foo", "foo"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'bar'
text       = 'bar'

tests/test_ansimarkup_basic.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'bar'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: BLACK, BLACK

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

b>-baz]

b>-baz]
text = 'baz', expected = 'baz'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", "foo"),
            ("bar", "bar"),
            ("baz", "baz"),
            ("123", "123"),
            ("foo", "foo"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'baz'
text       = 'baz'

tests/test_ansimarkup_basic.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'baz'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: b, b

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

d>-123]

d>-123]
text = '123', expected = '123'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", "foo"),
            ("bar", "bar"),
            ("baz", "baz"),
            ("123", "123"),
            ("foo", "foo"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '123'
text       = '123'

tests/test_ansimarkup_basic.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '123'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: b, b, d, d

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

>-foo]

>-foo]
text = 'foo', expected = 'foo'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foo", "foo"),
            ("bar", "bar"),
            ("baz", "baz"),
            ("123", "123"),
            ("foo", "foo"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'foo'
text       = 'foo'

tests/test_ansimarkup_basic.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'foo'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red,

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg red>-\x1b[41m1\x1b[0m]

bg red>-\x1b[41m1\x1b[0m]
text = '1', expected = '\x1b[41m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.BLACK + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTMAGENTA_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[41m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg red, bg red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg BLACK>-\x1b[40m1\x1b[0m]

bg BLACK>-\x1b[40m1\x1b[0m]
text = '1', expected = '\x1b[40m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.BLACK + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTMAGENTA_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[40m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg BLACK, bg BLACK

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg light-green>-\x1b[102m1\x1b[0m]

bg light-green>-\x1b[102m1\x1b[0m]
text = '1', expected = '\x1b[102m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.BLACK + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTMAGENTA_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[102m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg light-green, bg light-green

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg LIGHT-MAGENTA>-\x1b[105m1\x1b[0m]

bg LIGHT-MAGENTA>-\x1b[105m1\x1b[0m]
text = '1', expected = '\x1b[105m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Back.RED + "1" + Style.RESET_ALL),
            ("1", Back.BLACK + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTGREEN_EX + "1" + Style.RESET_ALL),
            ("1", Back.LIGHTMAGENTA_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_background_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[105m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg LIGHT-MAGENTA, bg LIGHT-MAGENTA

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg yellow>-\x1b[33m1\x1b[0m]

fg yellow>-\x1b[33m1\x1b[0m]
text = '1', expected = '\x1b[33m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.BLUE + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTCYAN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[33m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg yellow, fg yellow

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg BLUE>-\x1b[34m1\x1b[0m]

fg BLUE>-\x1b[34m1\x1b[0m]
text = '1', expected = '\x1b[34m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.BLUE + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTCYAN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[34m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg BLUE, fg BLUE

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg light-white>-\x1b[97m1\x1b[0m]

fg light-white>-\x1b[97m1\x1b[0m]
text = '1', expected = '\x1b[97m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.BLUE + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTCYAN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[97m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg light-white, fg light-white

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg LIGHT-CYAN>-\x1b[96m1\x1b[0m]

fg LIGHT-CYAN>-\x1b[96m1\x1b[0m]
text = '1', expected = '\x1b[96m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", Fore.YELLOW + "1" + Style.RESET_ALL),
            ("1", Fore.BLUE + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTWHITE_EX + "1" + Style.RESET_ALL),
            ("1", Fore.LIGHTCYAN_EX + "1" + Style.RESET_ALL),
        ],
    )
    def test_foreground_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[96m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg LIGHT-CYAN, fg LIGHT-CYAN

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg #ff0000>-\x1b[38;2;255;0;0m1\x1b[0m]

fg #ff0000>-\x1b[38;2;255;0;0m1\x1b[0m]
text = '1', expected = '\x1b[38;2;255;0;0m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
        ],
    )
    def test_8bit_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[38;2;255;0;0m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg #ff0000, fg #ff0000

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg #00A000>-\x1b[48;2;0;160;0m1\x1b[0m]

bg #00A000>-\x1b[48;2;0;160;0m1\x1b[0m]
text = '1', expected = '\x1b[48;2;0;160;0m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
        ],
    )
    def test_8bit_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;2;0;160;0m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg #00A000, bg #00A000

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg #F12>-\x1b[38;2;241;47;18m1\x1b[0m]

fg #F12>-\x1b[38;2;241;47;18m1\x1b[0m]
text = '1', expected = '\x1b[38;2;241;47;18m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
        ],
    )
    def test_8bit_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[38;2;241;47;18m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg #F12, fg #F12

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg #ff0000>-\x1b[38;2;255;0;0m1\x1b[0m]

fg #ff0000>-\x1b[38;2;255;0;0m1\x1b[0m]
text = '1', expected = '\x1b[38;2;255;0;0m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;190;235;238m" "1" + Style.RESET_ALL),
        ],
    )
    def test_hex_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[38;2;255;0;0m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg #ff0000, fg #ff0000

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg #00A000>-\x1b[48;2;0;160;0m1\x1b[0m]

bg #00A000>-\x1b[48;2;0;160;0m1\x1b[0m]
text = '1', expected = '\x1b[48;2;0;160;0m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;190;235;238m" "1" + Style.RESET_ALL),
        ],
    )
    def test_hex_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;2;0;160;0m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg #00A000, bg #00A000

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg #F12>-\x1b[38;2;241;47;18m1\x1b[0m]

fg #F12>-\x1b[38;2;241;47;18m1\x1b[0m]
text = '1', expected = '\x1b[38;2;241;47;18m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;190;235;238m" "1" + Style.RESET_ALL),
        ],
    )
    def test_hex_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[38;2;241;47;18m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg #F12, fg #F12

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg #BEE>-\x1b[48;2;190;235;238m1\x1b[0m]

bg #BEE>-\x1b[48;2;190;235;238m1\x1b[0m]
text = '1', expected = '\x1b[48;2;190;235;238m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;2;255;0;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;0;160;0m" "1" + Style.RESET_ALL),
            ("1", "\x1b[38;2;241;47;18m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;2;190;235;238m" "1" + Style.RESET_ALL),
        ],
    )
    def test_hex_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;2;190;235;238m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg #BEE, bg #BEE

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg 200>-\x1b[38;5;200m1\x1b[0m]

fg 200>-\x1b[38;5;200m1\x1b[0m]
text = '1', expected = '\x1b[38;5;200m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;5;200m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;5;49m" "1" + Style.RESET_ALL),
        ],
    )
    def test_rgb_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[38;5;200m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg 200, fg 200

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg 49>-\x1b[48;5;49m1\x1b[0m]

bg 49>-\x1b[48;5;49m1\x1b[0m]
text = '1', expected = '\x1b[48;5;49m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("1", "\x1b[38;5;200m" "1" + Style.RESET_ALL),
            ("1", "\x1b[48;5;49m" "1" + Style.RESET_ALL),
        ],
    )
    def test_rgb_colors(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;5;49m1\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg 49, bg 49

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

red>-\x1b[31m\x1b[1m\x1b[48;2;0;160;0m1\x1b[0m\x1b[31m\x1b[1m\x1b[0m\x1b[31m\x1b[0m]

red>-\x1b[31m\x1b[1m\x1b[48;2;0;160;0m1\x1b[0m\x1b[31m\x1b[1m\x1b[0m\x1b[31m\x1b[0m]
text = '1'
expected = '\x1b[31m\x1b[1m\x1b[48;2;0;160;0m1\x1b[0m\x1b[31m\x1b[1m\x1b[0m\x1b[31m\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "1",
                Fore.RED + Style.BRIGHT + "\x1b[48;2;0;160;0m"
                "1"
                + Style.RESET_ALL
                + Fore.RED
                + Style.BRIGHT
                + Style.RESET_ALL
                + Fore.RED
                + Style.RESET_ALL,
            ),
            (
                "1",
                "\x1b[48;5;100m" "\x1b[38;5;200m" "1" "\x1b[0m" "\x1b[48;5;100m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31m\x1b[1m\x1b[48;2;0;160;0m1\x1b[0m\x1b[31m\x1b[1m\x1b[0m\x1b[31m\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, b, bg #00A000, bg #00A000, b, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg 100>-\x1b[48;5;100m\x1b[38;5;200m1\x1b[0m\x1b[48;5;100m\x1b[0m]

bg 100>-\x1b[48;5;100m\x1b[38;5;200m1\x1b[0m\x1b[48;5;100m\x1b[0m]
text = '1'
expected = '\x1b[48;5;100m\x1b[38;5;200m1\x1b[0m\x1b[48;5;100m\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "1",
                Fore.RED + Style.BRIGHT + "\x1b[48;2;0;160;0m"
                "1"
                + Style.RESET_ALL
                + Fore.RED
                + Style.BRIGHT
                + Style.RESET_ALL
                + Fore.RED
                + Style.RESET_ALL,
            ),
            (
                "1",
                "\x1b[48;5;100m" "\x1b[38;5;200m" "1" "\x1b[0m" "\x1b[48;5;100m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;5;100m\x1b[38;5;200m1\x1b[0m\x1b[48;5;100m\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg 100, fg 200, fg 200, bg 100

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg #00a000>-\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m]

bg #00a000>-\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m]
text = '1'
expected = '\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "1",
                Fore.RED + Style.BRIGHT + "\x1b[48;2;0;160;0m"
                "1"
                + Style.RESET_ALL
                + Fore.RED
                + Style.BRIGHT
                + Style.RESET_ALL
                + Fore.RED
                + Style.RESET_ALL,
            ),
            (
                "1",
                "\x1b[48;5;100m" "\x1b[38;5;200m" "1" "\x1b[0m" "\x1b[48;5;100m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg #00a000, fg #FF0000, fg #FF0000, bg #00a000

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg 0,160,0>-\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m]

bg 0,160,0>-\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m]
text = '1'
expected = '\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            (
                "1",
                Fore.RED + Style.BRIGHT + "\x1b[48;2;0;160;0m"
                "1"
                + Style.RESET_ALL
                + Fore.RED
                + Style.BRIGHT
                + Style.RESET_ALL
                + Fore.RED
                + Style.RESET_ALL,
            ),
            (
                "1",
                "\x1b[48;5;100m" "\x1b[38;5;200m" "1" "\x1b[0m" "\x1b[48;5;100m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
            (
                "1",
                "\x1b[48;2;0;160;0m" "\x1b[38;2;255;0;0m" "1" "\x1b[0m" "\x1b[48;2;0;160;0m" "\x1b[0m",
            ),
        ],
    )
    def test_nested(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[48;2;0;160;0m\x1b[38;2;255;0;0m1\x1b[0m\x1b[48;2;0;160;0m\x1b[0m'
text       = '1'

tests/test_ansimarkup_extended.py:98: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg 0,160,0, fg 255,0,0, fg 255,0,0, bg 0,160,0

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>-\x1b[31m2 > 1\x1b[0m]

r>-\x1b[31m2 > 1\x1b[0m]
text = '2 > 1', expected = '\x1b[31m2 > 1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31m2 > 1\x1b[0m'
text       = '2 > 1'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '2 > 1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>-\x1b[31m1 < 2\x1b[0m]

r>-\x1b[31m1 < 2\x1b[0m]
text = '1 < 2', expected = '\x1b[31m1 < 2\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31m1 < 2\x1b[0m'
text       = '1 < 2'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1 < 2'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

2\x1b[0m]

 2\x1b[0m]
text = '1 ', expected = '\x1b[31m1 2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31m1 1 '

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1 '
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>-{: <10}\x1b[31m1\x1b[0m]

r>-{: <10}\x1b[31m1\x1b[0m]
text = '{: <10}1', expected = '{: <10}\x1b[31m1\x1b[0m'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '{: <10}\x1b[31m1\x1b[0m'
text       = '{: <10}1'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '{: <10}1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

10}\x1b[31m1\x1b[0m]

10}\x1b[31m1\x1b[0m]
text = '{: 1', expected = '{: 2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '{: 1'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '{: 1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>{: >10}-\x1b[31m1\x1b[0m{: >10}]

r>{: >10}-\x1b[31m1\x1b[0m{: >10}]
text = '1{: >10}', expected = '\x1b[31m1\x1b[0m{: >10}'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '\x1b[31m1\x1b[0m{: >10}'
text       = '1{: >10}'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '1{: >10}'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>3>-<1\x1b[31m2\x1b[0m3>]

r>3>-<1\x1b[31m2\x1b[0m3>]
text = '<123>', expected = '<1\x1b[31m2\x1b[0m3>'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '<1\x1b[31m2\x1b[0m3>'
text       = '<123>'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '<123>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

1\x1b[31m2\x1b[0m3>]

1\x1b[31m2\x1b[0m3>]
text = '23>', expected = ''

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = ''
text       = '23>'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '23>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>4>-<1\x1b[31m2 < 3\x1b[0m4>]

r>4>-<1\x1b[31m2 < 3\x1b[0m4>]
text = '<12 < 34>', expected = '<1\x1b[31m2 < 3\x1b[0m4>'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '<1\x1b[31m2 < 3\x1b[0m4>'
text       = '<12 < 34>'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '<12 < 34>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

3\x1b[0m4>]

 3\x1b[0m4>]
text = '<12 4>', expected = '<1\x1b[31m2 '

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '<1\x1b[31m2 '
text       = '<12 4>'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '<12 4>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>4>-<1\x1b[31m3 > 2\x1b[0m4>]

r>4>-<1\x1b[31m3 > 2\x1b[0m4>]
text = '<13 > 24>', expected = '<1\x1b[31m3 > 2\x1b[0m4>'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", Fore.RED + "2 > 1" + Style.RESET_ALL),
            ("1 < 2", Fore.RED + "1 < 2" + Style.RESET_ALL),
            ("1 ", Fore.RED + "1 1", "{: <10}" + Fore.RED + "1" + Style.RESET_ALL),
            ("{: 1", "{: 1{: >10}", Fore.RED + "1" + Style.RESET_ALL + "{: >10}"),
            ("<123>", "<1" + Fore.RED + "2" + Style.RESET_ALL + "3>"),
            ("23>", ""),
            ("<12 < 34>", "<1" + Fore.RED + "2 < 3" + Style.RESET_ALL + "4>"),
            ("<12 4>", "<1" + Fore.RED + "2 "),
            ("<13 > 24>", "<1" + Fore.RED + "3 > 2" + Style.RESET_ALL + "4>"),
        ],
    )
    def test_tricky_parse(text, expected):
>       assert parse(text, strip=False) == expected

expected   = '<1\x1b[31m3 > 2\x1b[0m4>'
text       = '<13 > 24>'

tests/test_ansimarkup_extended.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '<13 > 24>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg #ff0000>-foobar]

fg #ff0000>-foobar]
text = 'foobar', expected = 'foobar'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foobar", "foobar"),
            ("baz", "baz"),
            ("bar", "bar"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'foobar'
text       = 'foobar'

tests/test_ansimarkup_extended.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'foobar'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg #ff0000, fg #ff0000

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

fg 55>-baz]

fg 55>-baz]
text = 'baz', expected = 'baz'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foobar", "foobar"),
            ("baz", "baz"),
            ("bar", "bar"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'baz'
text       = 'baz'

tests/test_ansimarkup_extended.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'baz'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: fg 55, fg 55

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

bg 23,12,12>-bar]

bg 23,12,12>-bar]
text = 'bar', expected = 'bar'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("foobar", "foobar"),
            ("baz", "baz"),
            ("bar", "bar"),
        ],
    )
    def test_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = 'bar'
text       = 'bar'

tests/test_ansimarkup_extended.py:190: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = 'bar'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: bg 23,12,12, bg 23,12,12

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>-2 > 1]

r>-2 > 1]
text = '2 > 1', expected = '2 > 1'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '2 > 1'
text       = '2 > 1'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '2 > 1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>-1 < 2]

r>-1 < 2]
text = '1 < 2', expected = '1 < 2'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '1 < 2'
text       = '1 < 2'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '1 < 2'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

2]

 2]
text = '1 ', expected = '1 2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '1 1 '

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '1 '
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>-{: <10}1]

r>-{: <10}1]
text = '{: <10}1', expected = '{: <10}1'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '{: <10}1'
text       = '{: <10}1'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '{: <10}1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

10}1]

10}1]
text = '{: 1', expected = '{: 2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '{: 1'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '{: 1'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>{: >10}-1{: >10}]

r>{: >10}-1{: >10}]
text = '1{: >10}', expected = '1{: >10}'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '1{: >10}'
text       = '1{: >10}'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '1{: >10}'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>3>-<123>]

r>3>-<123>]
text = '<123>', expected = '<123>'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '<123>'
text       = '<123>'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '<123>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

123>]

123>]
text = '23>', expected = ''

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = ''
text       = '23>'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '23>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>4>-<12 < 34>]

r>4>-<12 < 34>]
text = '<12 < 34>', expected = '<12 < 34>'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '<12 < 34>'
text       = '<12 < 34>'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '<12 < 34>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

34>]

 34>]
text = '<12 4>', expected = '<12 '

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '<12 '
text       = '<12 4>'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '<12 4>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

r>4>-<13 > 24>]

r>4>-<13 > 24>]
text = '<13 > 24>', expected = '<13 > 24>'

    @pytest.mark.parametrize(
        "text, expected",
        [
            ("2 > 1", "2 > 1"),
            ("1 < 2", "1 < 2"),
            ("1 ", "1 1", "{: <10}1"),
            ("{: 1", "{: 1{: >10}", "1{: >10}"),
            ("<123>", "<123>"),
            ("23>", ""),
            ("<12 < 34>", "<12 < 34>"),
            ("<12 4>", "<12 "),
            ("<13 > 24>", "<13 > 24>"),
        ],
    )
    def test_tricky_strip(text, expected):
>       assert parse(text, strip=True) == expected

expected   = '<13 > 24>'
text       = '<13 > 24>'

tests/test_ansimarkup_extended.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '<13 > 24>'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: r, r

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

test_bind.py::test_bind_after_add

test_bind.py::test_bind_after_add
writer = .w at 0x7fac09584940>

    def test_bind_after_add(writer):
        logger.add(writer, format="{extra[a]} {message}")
        logger_bound = logger.bind(a=0)
>       logger_bound.debug("A")
E       AttributeError: 'NoneType' object has no attribute 'debug'

logger_bound = None
writer     = .w at 0x7fac09584940>

tests/test_bind.py:9: AttributeError

test_bind.py::test_bind_before_add

test_bind.py::test_bind_before_add
writer = .w at 0x7fac09585ab0>

    def test_bind_before_add(writer):
        logger_bound = logger.bind(a=0)
        logger.add(writer, format="{extra[a]} {message}")
>       logger_bound.debug("A")
E       AttributeError: 'NoneType' object has no attribute 'debug'

logger_bound = None
writer     = .w at 0x7fac09585ab0>

tests/test_bind.py:17: AttributeError

test_bind.py::test_add_using_bound

test_bind.py::test_add_using_bound
writer = .w at 0x7fac09585870>

    def test_add_using_bound(writer):
        logger.configure(extra={"a": -1})
        logger_bound = logger.bind(a=0)
>       logger_bound.add(writer, format="{extra[a]} {message}")
E       AttributeError: 'NoneType' object has no attribute 'add'

logger_bound = None
writer     = .w at 0x7fac09585870>

tests/test_bind.py:25: AttributeError

test_bind.py::test_not_override_parent_logger

test_bind.py::test_not_override_parent_logger
writer = .w at 0x7fac09585cf0>

    def test_not_override_parent_logger(writer):
        logger_1 = logger.bind(a="a")
>       logger_2 = logger_1.bind(a="A")
E       AttributeError: 'NoneType' object has no attribute 'bind'

logger_1   = None
writer     = .w at 0x7fac09585cf0>

tests/test_bind.py:34: AttributeError

test_bind.py::test_override_previous_bound

test_bind.py::test_override_previous_bound
writer = .w at 0x7fac09585e10>

    def test_override_previous_bound(writer):
        logger.add(writer, format="{extra[x]} {message}")
>       logger.bind(x=1).bind(x=2).debug("3")
E       AttributeError: 'NoneType' object has no attribute 'bind'

writer     = .w at 0x7fac09585e10>

tests/test_bind.py:45: AttributeError

test_bind.py::test_no_conflict

test_bind.py::test_no_conflict
writer = .w at 0x7fac09586050>

    def test_no_conflict(writer):
        logger_ = logger.bind()
>       logger_2 = logger_.bind(a=2)
E       AttributeError: 'NoneType' object has no attribute 'bind'

logger_    = None
writer     = .w at 0x7fac09586050>

tests/test_bind.py:51: AttributeError

test_bind.py::test_bind_and_add_level[True]

test_bind.py::test_bind_and_add_level[True]
writer = .w at 0x7fac09586290>, using_bound = True

    @pytest.mark.parametrize("using_bound", [True, False])
    def test_bind_and_add_level(writer, using_bound):
        logger_bound = logger.bind()
        logger.add(writer, format="{level.name} {message}")

        if using_bound:
>           logger_bound.level("bar", 15)
E           AttributeError: 'NoneType' object has no attribute 'level'

logger_bound = None
using_bound = True
writer     = .w at 0x7fac09586290>

tests/test_bind.py:68: AttributeError

test_bind.py::test_bind_and_add_level[False]

test_bind.py::test_bind_and_add_level[False]
writer = .w at 0x7fac095864d0>, using_bound = False

    @pytest.mark.parametrize("using_bound", [True, False])
    def test_bind_and_add_level(writer, using_bound):
        logger_bound = logger.bind()
        logger.add(writer, format="{level.name} {message}")

        if using_bound:
            logger_bound.level("bar", 15)
        else:
            logger.level("bar", 15)

        logger.log("bar", "root")
>       logger_bound.log("bar", "bound")
E       AttributeError: 'NoneType' object has no attribute 'log'

logger_bound = None
using_bound = False
writer     = .w at 0x7fac095864d0>

tests/test_bind.py:73: AttributeError

test_bind.py::test_override_configured

test_bind.py::test_override_configured
writer = .w at 0x7fac09586710>

    def test_override_configured(writer):
        logger.configure(extra={"a": 1})
        logger2 = logger.bind(a=2)

>       logger2.add(writer, format="{extra[a]} {message}")
E       AttributeError: 'NoneType' object has no attribute 'add'

logger2    = None
writer     = .w at 0x7fac09586710>

tests/test_bind.py:82: AttributeError

test_colorama.py::test_pycharm_fixed[stdout-True]

test_colorama.py::test_pycharm_fixed[__stdout__-True]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0dbce0e0>
patched = '__stdout__', expected = True

    @pytest.mark.parametrize(
        "patched, expected",
        [
            ("__stdout__", True),
            ("__stderr__", True),
            ("stdout", False),
            ("stderr", False),
            ("", False),
        ],
    )
    def test_pycharm_fixed(monkeypatch, patched, expected):
        stream = StreamIsattyFalse()
        monkeypatch.setattr(sys, patched, stream, raising=False)
        monkeypatch.setitem(os.environ, "PYCHARM_HOSTED", "1")
>       assert should_colorize(stream) is expected
E       assert False is True
E        +  where False = should_colorize()

expected   = True
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0dbce0e0>
patched    = '__stdout__'
stream     = 

tests/test_colorama.py:92: AssertionError

test_colorama.py::test_pycharm_fixed[stderr-True]

test_colorama.py::test_pycharm_fixed[__stderr__-True]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0dbcdea0>
patched = '__stderr__', expected = True

    @pytest.mark.parametrize(
        "patched, expected",
        [
            ("__stdout__", True),
            ("__stderr__", True),
            ("stdout", False),
            ("stderr", False),
            ("", False),
        ],
    )
    def test_pycharm_fixed(monkeypatch, patched, expected):
        stream = StreamIsattyFalse()
        monkeypatch.setattr(sys, patched, stream, raising=False)
        monkeypatch.setitem(os.environ, "PYCHARM_HOSTED", "1")
>       assert should_colorize(stream) is expected
E       assert False is True
E        +  where False = should_colorize()

expected   = True
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0dbcdea0>
patched    = '__stderr__'
stream     = 

tests/test_colorama.py:92: AssertionError

test_colorama.py::test_github_actions_fixed[stdout-True]

test_colorama.py::test_github_actions_fixed[__stdout__-True]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09412c80>
patched = '__stdout__', expected = True

    @pytest.mark.parametrize(
        "patched, expected",
        [
            ("__stdout__", True),
            ("__stderr__", True),
            ("stdout", False),
            ("stderr", False),
            ("", False),
        ],
    )
    def test_github_actions_fixed(monkeypatch, patched, expected):
        stream = StreamIsattyFalse()
        monkeypatch.setitem(os.environ, "CI", "1")
        monkeypatch.setitem(os.environ, "GITHUB_ACTIONS", "1")
        monkeypatch.setattr(sys, patched, stream, raising=False)
>       assert should_colorize(stream) is expected
E       assert False is True
E        +  where False = should_colorize()

expected   = True
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09412c80>
patched    = '__stdout__'
stream     = 

tests/test_colorama.py:110: AssertionError

test_colorama.py::test_github_actions_fixed[stderr-True]

test_colorama.py::test_github_actions_fixed[__stderr__-True]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0cc3a0>
patched = '__stderr__', expected = True

    @pytest.mark.parametrize(
        "patched, expected",
        [
            ("__stdout__", True),
            ("__stderr__", True),
            ("stdout", False),
            ("stderr", False),
            ("", False),
        ],
    )
    def test_github_actions_fixed(monkeypatch, patched, expected):
        stream = StreamIsattyFalse()
        monkeypatch.setitem(os.environ, "CI", "1")
        monkeypatch.setitem(os.environ, "GITHUB_ACTIONS", "1")
        monkeypatch.setattr(sys, patched, stream, raising=False)
>       assert should_colorize(stream) is expected
E       assert False is True
E        +  where False = should_colorize()

expected   = True
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0cc3a0>
patched    = '__stderr__'
stream     = 

tests/test_colorama.py:110: AssertionError

test_colorama.py::test_jupyter_fixed[stdout-StreamIsattyFalse-True]

test_colorama.py::test_jupyter_fixed[stdout-StreamIsattyFalse-True]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0942e3e0>
patched = 'stdout', out_class = 
expected = True

    @pytest.mark.parametrize(
        "patched, out_class, expected",
        [
            ("stdout", StreamIsattyFalse, True),
            ("stderr", StreamIsattyFalse, True),
            ("__stdout__", StreamIsattyFalse, False),
            ("__stderr__", StreamIsattyFalse, False),
            ("stdout", StreamIsattyTrue, False),
            ("stderr", StreamIsattyTrue, False),
            ("", StreamIsattyFalse, False),
        ],
    )
    def test_jupyter_fixed(monkeypatch, patched, out_class, expected):
        stream = StreamIsattyFalse()

        class Shell:
            pass

        ipython = MagicMock()
        ipykernel = MagicMock()
        instance = MagicMock()
        instance.__class__ = Shell
        ipython.get_ipython.return_value = instance
        ipykernel.zmqshell.ZMQInteractiveShell = Shell
        ipykernel.iostream.OutStream = out_class

        monkeypatch.setitem(sys.modules, "IPython", ipython)
        monkeypatch.setitem(sys.modules, "ipykernel", ipykernel)
        monkeypatch.setattr(sys, patched, stream, raising=False)

>       assert should_colorize(stream) is expected
E       assert False is True
E        +  where False = should_colorize()

Shell      = .Shell'>
expected   = True
instance   = 
ipykernel  = 
ipython    = 
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0942e3e0>
out_class  = 
patched    = 'stdout'
stream     = 

tests/test_colorama.py:179: AssertionError

test_colorama.py::test_jupyter_fixed[stderr-StreamIsattyFalse-True]

test_colorama.py::test_jupyter_fixed[stderr-StreamIsattyFalse-True]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0942c070>
patched = 'stderr', out_class = 
expected = True

    @pytest.mark.parametrize(
        "patched, out_class, expected",
        [
            ("stdout", StreamIsattyFalse, True),
            ("stderr", StreamIsattyFalse, True),
            ("__stdout__", StreamIsattyFalse, False),
            ("__stderr__", StreamIsattyFalse, False),
            ("stdout", StreamIsattyTrue, False),
            ("stderr", StreamIsattyTrue, False),
            ("", StreamIsattyFalse, False),
        ],
    )
    def test_jupyter_fixed(monkeypatch, patched, out_class, expected):
        stream = StreamIsattyFalse()

        class Shell:
            pass

        ipython = MagicMock()
        ipykernel = MagicMock()
        instance = MagicMock()
        instance.__class__ = Shell
        ipython.get_ipython.return_value = instance
        ipykernel.zmqshell.ZMQInteractiveShell = Shell
        ipykernel.iostream.OutStream = out_class

        monkeypatch.setitem(sys.modules, "IPython", ipython)
        monkeypatch.setitem(sys.modules, "ipykernel", ipykernel)
        monkeypatch.setattr(sys, patched, stream, raising=False)

>       assert should_colorize(stream) is expected
E       assert False is True
E        +  where False = should_colorize()

Shell      = .Shell'>
expected   = True
instance   = 
ipykernel  = 
ipython    = 
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0942c070>
out_class  = 
patched    = 'stderr'
stream     = 

tests/test_colorama.py:179: AssertionError

test_colorama.py::test_dont_wrap_on_linux[stdout]

test_colorama.py::test_dont_wrap_on_linux[__stdout__]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0e9c90>
patched = '__stdout__', patch_colorama = 

    @pytest.mark.parametrize("patched", ["__stdout__", "__stderr__"])
    @pytest.mark.skipif(os.name == "nt", reason="Colorama is required on Windows")
    def test_dont_wrap_on_linux(monkeypatch, patched, patch_colorama):
        stream = StreamIsattyTrue()
        monkeypatch.setattr(sys, patched, stream, raising=False)
>       assert not should_wrap(stream)
E       assert not True
E        +  where True = should_wrap()

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0e9c90>
patch_colorama = 
patched    = '__stdout__'
stream     = 

tests/test_colorama.py:187: AssertionError

test_colorama.py::test_dont_wrap_on_linux[stderr]

test_colorama.py::test_dont_wrap_on_linux[__stderr__]
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0936ca00>
patched = '__stderr__', patch_colorama = 

    @pytest.mark.parametrize("patched", ["__stdout__", "__stderr__"])
    @pytest.mark.skipif(os.name == "nt", reason="Colorama is required on Windows")
    def test_dont_wrap_on_linux(monkeypatch, patched, patch_colorama):
        stream = StreamIsattyTrue()
        monkeypatch.setattr(sys, patched, stream, raising=False)
>       assert not should_wrap(stream)
E       assert not True
E        +  where True = should_wrap()

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0936ca00>
patch_colorama = 
patched    = '__stderr__'
stream     = 

tests/test_colorama.py:187: AssertionError

test_configure.py::test_handlers

test_configure.py::test_handlers
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b188790>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0')

    def test_handlers(capsys, tmp_path):
        file = tmp_path / "test.log"

        handlers = [
            {"sink": file, "format": "FileSink: {message}"},
            {"sink": sys.stdout, "format": "StdoutSink: {message}"},
        ]

        logger.configure(handlers=handlers)
        logger.debug("test")

        out, err = capsys.readouterr()

>       assert file.read_text() == "FileSink: test\n"

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b188790>
err        = ''
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0/test.log')
handlers   = [{'format': 'FileSink: {message}', 'sink': PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0/test.log')}, {'format': 'StdoutSink: {message}', 'sink': <_io.TextIOWrapper encoding='UTF-8'>}]
out        = ''
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0')

tests/test_configure.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_handlers0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_handlers0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_configure.py::test_levels

test_configure.py::test_levels
writer = .w at 0x7fac09584d30>

    def test_levels(writer):
        levels = [{"name": "my_level", "icon": "X", "no": 12}, {"name": "DEBUG", "icon": "!"}]

        logger.add(writer, format="{level.no}|{level.name}|{level.icon}|{message}")
        logger.configure(levels=levels)

        logger.log("my_level", "test")
        logger.debug("no bug")

>       assert writer.read() == ("12|my_level|X|test\n" "10|DEBUG|!|no bug\n")
E       AssertionError: assert '' == '12|my_level|...UG|!|no bug\n'
E         
E         - 12|my_level|X|test
E         - 10|DEBUG|!|no bug

levels     = [{'icon': 'X', 'name': 'my_level', 'no': 12}, {'icon': '!', 'name': 'DEBUG'}]
writer     = .w at 0x7fac09584d30>

tests/test_configure.py:35: AssertionError

test_configure.py::test_extra

test_configure.py::test_extra
writer = .w at 0x7fac09587490>

    def test_extra(writer):
        extra = {"a": 1, "b": 9}

        logger.add(writer, format="{extra[a]} {extra[b]}")
        logger.configure(extra=extra)

        logger.debug("")

>       assert writer.read() == "1 9\n"
E       AssertionError: assert '' == '1 9\n'
E         
E         - 1 9

extra      = {'a': 1, 'b': 9}
writer     = .w at 0x7fac09587490>

tests/test_configure.py:46: AssertionError

test_configure.py::test_patcher

test_configure.py::test_patcher
writer = .w at 0x7fac095869e0>

    def test_patcher(writer):
        logger.add(writer, format="{extra[a]} {extra[b]}")
        logger.configure(patcher=lambda record: record["extra"].update(a=1, b=2))

        logger.debug("")

>       assert writer.read() == "1 2\n"
E       AssertionError: assert '' == '1 2\n'
E         
E         - 1 2

writer     = .w at 0x7fac095869e0>

tests/test_configure.py:55: AssertionError

test_configure.py::test_activation

test_configure.py::test_activation
writer = .w at 0x7fac09585870>

    def test_activation(writer):
        activation = [("tests", False), ("tests.test_configure", True)]

        logger.add(writer, format="{message}")
        logger.configure(activation=activation)

        logger.debug("Logging")

>       assert writer.read() == "Logging\n"
E       AssertionError: assert '' == 'Logging\n'
E         
E         - Logging

activation = [('tests', False), ('tests.test_configure', True)]
writer     = .w at 0x7fac09585870>

tests/test_configure.py:66: AssertionError

test_configure.py::test_dict_unpacking

test_configure.py::test_dict_unpacking
writer = .w at 0x7fac09587760>

    def test_dict_unpacking(writer):
        config = {
            "handlers": [{"sink": writer, "format": "{level.no} - {extra[x]} {extra[z]} - {message}"}],
            "levels": [{"name": "test", "no": 30}],
            "extra": {"x": 1, "y": 2, "z": 3},
        }

        logger.debug("NOPE")

        logger.configure(**config)

        logger.log("test", "Yes!")

>       assert writer.read() == "30 - 1 3 - Yes!\n"
E       AssertionError: assert '' == '30 - 1 3 - Yes!\n'
E         
E         - 30 - 1 3 - Yes!

config     = {'extra': {'x': 1, 'y': 2, 'z': 3}, 'handlers': [{'format': '{level.no} - {extra[x]} {extra[z]} - {message}', 'sink': .w at 0x7fac09587760>}], 'levels': [{'name': 'test', 'no': 30}]}
writer     = .w at 0x7fac09587760>

tests/test_configure.py:82: AssertionError

test_configure.py::test_returned_ids

test_configure.py::test_returned_ids
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b081030>

    def test_returned_ids(capsys):
        ids = logger.configure(
            handlers=[
                {"sink": sys.stdout, "format": "{message}"},
                {"sink": sys.stderr, "format": "{message}"},
            ]
        )

>       assert len(ids) == 2
E       TypeError: object of type 'NoneType' has no len()

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b081030>
ids        = None

tests/test_configure.py:93: TypeError

test_configure.py::test_dont_reset_by_default

test_configure.py::test_dont_reset_by_default
writer = .w at 0x7fac09587d90>

    def test_dont_reset_by_default(writer):
        logger.configure(extra={"a": 1}, patcher=lambda r: r["extra"].update(b=2))
        logger.level("b", no=30)
        logger.add(writer, format="{level} {extra[a]} {extra[b]} {message}")

        logger.configure()

        logger.log("b", "Test")

>       assert writer.read() == "b 1 2 Test\n"
E       AssertionError: assert '' == 'b 1 2 Test\n'
E         
E         - b 1 2 Test

writer     = .w at 0x7fac09587d90>

tests/test_configure.py:122: AssertionError

test_configure.py::test_reset_previous_extra

test_configure.py::test_reset_previous_extra
writer = .w at 0x7fac09587ac0>

    def test_reset_previous_extra(writer):
        logger.configure(extra={"a": 123})
        logger.add(writer, format="{extra[a]}", catch=False)

        logger.configure(extra={})

>       with pytest.raises(KeyError):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac09587ac0>

tests/test_configure.py:141: Failed

test_configure.py::test_reset_previous_patcher

test_configure.py::test_reset_previous_patcher
writer = .w at 0x7fac095879a0>

    def test_reset_previous_patcher(writer):
        logger.configure(patcher=lambda r: r.update(a=123))
        logger.add(writer, format="{extra[a]}", catch=False)

        logger.configure(patcher=lambda r: None)

>       with pytest.raises(KeyError):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac095879a0>

tests/test_configure.py:151: Failed

test_configure.py::test_dont_reset_previous_levels

test_configure.py::test_dont_reset_previous_levels
writer = .w at 0x7fac09587490>

    def test_dont_reset_previous_levels(writer):
        logger.level("abc", no=30)

        logger.configure(levels=[])

        logger.add(writer, format="{level} {message}")

        logger.log("abc", "Test")

>       assert writer.read() == "abc Test\n"
E       AssertionError: assert '' == 'abc Test\n'
E         
E         - abc Test

writer     = .w at 0x7fac09587490>

tests/test_configure.py:164: AssertionError

test_configure.py::test_configure_handler_using_new_level

test_configure.py::test_configure_handler_using_new_level
writer = .w at 0x7fac093f8160>

    def test_configure_handler_using_new_level(writer):
        logger.configure(
            levels=[{"name": "CONF_LVL", "no": 33, "icon": "", "color": ""}],
            handlers=[
                {"sink": writer, "level": "CONF_LVL", "format": "{level.name} {level.no} {message}"}
            ],
        )

        logger.log("CONF_LVL", "Custom")
>       assert writer.read() == "CONF_LVL 33 Custom\n"
E       AssertionError: assert '' == 'CONF_LVL 33 Custom\n'
E         
E         - CONF_LVL 33 Custom

writer     = .w at 0x7fac093f8160>

tests/test_configure.py:176: AssertionError

test_configure.py::test_configure_filter_using_new_level

test_configure.py::test_configure_filter_using_new_level
writer = .w at 0x7fac09584d30>

    def test_configure_filter_using_new_level(writer):
        logger.configure(
            levels=[{"name": "CONF_LVL_2", "no": 33, "icon": "", "color": ""}],
            handlers=[
                {"sink": writer, "level": 0, "filter": {"tests": "CONF_LVL_2"}, "format": "{message}"}
            ],
        )

        logger.log("CONF_LVL_2", "Custom")
>       assert writer.read() == "Custom\n"
E       AssertionError: assert '' == 'Custom\n'
E         
E         - Custom

writer     = .w at 0x7fac09584d30>

tests/test_configure.py:188: AssertionError

test_configure.py::test_configure_before_bind

test_configure.py::test_configure_before_bind
writer = .w at 0x7fac09587910>

    def test_configure_before_bind(writer):
        logger.configure(extra={"a": "default_a", "b": "default_b"})
        logger.add(writer, format="{extra[a]} {extra[b]} {message}")

        logger.debug("init")

        logger_a = logger.bind(a="A")
        logger_b = logger.bind(b="B")

>       logger_a.debug("aaa")
E       AttributeError: 'NoneType' object has no attribute 'debug'

logger_a   = None
logger_b   = None
writer     = .w at 0x7fac09587910>

tests/test_configure.py:200: AttributeError

test_configure.py::test_configure_after_bind

test_configure.py::test_configure_after_bind
writer = .w at 0x7fac09587370>

    def test_configure_after_bind(writer):
        logger_a = logger.bind(a="A")
        logger_b = logger.bind(b="B")

        logger.configure(extra={"a": "default_a", "b": "default_b"})
        logger.add(writer, format="{extra[a]} {extra[b]} {message}")

        logger.debug("init")

>       logger_a.debug("aaa")
E       AttributeError: 'NoneType' object has no attribute 'debug'

logger_a   = None
logger_b   = None
writer     = .w at 0x7fac09587370>

tests/test_configure.py:215: AttributeError

test_contextualize.py::test_contextualize

test_contextualize.py::test_contextualize
writer = .w at 0x7fac095877f0>

    def test_contextualize(writer):
        logger.add(writer, format="{message} {extra[foo]} {extra[baz]}")

>       with logger.contextualize(foo="bar", baz=123):

writer     = .w at 0x7fac095877f0>

tests/test_contextualize.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_as_decorator

test_contextualize.py::test_contextualize_as_decorator
writer = .w at 0x7fac09587880>

    def test_contextualize_as_decorator(writer):
        logger.add(writer, format="{message} {extra[foo]} {extra[baz]}")

        @logger.contextualize(foo=123, baz="bar")
        def task():
            logger.info("Contextualized")

>       task()

task       = .task at 0x7fac09587ac0>
writer     = .w at 0x7fac09587880>

tests/test_contextualize.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/contextlib.py:78: in inner
    with self._recreate_cm():
        args       = ()
        func       = .task at 0x7fac09587370>
        kwds       = {}
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_in_function

test_contextualize.py::test_contextualize_in_function
writer = .w at 0x7fac09587c70>

    def test_contextualize_in_function(writer):
        logger.add(writer, format="{message} {extra}")

        def foobar():
            logger.info("Foobar!")

>       with logger.contextualize(foobar="baz"):

foobar     = .foobar at 0x7fac09585c60>
writer     = .w at 0x7fac09587c70>

tests/test_contextualize.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_reset

test_contextualize.py::test_contextualize_reset
def test_contextualize_reset():
        contexts = []
        output = []

        def sink(message):
            contexts.append(message.record["extra"])
            output.append(str(message))

        logger.add(sink, format="{level} {message}")

        logger.info("A")

>       with logger.contextualize(abc="def"):

contexts   = []
output     = []
sink       = .sink at 0x7fac09585bd0>

tests/test_contextualize.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_async

test_contextualize.py::test_contextualize_async
writer = .w at 0x7fac093f8af0>

    @pytest.mark.xfail(sys.version_info < (3, 5, 3), reason="ContextVar backport not supported")
    def test_contextualize_async(writer):
        logger.add(writer, format="{message} {extra[i]}", catch=False)

        async def task():
            logger.info("Start")
            await asyncio.sleep(0.1)
            logger.info("End")

        async def worker(i):
            with logger.contextualize(i=i):
                await task()

        async def main():
            workers = [worker(i) for i in range(5)]
            await asyncio.gather(*workers)
            await logger.complete()

>       asyncio.run(main())

main       = .main at 0x7fac093f8940>
task       = .task at 0x7fac09587910>
worker     = .worker at 0x7fac093f8820>
writer     = .w at 0x7fac093f8af0>

tests/test_contextualize.py:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac09566570>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_contextualize.py:80> exception=TypeError("'NoneType' object is not an iterator")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
tests/test_contextualize.py:82: in main
    await asyncio.gather(*workers)
        worker     = .worker at 0x7fac093f8820>
        workers    = [.worker at 0x7fac09566340>, .worker at 0x7fac09566b90>, .worker at 0x7fac09567220>]
tests/test_contextualize.py:77: in worker
    with logger.contextualize(i=i):
        i          = 0
        task       = .task at 0x7fac09587910>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_thread

test_contextualize.py::test_contextualize_thread
writer = .w at 0x7fac093f8f70>

    def test_contextualize_thread(writer):
        logger.add(writer, format="{message} {extra[i]}")

        def task():
            logger.info("Processing")

        def worker(entry_barrier, exit_barrier, i):
            with logger.contextualize(i=i):
                entry_barrier.wait()
                task()
                exit_barrier.wait()

        entry_barrier = threading.Barrier(5)
        exit_barrier = threading.Barrier(5)

        threads = [
            threading.Thread(target=worker, args=(entry_barrier, exit_barrier, i)) for i in range(5)
        ]

        for thread in threads:
            thread.start()

        for thread in threads:
            thread.join()

>       assert sorted(writer.read().splitlines()) == ["Processing %d" % i for i in range(5)]
E       AssertionError: assert [] == ['Processing ...Processing 4']
E         
E         Right contains 5 more items, first extra item: 'Processing 0'
E         Use -v to get more diff

entry_barrier = 
exit_barrier = 
task       = .task at 0x7fac093f9360>
thread     = 
threads    = [, , , , ]
worker     = .worker at 0x7fac093f9000>
writer     = .w at 0x7fac093f8f70>

tests/test_contextualize.py:117: AssertionError

test_contextualize.py::test_contextualize_before_bind

test_contextualize.py::test_contextualize_before_bind
writer = .w at 0x7fac093fbac0>

    def test_contextualize_before_bind(writer):
        logger.add(writer, format="{message} {extra[foobar]}")

        logger_2 = logger.bind(foobar="baz")

>       with logger.contextualize(foobar="baz_2"):

logger_2   = None
writer     = .w at 0x7fac093fbac0>

tests/test_contextualize.py:125: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_after_bind

test_contextualize.py::test_contextualize_after_bind
writer = .w at 0x7fac09587ac0>

    def test_contextualize_after_bind(writer):
        logger.add(writer, format="{message} {extra[foobar]}")

>       with logger.contextualize(foobar="baz"):

writer     = .w at 0x7fac09587ac0>

tests/test_contextualize.py:137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_using_bound

test_contextualize.py::test_contextualize_using_bound
writer = .w at 0x7fac095869e0>

    def test_contextualize_using_bound(writer):
        logger.add(writer, format="{message} {extra[foobar]}")

        logger_2 = logger.bind(foobar="baz")

>       with logger_2.contextualize(foobar="baz_2"):
E       AttributeError: 'NoneType' object has no attribute 'contextualize'

logger_2   = None
writer     = .w at 0x7fac095869e0>

tests/test_contextualize.py:152: AttributeError

test_contextualize.py::test_contextualize_before_configure

test_contextualize.py::test_contextualize_before_configure
writer = .w at 0x7fac09587c70>

    def test_contextualize_before_configure(writer):
        logger.add(writer, format="{message} {extra[foobar]}")

        logger.configure(extra={"foobar": "baz"})

>       with logger.contextualize(foobar="baz_2"):

writer     = .w at 0x7fac09587c70>

tests/test_contextualize.py:166: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextualize_after_configure

test_contextualize.py::test_contextualize_after_configure
writer = .w at 0x7fac095865f0>

    def test_contextualize_after_configure(writer):
        logger.add(writer, format="{message} {extra[foobar]}")

>       with logger.contextualize(foobar="baz"):

writer     = .w at 0x7fac095865f0>

tests/test_contextualize.py:177: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_nested_contextualize

test_contextualize.py::test_nested_contextualize
writer = .w at 0x7fac09585c60>

    def test_nested_contextualize(writer):
        logger.add(writer, format="{message} {extra[foobar]}")

>       with logger.contextualize(foobar="a"):

writer     = .w at 0x7fac09585c60>

tests/test_contextualize.py:189: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_context_reset_despite_error

test_contextualize.py::test_context_reset_despite_error
writer = .w at 0x7fac09587490>

    def test_context_reset_despite_error(writer):
        logger.add(writer, format="{message} {extra}")

        try:
>           with logger.contextualize(foobar=456):

writer     = .w at 0x7fac09587490>

tests/test_contextualize.py:205: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

self       = 

/usr/lib/python3.10/contextlib.py:135: TypeError

test_contextualize.py::test_contextvars_fallback_352

test_contextualize.py::test_contextvars_fallback_352
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0931b3d0>

    def test_contextvars_fallback_352(monkeypatch):
        mock_module = MagicMock()
        monkeypatch.setattr(sys, "version_info", (3, 5, 2))
        monkeypatch.setitem(sys.modules, "contextvars", mock_module)
>       assert load_contextvar_class() == mock_module.ContextVar
E       AssertionError: assert .ContextVar'> == 
E        +  where .ContextVar'> = load_contextvar_class()
E        +  and    = .ContextVar

mock_module = 
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0931b3d0>

tests/test_contextualize.py:220: AssertionError

test_coroutine_sink.py::test_coroutine_function

test_coroutine_sink.py::test_coroutine_function
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b06cc70>

    def test_coroutine_function(capsys):
        async def worker():
            logger.debug("A message")
            await logger.complete()

        logger.add(async_writer, format="{message}")

>       asyncio.run(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b06cc70>
worker     = .worker at 0x7fac093f9120>

tests/test_coroutine_sink.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac094293f0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:25> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.debug("A message")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:27: TypeError

test_coroutine_sink.py::test_async_callable_sink

test_coroutine_sink.py::test_async_callable_sink
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b017310>

    def test_async_callable_sink(capsys):
        async def worker():
            logger.debug("A message")
            await logger.complete()

        logger.add(AsyncWriter(), format="{message}")

>       asyncio.run(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b017310>
worker     = .worker at 0x7fac095877f0>

tests/test_coroutine_sink.py:45: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac0935e9d0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:39> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.debug("A message")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:41: TypeError

test_coroutine_sink.py::test_concurrent_execution

test_coroutine_sink.py::test_concurrent_execution
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0942c520>

    def test_concurrent_execution(capsys):
        async def task(i):
            logger.debug("=> {}", i)

        async def main():
            tasks = [task(i) for i in range(10)]
            await asyncio.gather(*tasks)
            await logger.complete()

        logger.add(async_writer, format="{message}")

>       asyncio.run(main())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0942c520>
main       = .main at 0x7fac093f81f0>
task       = .task at 0x7fac093f8820>

tests/test_coroutine_sink.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac0935f0d0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_coroutine_sink.py:56> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def main():
        tasks = [task(i) for i in range(10)]
        await asyncio.gather(*tasks)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

task       = .task at 0x7fac093f8820>
tasks      = [.task at 0x7fac0935f060>, .task at 0x7fac0935d0e0>, .task at 0x7fac0935d150>, ...]

tests/test_coroutine_sink.py:59: TypeError

test_coroutine_sink.py::test_recursive_coroutine

test_coroutine_sink.py::test_recursive_coroutine
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b079900>

    def test_recursive_coroutine(capsys):
        async def task(i):
            if i == 0:
                await logger.complete()
                return
            logger.info("{}!", i)
            await task(i - 1)

        logger.add(async_writer, format="{message}")

>       asyncio.run(task(9))

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b079900>
task       = .task at 0x7fac09587490>

tests/test_coroutine_sink.py:80: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .task at 0x7fac09567d80>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .task() done, defined at /testbed/tests/test_coroutine_sink.py:71> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 9
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 8
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 7
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 6
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 5
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 4
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 3
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 2
        task       = .task at 0x7fac09587490>
tests/test_coroutine_sink.py:76: in task
    await task(i - 1)
        i          = 1
        task       = .task at 0x7fac09587490>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

i = 0

    async def task(i):
        if i == 0:
>           await logger.complete()
E           TypeError: object NoneType can't be used in 'await' expression

i          = 0
task       = .task at 0x7fac09587490>

tests/test_coroutine_sink.py:73: TypeError

test_coroutine_sink.py::test_using_another_event_loop

test_coroutine_sink.py::test_using_another_event_loop
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0942dae0>

    @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    def test_using_another_event_loop(capsys):
        async def worker():
            logger.debug("A message")
            await logger.complete()

        loop = asyncio.new_event_loop()

        logger.add(async_writer, format="{message}", loop=loop)

>       loop.run_until_complete(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0942dae0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker     = .worker at 0x7fac09587d90>

tests/test_coroutine_sink.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:89> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.debug("A message")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:91: TypeError

test_coroutine_sink.py::test_run_mutiple_different_loops

test_coroutine_sink.py::test_run_mutiple_different_loops
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b0cf1f0>

    def test_run_mutiple_different_loops(capsys):
        async def worker(i):
            logger.debug("Message {}", i)
            await logger.complete()

        logger.add(async_writer, format="{message}", loop=None)

>       asyncio.run(worker(1))

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b0cf1f0>
worker     = .worker at 0x7fac093f93f0>

tests/test_coroutine_sink.py:111: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac094ca9d0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:105> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

i = 1

    async def worker(i):
        logger.debug("Message {}", i)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

i          = 1

tests/test_coroutine_sink.py:107: TypeError

test_coroutine_sink.py::test_run_multiple_same_loop

test_coroutine_sink.py::test_run_multiple_same_loop
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b082bf0>

    @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    def test_run_multiple_same_loop(capsys):
        async def worker(i):
            logger.debug("Message {}", i)
            await logger.complete()

        loop = asyncio.new_event_loop()

        logger.add(async_writer, format="{message}", loop=loop)

>       loop.run_until_complete(worker(1))

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b082bf0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker     = .worker at 0x7fac093fb6d0>

tests/test_coroutine_sink.py:129: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:121> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

i = 1

    async def worker(i):
        logger.debug("Message {}", i)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

i          = 1

tests/test_coroutine_sink.py:123: TypeError

test_coroutine_sink.py::test_using_sink_without_running_loop_not_none

test_coroutine_sink.py::test_using_sink_without_running_loop_not_none
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b0e93f0>

    def test_using_sink_without_running_loop_not_none(capsys):
        loop = asyncio.new_event_loop()

        logger.add(sys.stderr, format="=> {message}")
        logger.add(async_writer, format="{message}", loop=loop)

        logger.info("A message")

>       loop.run_until_complete(logger.complete())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b0e93f0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>

tests/test_coroutine_sink.py:145: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:628: in run_until_complete
    future = tasks.ensure_future(future, loop=self)
        future     = None
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
/usr/lib/python3.10/asyncio/tasks.py:615: in ensure_future
    return _ensure_future(coro_or_future, loop=loop)
        coro_or_future = None
        loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coro_or_future = None

    def _ensure_future(coro_or_future, *, loop=None):
        if futures.isfuture(coro_or_future):
            if loop is not None and loop is not futures._get_loop(coro_or_future):
                raise ValueError('The future belongs to a different loop than '
                                'the one specified as the loop argument')
            return coro_or_future
        called_wrap_awaitable = False
        if not coroutines.iscoroutine(coro_or_future):
            if inspect.isawaitable(coro_or_future):
                coro_or_future = _wrap_awaitable(coro_or_future)
                called_wrap_awaitable = True
            else:
>               raise TypeError('An asyncio.Future, a coroutine or an awaitable '
                                'is required')
E               TypeError: An asyncio.Future, a coroutine or an awaitable is required

called_wrap_awaitable = False
coro_or_future = None
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>

/usr/lib/python3.10/asyncio/tasks.py:630: TypeError

test_coroutine_sink.py::test_using_sink_without_running_loop_none

test_coroutine_sink.py::test_using_sink_without_running_loop_none
capsys = <_pytest.capture.CaptureFixture object at 0x7fac094c13f0>

    def test_using_sink_without_running_loop_none(capsys):
        loop = asyncio.new_event_loop()

        logger.add(sys.stderr, format="=> {message}")
        logger.add(async_writer, format="{message}", loop=None)

        logger.info("A message")

>       loop.run_until_complete(logger.complete())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac094c13f0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>

tests/test_coroutine_sink.py:160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:628: in run_until_complete
    future = tasks.ensure_future(future, loop=self)
        future     = None
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
/usr/lib/python3.10/asyncio/tasks.py:615: in ensure_future
    return _ensure_future(coro_or_future, loop=loop)
        coro_or_future = None
        loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coro_or_future = None

    def _ensure_future(coro_or_future, *, loop=None):
        if futures.isfuture(coro_or_future):
            if loop is not None and loop is not futures._get_loop(coro_or_future):
                raise ValueError('The future belongs to a different loop than '
                                'the one specified as the loop argument')
            return coro_or_future
        called_wrap_awaitable = False
        if not coroutines.iscoroutine(coro_or_future):
            if inspect.isawaitable(coro_or_future):
                coro_or_future = _wrap_awaitable(coro_or_future)
                called_wrap_awaitable = True
            else:
>               raise TypeError('An asyncio.Future, a coroutine or an awaitable '
                                'is required')
E               TypeError: An asyncio.Future, a coroutine or an awaitable is required

called_wrap_awaitable = False
coro_or_future = None
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>

/usr/lib/python3.10/asyncio/tasks.py:630: TypeError

test_coroutine_sink.py::test_global_loop_not_used

test_coroutine_sink.py::test_global_loop_not_used
capsys = <_pytest.capture.CaptureFixture object at 0x7fac095436a0>

    def test_global_loop_not_used(capsys):
        loop = asyncio.new_event_loop()
        asyncio.set_event_loop(loop)

        logger.add(sys.stderr, format="=> {message}")
        logger.add(async_writer, format="{message}", loop=None)

        logger.info("A message")

>       loop.run_until_complete(logger.complete())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac095436a0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>

tests/test_coroutine_sink.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:628: in run_until_complete
    future = tasks.ensure_future(future, loop=self)
        future     = None
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
/usr/lib/python3.10/asyncio/tasks.py:615: in ensure_future
    return _ensure_future(coro_or_future, loop=loop)
        coro_or_future = None
        loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

coro_or_future = None

    def _ensure_future(coro_or_future, *, loop=None):
        if futures.isfuture(coro_or_future):
            if loop is not None and loop is not futures._get_loop(coro_or_future):
                raise ValueError('The future belongs to a different loop than '
                                'the one specified as the loop argument')
            return coro_or_future
        called_wrap_awaitable = False
        if not coroutines.iscoroutine(coro_or_future):
            if inspect.isawaitable(coro_or_future):
                coro_or_future = _wrap_awaitable(coro_or_future)
                called_wrap_awaitable = True
            else:
>               raise TypeError('An asyncio.Future, a coroutine or an awaitable '
                                'is required')
E               TypeError: An asyncio.Future, a coroutine or an awaitable is required

called_wrap_awaitable = False
coro_or_future = None
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>

/usr/lib/python3.10/asyncio/tasks.py:630: TypeError

test_coroutine_sink.py::test_complete_in_another_run

test_coroutine_sink.py::test_complete_in_another_run
capsys = <_pytest.capture.CaptureFixture object at 0x7fac094c3490>

    @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    def test_complete_in_another_run(capsys):
        async def worker_1():
            logger.debug("A")

        async def worker_2():
            logger.debug("B")
            await logger.complete()

        loop = asyncio.new_event_loop()

        logger.add(async_writer, format="{message}", loop=loop)

        loop.run_until_complete(worker_1())
>       loop.run_until_complete(worker_2())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac094c3490>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker_1   = .worker_1 at 0x7fac093fbf40>
worker_2   = .worker_2 at 0x7fac093f9120>

tests/test_coroutine_sink.py:197: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker_2() done, defined at /testbed/tests/test_coroutine_sink.py:188> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker_2():
        logger.debug("B")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:190: TypeError

test_coroutine_sink.py::test_tasks_cancelled_on_remove

test_coroutine_sink.py::test_tasks_cancelled_on_remove
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0c5cd240>

    def test_tasks_cancelled_on_remove(capsys):
        logger.add(async_writer, format="{message}", catch=False)

        async def foo():
            logger.info("A")
            logger.info("B")
            logger.info("C")
            logger.remove()
            await logger.complete()

>       asyncio.run(foo())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0c5cd240>
foo        = .foo at 0x7fac09587760>

tests/test_coroutine_sink.py:214: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .foo at 0x7fac093f0900>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .foo() done, defined at /testbed/tests/test_coroutine_sink.py:207> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def foo():
        logger.info("A")
        logger.info("B")
        logger.info("C")
        logger.remove()
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:212: TypeError

test_coroutine_sink.py::test_remove_without_tasks

test_coroutine_sink.py::test_remove_without_tasks
capsys = <_pytest.capture.CaptureFixture object at 0x7fac094fde70>

    def test_remove_without_tasks(capsys):
        logger.add(async_writer, format="{message}", catch=False)
        logger.remove()

        async def foo():
            logger.info("!")
            await logger.complete()

>       asyncio.run(foo())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac094fde70>
foo        = .foo at 0x7fac093fbac0>

tests/test_coroutine_sink.py:228: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .foo at 0x7fac093f3a70>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .foo() done, defined at /testbed/tests/test_coroutine_sink.py:224> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def foo():
        logger.info("!")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:226: TypeError

test_coroutine_sink.py::test_complete_without_tasks

test_coroutine_sink.py::test_complete_without_tasks
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0bda8790>

    def test_complete_without_tasks(capsys):
        logger.add(async_writer, catch=False)

        async def worker():
            await logger.complete()

>       asyncio.run(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0bda8790>
worker     = .worker at 0x7fac093a8430>

tests/test_coroutine_sink.py:240: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac093f2c00>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:237> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:238: TypeError

test_coroutine_sink.py::test_complete_stream_noop

test_coroutine_sink.py::test_complete_stream_noop
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0930c100>

    def test_complete_stream_noop(capsys):
        logger.add(sys.stderr, format="{message}", catch=False)
        logger.info("A")

        async def worker():
            logger.info("B")
            await logger.complete()
            logger.info("C")

>       asyncio.run(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0930c100>
worker     = .worker at 0x7fac093a8790>

tests/test_coroutine_sink.py:255: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac093f1930>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:250> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("B")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:252: TypeError

test_coroutine_sink.py::test_complete_file_noop

test_coroutine_sink.py::test_complete_file_noop
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_complete_file_noop0')

    def test_complete_file_noop(tmp_path):
        filepath = tmp_path / "test.log"

        logger.add(filepath, format="{message}", catch=False)
        logger.info("A")

        async def worker():
            logger.info("B")
            await logger.complete()
            logger.info("C")

>       asyncio.run(worker())

filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_complete_file_noop0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_complete_file_noop0')
worker     = .worker at 0x7fac093a8af0>

tests/test_coroutine_sink.py:275: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac093f1fc0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:270> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("B")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:272: TypeError

test_coroutine_sink.py::test_complete_function_noop

test_coroutine_sink.py::test_complete_function_noop
def test_complete_function_noop():
        out = ""

        def write(msg):
            nonlocal out
            out += msg

        logger.add(write, format="{message}", catch=False)
        logger.info("A")

        async def worker():
            logger.info("B")
            await logger.complete()
            logger.info("C")

>       asyncio.run(worker())

out        = ''
worker     = .worker at 0x7fac093fb6d0>
write      = .write at 0x7fac093f89d0>

tests/test_coroutine_sink.py:297: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac093f0890>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:292> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("B")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:294: TypeError

test_coroutine_sink.py::test_complete_standard_noop

test_coroutine_sink.py::test_complete_standard_noop
capsys = <_pytest.capture.CaptureFixture object at 0x7fac094558d0>

    def test_complete_standard_noop(capsys):
        logger.add(logging.StreamHandler(sys.stderr), format="{message}", catch=False)
        logger.info("A")

        async def worker():
            logger.info("B")
            await logger.complete()
            logger.info("C")

>       asyncio.run(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac094558d0>
worker     = .worker at 0x7fac093fbf40>

tests/test_coroutine_sink.py:313: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac093f2b20>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:308> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("B")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:310: TypeError

test_coroutine_sink.py::test_exception_in_coroutine_caught

test_coroutine_sink.py::test_exception_in_coroutine_caught
capsys = <_pytest.capture.CaptureFixture object at 0x7fac094fc2b0>

    def test_exception_in_coroutine_caught(capsys):
        async def sink(msg):
            raise Exception("Oh no")

        async def main():
            logger.add(sink, catch=True)
            logger.info("Hello world")
            await asyncio.sleep(0.1)
            await logger.complete()

>       asyncio.run(main())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac094fc2b0>
main       = .main at 0x7fac093a8f70>
sink       = .sink at 0x7fac093a9240>

tests/test_coroutine_sink.py:332: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac093f3bc0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_coroutine_sink.py:326> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def main():
        logger.add(sink, catch=True)
        logger.info("Hello world")
        await asyncio.sleep(0.1)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

sink       = .sink at 0x7fac093a9240>

tests/test_coroutine_sink.py:330: TypeError

test_coroutine_sink.py::test_exception_in_coroutine_not_caught

test_coroutine_sink.py::test_exception_in_coroutine_not_caught
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0931b130>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7fac0931a440>

    def test_exception_in_coroutine_not_caught(capsys, caplog):
        async def sink(msg):
            raise ValueError("Oh no")

        async def main():
            logger.add(sink, catch=False)
            logger.info("Hello world")
            await asyncio.sleep(0.1)
            await logger.complete()

>       asyncio.run(main())

caplog     = <_pytest.logging.LogCaptureFixture object at 0x7fac0931a440>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0931b130>
main       = .main at 0x7fac093a8670>
sink       = .sink at 0x7fac093a8790>

tests/test_coroutine_sink.py:354: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac093f1380>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_coroutine_sink.py:348> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def main():
        logger.add(sink, catch=False)
        logger.info("Hello world")
        await asyncio.sleep(0.1)
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

sink       = .sink at 0x7fac093a8790>

tests/test_coroutine_sink.py:352: TypeError

test_coroutine_sink.py::test_exception_in_coroutine_during_complete_caught

test_coroutine_sink.py::test_exception_in_coroutine_during_complete_caught
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b07bfd0>

    def test_exception_in_coroutine_during_complete_caught(capsys):
        async def sink(msg):
            await asyncio.sleep(0.1)
            raise Exception("Oh no")

        async def main():
            logger.add(sink, catch=True)
            logger.info("Hello world")
            await logger.complete()

>       asyncio.run(main())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b07bfd0>
main       = .main at 0x7fac093f9120>
sink       = .sink at 0x7fac093fb910>

tests/test_coroutine_sink.py:382: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac0935e180>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_coroutine_sink.py:377> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def main():
        logger.add(sink, catch=True)
        logger.info("Hello world")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

sink       = .sink at 0x7fac093fb910>

tests/test_coroutine_sink.py:380: TypeError

test_coroutine_sink.py::test_exception_in_coroutine_during_complete_not_caught

test_coroutine_sink.py::test_exception_in_coroutine_during_complete_not_caught
capsys = <_pytest.capture.CaptureFixture object at 0x7fac095cf520>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7fac095cc370>

    def test_exception_in_coroutine_during_complete_not_caught(capsys, caplog):
        async def sink(msg):
            await asyncio.sleep(0.1)
            raise ValueError("Oh no")

        async def main():
            logger.add(sink, catch=False)
            logger.info("Hello world")
            await logger.complete()

>       asyncio.run(main())

caplog     = <_pytest.logging.LogCaptureFixture object at 0x7fac095cc370>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac095cf520>
main       = .main at 0x7fac093a9480>
sink       = .sink at 0x7fac093f8b80>

tests/test_coroutine_sink.py:404: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac093f1bd0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defin... /testbed/tests/test_coroutine_sink.py:399> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def main():
        logger.add(sink, catch=False)
        logger.info("Hello world")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression

sink       = .sink at 0x7fac093f8b80>

tests/test_coroutine_sink.py:402: TypeError

test_coroutine_sink.py::test_enqueue_coroutine_loop

test_coroutine_sink.py::test_enqueue_coroutine_loop
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09543280>

    @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    def test_enqueue_coroutine_loop(capsys):
        loop = asyncio.new_event_loop()
        logger.add(async_writer, enqueue=True, loop=loop, format="{message}", catch=False)

        async def worker():
            logger.info("A")
            await logger.complete()

>       loop.run_until_complete(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09543280>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker     = .worker at 0x7fac093a8b80>

tests/test_coroutine_sink.py:431: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:427> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("A")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:429: TypeError

test_coroutine_sink.py::test_enqueue_coroutine_from_inside_coroutine_without_loop

test_coroutine_sink.py::test_enqueue_coroutine_from_inside_coroutine_without_loop
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08fbafe0>

    def test_enqueue_coroutine_from_inside_coroutine_without_loop(capsys):
        loop = asyncio.new_event_loop()

        async def worker():
            logger.add(async_writer, enqueue=True, loop=None, format="{message}", catch=False)
            logger.info("A")
            await logger.complete()

>       loop.run_until_complete(worker())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08fbafe0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker     = .worker at 0x7fac093a92d0>

tests/test_coroutine_sink.py:446: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, ... /testbed/tests/test_coroutine_sink.py:441> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.add(async_writer, enqueue=True, loop=None, format="{message}", catch=False)
        logger.info("A")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:444: TypeError

test_coroutine_sink.py::test_custom_complete_function

test_coroutine_sink.py::test_custom_complete_function
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09450370>

    def test_custom_complete_function(capsys):
        awaited = False

        class Handler:
            def write(self, message):
                print(message, end="")

            async def complete(self):
                nonlocal awaited
                awaited = True

        async def worker():
            logger.info("A")
            await logger.complete()

        logger.add(Handler(), catch=False, format="{message}")

>       asyncio.run(worker())

Handler    = .Handler'>
awaited    = False
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09450370>
worker     = .worker at 0x7fac093a97e0>

tests/test_coroutine_sink.py:470: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .worker at 0x7fac093f14d0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker() done, defined at /testbed/tests/test_coroutine_sink.py:464> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker():
        logger.info("A")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:466: TypeError

test_coroutine_sink.py::test_complete_from_another_loop[True]

test_coroutine_sink.py::test_complete_from_another_loop[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0942f8b0>
loop_is_none = True

    @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    @pytest.mark.parametrize("loop_is_none", [True, False])
    def test_complete_from_another_loop(capsys, loop_is_none):
        main_loop = asyncio.new_event_loop()
        second_loop = asyncio.new_event_loop()

        loop = None if loop_is_none else main_loop
        logger.add(async_writer, loop=loop, format="{message}")

        async def worker_1():
            logger.info("A")

        async def worker_2():
            await logger.complete()

        main_loop.run_until_complete(worker_1())
>       second_loop.run_until_complete(worker_2())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0942f8b0>
loop       = None
loop_is_none = True
main_loop  = <_UnixSelectorEventLoop running=False closed=False debug=False>
second_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker_1   = .worker_1 at 0x7fac093a96c0>
worker_2   = .worker_2 at 0x7fac093a91b0>

tests/test_coroutine_sink.py:494: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker_2() done, defined at /testbed/tests/test_coroutine_sink.py:490> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker_2():
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:491: TypeError

test_coroutine_sink.py::test_complete_from_another_loop[False]

test_coroutine_sink.py::test_complete_from_another_loop[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0b0ea830>
loop_is_none = False

    @pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    @pytest.mark.parametrize("loop_is_none", [True, False])
    def test_complete_from_another_loop(capsys, loop_is_none):
        main_loop = asyncio.new_event_loop()
        second_loop = asyncio.new_event_loop()

        loop = None if loop_is_none else main_loop
        logger.add(async_writer, loop=loop, format="{message}")

        async def worker_1():
            logger.info("A")

        async def worker_2():
            await logger.complete()

        main_loop.run_until_complete(worker_1())
>       second_loop.run_until_complete(worker_2())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0b0ea830>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
loop_is_none = False
main_loop  = <_UnixSelectorEventLoop running=False closed=False debug=False>
second_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
worker_1   = .worker_1 at 0x7fac093a9ea0>
worker_2   = .worker_2 at 0x7fac093a8ee0>

tests/test_coroutine_sink.py:494: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .worker_2() done, defined at /testbed/tests/test_coroutine_sink.py:490> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def worker_2():
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:491: TypeError

test_coroutine_sink.py::test_complete_from_multiple_threads_loop_is_none

test_coroutine_sink.py::test_complete_from_multiple_threads_loop_is_none
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09320c10>

    def test_complete_from_multiple_threads_loop_is_none(capsys):
        async def worker(i):
            for _ in range(100):
                await asyncio.sleep(0)
                logger.info("{:03}", i)
            await logger.complete()

        async def sink(msg):
            print(msg, end="")

        def worker_(i):
            asyncio.run(worker(i))

        logger.add(sink, catch=False, format="{message}")

        threads = [threading.Thread(target=worker_, args=(i,)) for i in range(10)]

        for t in threads:
            t.start()

        for t in threads:
            t.join()

        out, err = capsys.readouterr()
>       assert sorted(out.splitlines()) == ["{:03}".format(i) for i in range(10) for _ in range(100)]
E       AssertionError: assert [] == ['000', '000'...', '000', ...]
E         
E         Right contains 1000 more items, first extra item: '000'
E         Use -v to get more diff

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09320c10>
err        = ''
out        = ''
sink       = .sink at 0x7fac093a9cf0>
t          = 
threads    = [, , , , , ...]
worker     = .worker at 0x7fac093a8af0>
worker_    = .worker_ at 0x7fac093a9510>

tests/test_coroutine_sink.py:530: AssertionError

test_coroutine_sink.py::test_complete_from_multiple_threads_loop_is_not_none

test_coroutine_sink.py::test_complete_from_multiple_threads_loop_is_not_none
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0bca8d60>

    def test_complete_from_multiple_threads_loop_is_not_none(capsys):
        async def worker(i):
            for _ in range(100):
                await asyncio.sleep(0)
                logger.info("{:03}", i)
            await logger.complete()

        async def sink(msg):
            print(msg, end="")

        def worker_(i):
            asyncio.run(worker(i))

        loop = asyncio.new_event_loop()
        logger.add(sink, catch=False, format="{message}", loop=loop)

        threads = [threading.Thread(target=worker_, args=(i,)) for i in range(10)]

        for t in threads:
            t.start()

        for t in threads:
            t.join()

        async def complete():
            await logger.complete()

>       loop.run_until_complete(complete())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0bca8d60>
complete   = .complete at 0x7fac093ab640>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
sink       = .sink at 0x7fac093aaef0>
t          = 
threads    = [, , , , , ...]
worker     = .worker at 0x7fac093aadd0>
worker_    = .worker_ at 0x7fac093aaf80>

tests/test_coroutine_sink.py:561: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .complete() done, de... /testbed/tests/test_coroutine_sink.py:558> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def complete():
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:559: TypeError

test_coroutine_sink.py::test_complete_and_sink_write_concurrency

test_coroutine_sink.py::test_complete_and_sink_write_concurrency
def test_complete_and_sink_write_concurrency():
        count = 1000
        n = 0

        async def sink(message):
            nonlocal n
            n += 1

        async def some_task():
            for _ in range(count):
                logger.info("Message")
                await asyncio.sleep(0)

        async def another_task():
            for _ in range(count):
                await logger.complete()
                await asyncio.sleep(0)

        async def main():
            logger.remove()
            logger.add(sink, catch=False)

            await asyncio.gather(some_task(), another_task())

>       asyncio.run(main())

another_task = .another_task at 0x7fac093aba30>
count      = 1000
main       = .main at 0x7fac093abac0>
n          = 0
sink       = .sink at 0x7fac093ab880>
some_task  = .some_task at 0x7fac093ab910>

tests/test_coroutine_sink.py:592: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac093f30d0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_coroutine_sink.py:586> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
tests/test_coroutine_sink.py:590: in main
    await asyncio.gather(some_task(), another_task())
        another_task = .another_task at 0x7fac093aba30>
        sink       = .sink at 0x7fac093ab880>
        some_task  = .some_task at 0x7fac093ab910>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def another_task():
        for _ in range(count):
>           await logger.complete()
E           TypeError: object NoneType can't be used in 'await' expression

_          = 0
count      = 1000

tests/test_coroutine_sink.py:583: TypeError

test_coroutine_sink.py::test_complete_and_contextualize_concurrency

test_coroutine_sink.py::test_complete_and_contextualize_concurrency
def test_complete_and_contextualize_concurrency():
        called = False

        async def main():
            logging_event = asyncio.Event()
            contextualize_event = asyncio.Event()

            async def sink(message):
                nonlocal called
                logging_event.set()
                await contextualize_event.wait()
                called = True

            async def logging_task():
                logger.info("Message")
                await logger.complete()

            async def contextualize_task():
                with logger.contextualize():
                    contextualize_event.set()
                    await logging_event.wait()

            logger.remove()
            logger.add(sink, catch=False)

            await asyncio.gather(logging_task(), contextualize_task())

>       asyncio.run(main())

called     = False
main       = .main at 0x7fac093f8b80>

tests/test_coroutine_sink.py:624: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .main at 0x7fac093f05f0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .main() done, defined at /testbed/tests/test_coroutine_sink.py:600> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
tests/test_coroutine_sink.py:622: in main
    await asyncio.gather(logging_task(), contextualize_task())
        called     = False
        contextualize_event = 
        contextualize_task = .main..contextualize_task at 0x7fac093ab5b0>
        logging_event = 
        logging_task = .main..logging_task at 0x7fac093aae60>
        sink       = .main..sink at 0x7fac093a9750>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def logging_task():
        logger.info("Message")
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:612: TypeError

test_coroutine_sink.py::test_complete_with_sub_processes

test_coroutine_sink.py::test_complete_with_sub_processes
capsys = <_pytest.capture.CaptureFixture object at 0x7fac095cd8d0>

    def test_complete_with_sub_processes(capsys):
        spawn_context = multiprocessing.get_context("spawn")

        loop = asyncio.new_event_loop()
        writer = Writer()
        logger.add(writer.write, context=spawn_context, format="{message}", enqueue=True, loop=loop)

        process = spawn_context.Process(target=subworker, args=[logger])
        process.start()
        process.join()

        async def complete():
            await logger.complete()

>       loop.run_until_complete(complete())

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac095cd8d0>
complete   = .complete at 0x7fac093aacb0>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
process    = 
spawn_context = 
writer     = 

tests/test_coroutine_sink.py:666: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .complete() done, defined at /testbed/tests/test_coroutine_sink.py:663> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=False debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def complete():
>       await logger.complete()
E       TypeError: object NoneType can't be used in 'await' expression


tests/test_coroutine_sink.py:664: TypeError

test_coroutine_sink.py::test_invalid_coroutine_sink_if_no_loop_with_enqueue

test_coroutine_sink.py::test_invalid_coroutine_sink_if_no_loop_with_enqueue
@pytest.mark.skipif(sys.version_info < (3, 5, 3), reason="Coroutine can't access running loop")
    def test_invalid_coroutine_sink_if_no_loop_with_enqueue():
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 


tests/test_coroutine_sink.py:675: Failed

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z %z-2018-06-09 01:02:03.000045-timezone0-2018-06-09 01-02-03 000045 UTC +0000]

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z %z-2018-06-09 01:02:03.000045-timezone0-2018-06-09 01-02-03 000045 UTC +0000]
writer = .w at 0x7fac0c1f9630>
freeze_time = .freeze_time at 0x7fac0c1f9c60>
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z', date = '2018-06-09 01:02:03.000045'
timezone = ('UTC', 0), expected = '2018-06-09 01-02-03 000045 UTC +0000'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...5 UTC +0000\n'
E             
E             - 2018-06-09 01-02-03 000045 UTC +0000

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 01-02-03 000045 UTC +0000'
freeze_time = .freeze_time at 0x7fac0c1f9c60>
result     = ''
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac0c1f9630>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ-2018-06-09 01:02:03.000045-timezone1-2018-06-09 01-02-03 000045 UTC +0000]

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ-2018-06-09 01:02:03.000045-timezone1-2018-06-09 01-02-03 000045 UTC +0000]
writer = .w at 0x7fac08f5c280>
freeze_time = .freeze_time at 0x7fac08f5dcf0>
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ'
date = '2018-06-09 01:02:03.000045', timezone = ('UTC', 0)
expected = '2018-06-09 01-02-03 000045 UTC +0000'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...5 UTC +0000\n'
E             
E             - 2018-06-09 01-02-03 000045 UTC +0000

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 01-02-03 000045 UTC +0000'
freeze_time = .freeze_time at 0x7fac08f5dcf0>
result     = ''
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f5c280>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z %z-2018-06-09 01:02:03.000045-timezone2-2018-06-09 01-02-03 000045 EST -0500]

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z %z-2018-06-09 01:02:03.000045-timezone2-2018-06-09 01-02-03 000045 EST -0500]
writer = .w at 0x7fac08f5d1b0>
freeze_time = .freeze_time at 0x7fac08f5e5f0>
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z', date = '2018-06-09 01:02:03.000045'
timezone = ('EST', -18000), expected = '2018-06-09 01-02-03 000045 EST -0500'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...5 EST -0500\n'
E             
E             - 2018-06-09 01-02-03 000045 EST -0500

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 01-02-03 000045 EST -0500'
freeze_time = .freeze_time at 0x7fac08f5e5f0>
result     = ''
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z'
timezone   = ('EST', -18000)
writer     = .w at 0x7fac08f5d1b0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ-2018-06-09 01:02:03.000045-timezone3-2018-06-09 01-02-03 000045 EST -0500]

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ-2018-06-09 01:02:03.000045-timezone3-2018-06-09 01-02-03 000045 EST -0500]
writer = .w at 0x7fac0c1f9b40>
freeze_time = .freeze_time at 0x7fac08f5db40>
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ'
date = '2018-06-09 01:02:03.000045', timezone = ('EST', -18000)
expected = '2018-06-09 01-02-03 000045 EST -0500'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...5 EST -0500\n'
E             
E             - 2018-06-09 01-02-03 000045 EST -0500

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 01-02-03 000045 EST -0500'
freeze_time = .freeze_time at 0x7fac08f5db40>
result     = ''
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ'
timezone   = ('EST', -18000)
writer     = .w at 0x7fac0c1f9b40>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z!UTC-2018-06-09 01:02:03.000045-timezone4-2018-06-09 01-02-03 000045 UTC]

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z!UTC-2018-06-09 01:02:03.000045-timezone4-2018-06-09 01-02-03 000045 UTC]
writer = .w at 0x7fac08f5d750>
freeze_time = .freeze_time at 0x7fac08f5f010>
time_format = '%Y-%m-%d %H-%M-%S %f %Z!UTC', date = '2018-06-09 01:02:03.000045'
timezone = ('UTC', 0), expected = '2018-06-09 01-02-03 000045 UTC'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0... 000045 UTC\n'
E             
E             - 2018-06-09 01-02-03 000045 UTC

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 01-02-03 000045 UTC'
freeze_time = .freeze_time at 0x7fac08f5f010>
result     = ''
time_format = '%Y-%m-%d %H-%M-%S %f %Z!UTC'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f5d750>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC-2018-06-09 01:02:03.000045-timezone5-2018-06-09 01-02-03 000045 UTC]

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC-2018-06-09 01:02:03.000045-timezone5-2018-06-09 01-02-03 000045 UTC]
writer = .w at 0x7fac08f5f640>
freeze_time = .freeze_time at 0x7fac08f5f9a0>
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC'
date = '2018-06-09 01:02:03.000045', timezone = ('UTC', 0)
expected = '2018-06-09 01-02-03 000045 UTC'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0... 000045 UTC\n'
E             
E             - 2018-06-09 01-02-03 000045 UTC

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 01-02-03 000045 UTC'
freeze_time = .freeze_time at 0x7fac08f5f9a0>
result     = ''
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f5f640>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z %z!UTC-2018-06-09 01:02:03.000045-timezone6-2018-06-09 06-02-03 000045 UTC +0000]

test_datetime.py::test_formatting[%Y-%m-%d %H-%M-%S %f %Z %z!UTC-2018-06-09 01:02:03.000045-timezone6-2018-06-09 06-02-03 000045 UTC +0000]
writer = .w at 0x7fac08f5c280>
freeze_time = .freeze_time at 0x7fac08f5eb00>
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z!UTC'
date = '2018-06-09 01:02:03.000045', timezone = ('EST', -18000)
expected = '2018-06-09 06-02-03 000045 UTC +0000'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...5 UTC +0000\n'
E             
E             - 2018-06-09 06-02-03 000045 UTC +0000

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 06-02-03 000045 UTC +0000'
freeze_time = .freeze_time at 0x7fac08f5eb00>
result     = ''
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z!UTC'
timezone   = ('EST', -18000)
writer     = .w at 0x7fac08f5c280>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC-2018-06-09 01:02:03.000045-timezone7-2018-06-09 06-02-03 000045 UTC +0000]

test_datetime.py::test_formatting[YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC-2018-06-09 01:02:03.000045-timezone7-2018-06-09 06-02-03 000045 UTC +0000]
writer = .w at 0x7fac0c1f9c60>
freeze_time = .freeze_time at 0x7fac08f5edd0>
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC'
date = '2018-06-09 01:02:03.000045', timezone = ('UTC', -18000)
expected = '2018-06-09 06-02-03 000045 UTC +0000'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...5 UTC +0000\n'
E             
E             - 2018-06-09 06-02-03 000045 UTC +0000

date       = '2018-06-09 01:02:03.000045'
expected   = '2018-06-09 06-02-03 000045 UTC +0000'
freeze_time = .freeze_time at 0x7fac08f5edd0>
result     = ''
time_format = 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC'
timezone   = ('UTC', -18000)
writer     = .w at 0x7fac0c1f9c60>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[YY-M-D H-m-s SSS Z-2005-04-07 09:03:08.002320-timezone8-05-4-7 9-3-8 002 +01:00]

test_datetime.py::test_formatting[YY-M-D H-m-s SSS Z-2005-04-07 09:03:08.002320-timezone8-05-4-7 9-3-8 002 +01:00]
writer = .w at 0x7fac08f5f010>
freeze_time = .freeze_time at 0x7fac08f5d750>
time_format = 'YY-M-D H-m-s SSS Z', date = '2005-04-07 09:03:08.002320'
timezone = ('A', 3600), expected = '05-4-7 9-3-8 002 +01:00'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '05-4-7 9-3-8 002 +01:00\n'
E             
E             - 05-4-7 9-3-8 002 +01:00

date       = '2005-04-07 09:03:08.002320'
expected   = '05-4-7 9-3-8 002 +01:00'
freeze_time = .freeze_time at 0x7fac08f5d750>
result     = ''
time_format = 'YY-M-D H-m-s SSS Z'
timezone   = ('A', 3600)
writer     = .w at 0x7fac08f5f010>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[Q_DDDD_DDD d_E h_hh A SS ZZ-2000-01-01 14:00:00.9-timezone9-1_001_1 5_6 2_02 PM 90 -0030]

test_datetime.py::test_formatting[Q_DDDD_DDD d_E h_hh A SS ZZ-2000-01-01 14:00:00.9-timezone9-1_001_1 5_6 2_02 PM 90 -0030]
writer = .w at 0x7fac08f54b80>
freeze_time = .freeze_time at 0x7fac08f54ee0>
time_format = 'Q_DDDD_DDD d_E h_hh A SS ZZ', date = '2000-01-01 14:00:00.9'
timezone = ('B', -1800), expected = '1_001_1 5_6 2_02 PM 90 -0030'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '1_001_1 5_6 ...PM 90 -0030\n'
E             
E             - 1_001_1 5_6 2_02 PM 90 -0030

date       = '2000-01-01 14:00:00.9'
expected   = '1_001_1 5_6 2_02 PM 90 -0030'
freeze_time = .freeze_time at 0x7fac08f54ee0>
result     = ''
time_format = 'Q_DDDD_DDD d_E h_hh A SS ZZ'
timezone   = ('B', -1800)
writer     = .w at 0x7fac08f54b80>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[hh A-2018-01-01 00:01:02.000003-timezone10-12 AM]

test_datetime.py::test_formatting[hh A-2018-01-01 00:01:02.000003-timezone10-12 AM]
writer = .w at 0x7fac08f55510>
freeze_time = .freeze_time at 0x7fac08f54820>
time_format = 'hh A', date = '2018-01-01 00:01:02.000003', timezone = ('UTC', 0)
expected = '12 AM'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '12 AM\n'
E             
E             - 12 AM

date       = '2018-01-01 00:01:02.000003'
expected   = '12 AM'
freeze_time = .freeze_time at 0x7fac08f54820>
result     = ''
time_format = 'hh A'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f55510>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[hh A-2018-01-01 12:00:00.0-timezone11-12 PM]

test_datetime.py::test_formatting[hh A-2018-01-01 12:00:00.0-timezone11-12 PM]
writer = .w at 0x7fac093f9480>
freeze_time = .freeze_time at 0x7fac08f5e950>
time_format = 'hh A', date = '2018-01-01 12:00:00.0', timezone = ('UTC', 0)
expected = '12 PM'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '12 PM\n'
E             
E             - 12 PM

date       = '2018-01-01 12:00:00.0'
expected   = '12 PM'
freeze_time = .freeze_time at 0x7fac08f5e950>
result     = ''
time_format = 'hh A'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac093f9480>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[hh A-2018-01-01 23:00:00.0-timezone12-11 PM]

test_datetime.py::test_formatting[hh A-2018-01-01 23:00:00.0-timezone12-11 PM]
writer = .w at 0x7fac0c1ea7a0>
freeze_time = .freeze_time at 0x7fac0c1f9cf0>
time_format = 'hh A', date = '2018-01-01 23:00:00.0', timezone = ('UTC', 0)
expected = '11 PM'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '11 PM\n'
E             
E             - 11 PM

date       = '2018-01-01 23:00:00.0'
expected   = '11 PM'
freeze_time = .freeze_time at 0x7fac0c1f9cf0>
result     = ''
time_format = 'hh A'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac0c1ea7a0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[[YYYY] MM [DD]-2018-02-03 11:09:00.000002-timezone13-YYYY 02 DD]

test_datetime.py::test_formatting[[YYYY] MM [DD]-2018-02-03 11:09:00.000002-timezone13-YYYY 02 DD]
writer = .w at 0x7fac093ab7f0>
freeze_time = .freeze_time at 0x7fac08f5eb00>
time_format = '[YYYY] MM [DD]', date = '2018-02-03 11:09:00.000002'
timezone = ('UTC', 0), expected = 'YYYY 02 DD'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == 'YYYY 02 DD\n'
E             
E             - YYYY 02 DD

date       = '2018-02-03 11:09:00.000002'
expected   = 'YYYY 02 DD'
freeze_time = .freeze_time at 0x7fac08f5eb00>
result     = ''
time_format = '[YYYY] MM [DD]'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac093ab7f0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[[YYYY MM DD]-2018-01-03 11:03:04.000002-timezone14-[2018 01 03]]

test_datetime.py::test_formatting[[YYYY MM DD]-2018-01-03 11:03:04.000002-timezone14-[2018 01 03]]
writer = .w at 0x7fac08f5e170>
freeze_time = .freeze_time at 0x7fac08f5f400>
time_format = '[YYYY MM DD]', date = '2018-01-03 11:03:04.000002'
timezone = ('UTC', 0), expected = '[2018 01 03]'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '[2018 01 03]\n'
E             
E             - [2018 01 03]

date       = '2018-01-03 11:03:04.000002'
expected   = '[2018 01 03]'
freeze_time = .freeze_time at 0x7fac08f5f400>
result     = ''
time_format = '[YYYY MM DD]'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f5e170>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[[[YY]]-2018-01-03 11:03:04.000002-timezone15-[YY]]

test_datetime.py::test_formatting[[[YY]]-2018-01-03 11:03:04.000002-timezone15-[YY]]
writer = .w at 0x7fac093ab7f0>
freeze_time = .freeze_time at 0x7fac0c1ea4d0>
time_format = '[[YY]]', date = '2018-01-03 11:03:04.000002'
timezone = ('UTC', 0), expected = '[YY]'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '[YY]\n'
E             
E             - [YY]

date       = '2018-01-03 11:03:04.000002'
expected   = '[YY]'
freeze_time = .freeze_time at 0x7fac0c1ea4d0>
result     = ''
time_format = '[[YY]]'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac093ab7f0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[[]-2018-01-03 11:03:04.000002-timezone16-]

test_datetime.py::test_formatting[[]-2018-01-03 11:03:04.000002-timezone16-]
writer = .w at 0x7fac08f5eb00>
freeze_time = .freeze_time at 0x7fac08f55900>
time_format = '[]', date = '2018-01-03 11:03:04.000002', timezone = ('UTC', 0)
expected = ''

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '\n'
E             
E             Strings contain only whitespace, escaping them using repr()
E             - '\n'
E             + ''

date       = '2018-01-03 11:03:04.000002'
expected   = ''
freeze_time = .freeze_time at 0x7fac08f55900>
result     = ''
time_format = '[]'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f5eb00>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[[[]]-2018-01-03 11:03:04.000002-timezone17-[]]

test_datetime.py::test_formatting[[[]]-2018-01-03 11:03:04.000002-timezone17-[]]
writer = .w at 0x7fac08f54ca0>
freeze_time = .freeze_time at 0x7fac08f55e10>
time_format = '[[]]', date = '2018-01-03 11:03:04.000002', timezone = ('UTC', 0)
expected = '[]'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '[]\n'
E             
E             - []

date       = '2018-01-03 11:03:04.000002'
expected   = '[]'
freeze_time = .freeze_time at 0x7fac08f55e10>
result     = ''
time_format = '[[]]'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f54ca0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[SSSSSS[]SSS[]SSSSSS-2018-01-03 11:03:04.100002-timezone18-100002100100002]

test_datetime.py::test_formatting[SSSSSS[]SSS[]SSSSSS-2018-01-03 11:03:04.100002-timezone18-100002100100002]
writer = .w at 0x7fac08f54b80>
freeze_time = .freeze_time at 0x7fac08f56680>
time_format = 'SSSSSS[]SSS[]SSSSSS', date = '2018-01-03 11:03:04.100002'
timezone = ('UTC', 0), expected = '100002100100002'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '100002100100002\n'
E             
E             - 100002100100002

date       = '2018-01-03 11:03:04.100002'
expected   = '100002100100002'
freeze_time = .freeze_time at 0x7fac08f56680>
result     = ''
time_format = 'SSSSSS[]SSS[]SSSSSS'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f54b80>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[[HHmmss-2018-01-03 11:03:04.000002-timezone19-[110304]

test_datetime.py::test_formatting[[HHmmss-2018-01-03 11:03:04.000002-timezone19-[110304]
writer = .w at 0x7fac0c1ea5f0>
freeze_time = .freeze_time at 0x7fac093aae60>
time_format = '[HHmmss', date = '2018-01-03 11:03:04.000002'
timezone = ('UTC', 0), expected = '[110304'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '[110304\n'
E             
E             - [110304

date       = '2018-01-03 11:03:04.000002'
expected   = '[110304'
freeze_time = .freeze_time at 0x7fac093aae60>
result     = ''
time_format = '[HHmmss'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac0c1ea5f0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[HHmmss]-2018-01-03 11:03:04.000002-timezone20-110304]]

test_datetime.py::test_formatting[HHmmss]-2018-01-03 11:03:04.000002-timezone20-110304]]
writer = .w at 0x7fac08f5eb00>
freeze_time = .freeze_time at 0x7fac08f56950>
time_format = 'HHmmss]', date = '2018-01-03 11:03:04.000002'
timezone = ('UTC', 0), expected = '110304]'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '110304]\n'
E             
E             - 110304]

date       = '2018-01-03 11:03:04.000002'
expected   = '110304]'
freeze_time = .freeze_time at 0x7fac08f56950>
result     = ''
time_format = 'HHmmss]'
timezone   = ('UTC', 0)
writer     = .w at 0x7fac08f5eb00>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[HH:mm:ss!UTC-2018-01-01 11:30:00.0-timezone21-09:30:00]

test_datetime.py::test_formatting[HH:mm:ss!UTC-2018-01-01 11:30:00.0-timezone21-09:30:00]
writer = .w at 0x7fac08f56ef0>
freeze_time = .freeze_time at 0x7fac08f57250>
time_format = 'HH:mm:ss!UTC', date = '2018-01-01 11:30:00.0'
timezone = ('A', 7200), expected = '09:30:00'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '09:30:00\n'
E             
E             - 09:30:00

date       = '2018-01-01 11:30:00.0'
expected   = '09:30:00'
freeze_time = .freeze_time at 0x7fac08f57250>
result     = ''
time_format = 'HH:mm:ss!UTC'
timezone   = ('A', 7200)
writer     = .w at 0x7fac08f56ef0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[UTC! HH:mm:ss-2018-01-01 11:30:00.0-timezone22-UTC! 11:30:00]

test_datetime.py::test_formatting[UTC! HH:mm:ss-2018-01-01 11:30:00.0-timezone22-UTC! 11:30:00]
writer = .w at 0x7fac08f569e0>
freeze_time = .freeze_time at 0x7fac08f57ac0>
time_format = 'UTC! HH:mm:ss', date = '2018-01-01 11:30:00.0'
timezone = ('A', 7200), expected = 'UTC! 11:30:00'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == 'UTC! 11:30:00\n'
E             
E             - UTC! 11:30:00

date       = '2018-01-01 11:30:00.0'
expected   = 'UTC! 11:30:00'
freeze_time = .freeze_time at 0x7fac08f57ac0>
result     = ''
time_format = 'UTC! HH:mm:ss'
timezone   = ('A', 7200)
writer     = .w at 0x7fac08f569e0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[!UTC HH:mm:ss-2018-01-01 11:30:00.0-timezone23-!UTC 11:30:00]

test_datetime.py::test_formatting[!UTC HH:mm:ss-2018-01-01 11:30:00.0-timezone23-!UTC 11:30:00]
writer = .w at 0x7fac0c1ea320>
freeze_time = .freeze_time at 0x7fac093ab7f0>
time_format = '!UTC HH:mm:ss', date = '2018-01-01 11:30:00.0'
timezone = ('A', 7200), expected = '!UTC 11:30:00'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '!UTC 11:30:00\n'
E             
E             - !UTC 11:30:00

date       = '2018-01-01 11:30:00.0'
expected   = '!UTC 11:30:00'
freeze_time = .freeze_time at 0x7fac093ab7f0>
result     = ''
time_format = '!UTC HH:mm:ss'
timezone   = ('A', 7200)
writer     = .w at 0x7fac0c1ea320>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[hh:mm:ss A - Z ZZ !UTC-2018-01-01 12:30:00.0-timezone24-11:00:00 AM - +00:00 +0000 ]

test_datetime.py::test_formatting[hh:mm:ss A - Z ZZ !UTC-2018-01-01 12:30:00.0-timezone24-11:00:00 AM - +00:00 +0000 ]
writer = .w at 0x7fac0c1ea5f0>
freeze_time = .freeze_time at 0x7fac08f57d90>
time_format = 'hh:mm:ss A - Z ZZ !UTC', date = '2018-01-01 12:30:00.0'
timezone = ('A', 5400), expected = '11:00:00 AM - +00:00 +0000 '

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '11:00:00 AM ...0:00 +0000 \n'
E             
E             - 11:00:00 AM - +00:00 +0000

date       = '2018-01-01 12:30:00.0'
expected   = '11:00:00 AM - +00:00 +0000 '
freeze_time = .freeze_time at 0x7fac08f57d90>
result     = ''
time_format = 'hh:mm:ss A - Z ZZ !UTC'
timezone   = ('A', 5400)
writer     = .w at 0x7fac0c1ea5f0>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[YYYY-MM-DD HH:mm:ss[Z]!UTC-2018-01-03 11:03:04.2-timezone25-2018-01-03 13:03:04Z]

test_datetime.py::test_formatting[YYYY-MM-DD HH:mm:ss[Z]!UTC-2018-01-03 11:03:04.2-timezone25-2018-01-03 13:03:04Z]
writer = .w at 0x7fac08f57130>
freeze_time = .freeze_time at 0x7fac08f567a0>
time_format = 'YYYY-MM-DD HH:mm:ss[Z]!UTC', date = '2018-01-03 11:03:04.2'
timezone = ('XYZ', -7200), expected = '2018-01-03 13:03:04Z'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-01-03 13:03:04Z\n'
E             
E             - 2018-01-03 13:03:04Z

date       = '2018-01-03 11:03:04.2'
expected   = '2018-01-03 13:03:04Z'
freeze_time = .freeze_time at 0x7fac08f567a0>
result     = ''
time_format = 'YYYY-MM-DD HH:mm:ss[Z]!UTC'
timezone   = ('XYZ', -7200)
writer     = .w at 0x7fac08f57130>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[HH:mm:ss[!UTC]-2018-01-01 11:30:00.0-timezone26-11:30:00!UTC]

test_datetime.py::test_formatting[HH:mm:ss[!UTC]-2018-01-01 11:30:00.0-timezone26-11:30:00!UTC]
writer = .w at 0x7fac08fa4d30>
freeze_time = .freeze_time at 0x7fac08fa43a0>
time_format = 'HH:mm:ss[!UTC]', date = '2018-01-01 11:30:00.0'
timezone = ('A', 7200), expected = '11:30:00!UTC'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '11:30:00!UTC\n'
E             
E             - 11:30:00!UTC

date       = '2018-01-01 11:30:00.0'
expected   = '11:30:00!UTC'
freeze_time = .freeze_time at 0x7fac08fa43a0>
result     = ''
time_format = 'HH:mm:ss[!UTC]'
timezone   = ('A', 7200)
writer     = .w at 0x7fac08fa4d30>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[-2018-02-03 11:09:00.000002-timezone27-2018-02-03T11:09:00.000002+0030]

test_datetime.py::test_formatting[-2018-02-03 11:09:00.000002-timezone27-2018-02-03T11:09:00.000002+0030]
writer = .w at 0x7fac093aba30>
freeze_time = .freeze_time at 0x7fac08f552d0>
time_format = '', date = '2018-02-03 11:09:00.000002', timezone = ('Z', 1800)
expected = '2018-02-03T11:09:00.000002+0030'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-02-03T1...000002+0030\n'
E             
E             - 2018-02-03T11:09:00.000002+0030

date       = '2018-02-03 11:09:00.000002'
expected   = '2018-02-03T11:09:00.000002+0030'
freeze_time = .freeze_time at 0x7fac08f552d0>
result     = ''
time_format = ''
timezone   = ('Z', 1800)
writer     = .w at 0x7fac093aba30>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting[!UTC-2018-02-03 11:09:00.000002-timezone28-2018-02-03T10:39:00.000002+0000]

test_datetime.py::test_formatting[!UTC-2018-02-03 11:09:00.000002-timezone28-2018-02-03T10:39:00.000002+0000]
writer = .w at 0x7fac093ab910>
freeze_time = .freeze_time at 0x7fac08fa48b0>
time_format = '!UTC', date = '2018-02-03 11:09:00.000002'
timezone = ('Z', 1800), expected = '2018-02-03T10:39:00.000002+0000'

    @pytest.mark.parametrize(
        "time_format, date, timezone, expected",
        [
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 UTC +0000",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 01-02-03 000045 EST -0500",
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", 0),
                "2018-06-09 01-02-03 000045 %s" % UTC_NAME,
            ),
            (
                "%Y-%m-%d %H-%M-%S %f %Z %z!UTC",
                "2018-06-09 01:02:03.000045",
                ("EST", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ!UTC",
                "2018-06-09 01:02:03.000045",
                ("UTC", -18000),
                "2018-06-09 06-02-03 000045 %s +0000" % UTC_NAME,
            ),
            (
                "YY-M-D H-m-s SSS Z",
                "2005-04-07 09:03:08.002320",
                ("A", 3600),
                "05-4-7 9-3-8 002 +01:00",
            ),
            (
                "Q_DDDD_DDD d_E h_hh A SS ZZ",
                "2000-01-01 14:00:00.9",
                ("B", -1800),
                "1_001_1 5_6 2_02 PM 90 -0030",
            ),
            ("hh A", "2018-01-01 00:01:02.000003", ("UTC", 0), "12 AM"),
            ("hh A", "2018-01-01 12:00:00.0", ("UTC", 0), "12 PM"),
            ("hh A", "2018-01-01 23:00:00.0", ("UTC", 0), "11 PM"),
            ("[YYYY] MM [DD]", "2018-02-03 11:09:00.000002", ("UTC", 0), "YYYY 02 DD"),
            ("[YYYY MM DD]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[2018 01 03]"),
            ("[[YY]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[YY]"),
            ("[]", "2018-01-03 11:03:04.000002", ("UTC", 0), ""),
            ("[[]]", "2018-01-03 11:03:04.000002", ("UTC", 0), "[]"),
            ("SSSSSS[]SSS[]SSSSSS", "2018-01-03 11:03:04.100002", ("UTC", 0), "100002100100002"),
            ("[HHmmss", "2018-01-03 11:03:04.000002", ("UTC", 0), "[110304"),
            ("HHmmss]", "2018-01-03 11:03:04.000002", ("UTC", 0), "110304]"),
            ("HH:mm:ss!UTC", "2018-01-01 11:30:00.0", ("A", 7200), "09:30:00"),
            ("UTC! HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "UTC! 11:30:00"),
            ("!UTC HH:mm:ss", "2018-01-01 11:30:00.0", ("A", 7200), "!UTC 11:30:00"),
            (
                "hh:mm:ss A - Z ZZ !UTC",
                "2018-01-01 12:30:00.0",
                ("A", 5400),
                "11:00:00 AM - +00:00 +0000 ",
            ),
            (
                "YYYY-MM-DD HH:mm:ss[Z]!UTC",
                "2018-01-03 11:03:04.2",
                ("XYZ", -7200),
                "2018-01-03 13:03:04Z",
            ),
            ("HH:mm:ss[!UTC]", "2018-01-01 11:30:00.0", ("A", 7200), "11:30:00!UTC"),
            ("", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T11:09:00.000002+0030"),
            ("!UTC", "2018-02-03 11:09:00.000002", ("Z", 1800), "2018-02-03T10:39:00.000002+0000"),
        ],
    )
    def test_formatting(writer, freeze_time, time_format, date, timezone, expected):
        with freeze_time(date, timezone):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("X")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-02-03T1...000002+0000\n'
E             
E             - 2018-02-03T10:39:00.000002+0000

date       = '2018-02-03 11:09:00.000002'
expected   = '2018-02-03T10:39:00.000002+0000'
freeze_time = .freeze_time at 0x7fac08fa48b0>
result     = ''
time_format = '!UTC'
timezone   = ('Z', 1800)
writer     = .w at 0x7fac093ab910>

tests/test_datetime.py:115: AssertionError

test_datetime.py::test_formatting_timezone_offset_down_to_the_second[%Y-%m-%d %H-%M-%S %f %Z %z-7230.099-2018-06-09 01-02-03 000000 ABC +020030.099000]

test_datetime.py::test_formatting_timezone_offset_down_to_the_second[%Y-%m-%d %H-%M-%S %f %Z %z-7230.099-2018-06-09 01-02-03 000000 ABC +020030.099000]
writer = .w at 0x7fac08fa52d0>
freeze_time = .freeze_time at 0x7fac08fa5e10>
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z', offset = 7230.099
expected = '2018-06-09 01-02-03 000000 ABC +020030.099000'

    @pytest.mark.parametrize(
        "time_format, offset, expected",
        [
            ("%Y-%m-%d %H-%M-%S %f %Z %z", 7230.099, "2018-06-09 01-02-03 000000 ABC +020030.099000"),
            ("YYYY-MM-DD HH-mm-ss zz Z ZZ", 6543, "2018-06-09 01-02-03 ABC +01:49:03 +014903"),
            ("HH-mm-ss zz Z ZZ", -12345.06702, "01-02-03 ABC -03:26:45.067020 -032645.067020"),
        ],
    )
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="Offset must be a whole number of minutes")
    def test_formatting_timezone_offset_down_to_the_second(
        writer, freeze_time, time_format, offset, expected
    ):
        date = datetime.datetime(2018, 6, 9, 1, 2, 3)
        with freeze_time(date, ("ABC", offset)):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("Test")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...0030.099000\n'
E             
E             - 2018-06-09 01-02-03 000000 ABC +020030.099000

date       = datetime.datetime(2018, 6, 9, 1, 2, 3)
expected   = '2018-06-09 01-02-03 000000 ABC +020030.099000'
freeze_time = .freeze_time at 0x7fac08fa5e10>
offset     = 7230.099
result     = ''
time_format = '%Y-%m-%d %H-%M-%S %f %Z %z'
writer     = .w at 0x7fac08fa52d0>

tests/test_datetime.py:135: AssertionError

test_datetime.py::test_formatting_timezone_offset_down_to_the_second[YYYY-MM-DD HH-mm-ss zz Z ZZ-6543-2018-06-09 01-02-03 ABC +01:49:03 +014903]

test_datetime.py::test_formatting_timezone_offset_down_to_the_second[YYYY-MM-DD HH-mm-ss zz Z ZZ-6543-2018-06-09 01-02-03 ABC +01:49:03 +014903]
writer = .w at 0x7fac08fa51b0>
freeze_time = .freeze_time at 0x7fac08fa5630>
time_format = 'YYYY-MM-DD HH-mm-ss zz Z ZZ', offset = 6543
expected = '2018-06-09 01-02-03 ABC +01:49:03 +014903'

    @pytest.mark.parametrize(
        "time_format, offset, expected",
        [
            ("%Y-%m-%d %H-%M-%S %f %Z %z", 7230.099, "2018-06-09 01-02-03 000000 ABC +020030.099000"),
            ("YYYY-MM-DD HH-mm-ss zz Z ZZ", 6543, "2018-06-09 01-02-03 ABC +01:49:03 +014903"),
            ("HH-mm-ss zz Z ZZ", -12345.06702, "01-02-03 ABC -03:26:45.067020 -032645.067020"),
        ],
    )
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="Offset must be a whole number of minutes")
    def test_formatting_timezone_offset_down_to_the_second(
        writer, freeze_time, time_format, offset, expected
    ):
        date = datetime.datetime(2018, 6, 9, 1, 2, 3)
        with freeze_time(date, ("ABC", offset)):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("Test")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '2018-06-09 0...:03 +014903\n'
E             
E             - 2018-06-09 01-02-03 ABC +01:49:03 +014903

date       = datetime.datetime(2018, 6, 9, 1, 2, 3)
expected   = '2018-06-09 01-02-03 ABC +01:49:03 +014903'
freeze_time = .freeze_time at 0x7fac08fa5630>
offset     = 6543
result     = ''
time_format = 'YYYY-MM-DD HH-mm-ss zz Z ZZ'
writer     = .w at 0x7fac08fa51b0>

tests/test_datetime.py:135: AssertionError

test_datetime.py::test_formatting_timezone_offset_down_to_the_second[HH-mm-ss zz Z ZZ--12345.06702-01-02-03 ABC -03:26:45.067020 -032645.067020]

test_datetime.py::test_formatting_timezone_offset_down_to_the_second[HH-mm-ss zz Z ZZ--12345.06702-01-02-03 ABC -03:26:45.067020 -032645.067020]
writer = .w at 0x7fac08fa4c10>
freeze_time = .freeze_time at 0x7fac08fa5fc0>
time_format = 'HH-mm-ss zz Z ZZ', offset = -12345.06702
expected = '01-02-03 ABC -03:26:45.067020 -032645.067020'

    @pytest.mark.parametrize(
        "time_format, offset, expected",
        [
            ("%Y-%m-%d %H-%M-%S %f %Z %z", 7230.099, "2018-06-09 01-02-03 000000 ABC +020030.099000"),
            ("YYYY-MM-DD HH-mm-ss zz Z ZZ", 6543, "2018-06-09 01-02-03 ABC +01:49:03 +014903"),
            ("HH-mm-ss zz Z ZZ", -12345.06702, "01-02-03 ABC -03:26:45.067020 -032645.067020"),
        ],
    )
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="Offset must be a whole number of minutes")
    def test_formatting_timezone_offset_down_to_the_second(
        writer, freeze_time, time_format, offset, expected
    ):
        date = datetime.datetime(2018, 6, 9, 1, 2, 3)
        with freeze_time(date, ("ABC", offset)):
            logger.add(writer, format="{time:%s}" % time_format)
            logger.debug("Test")
            result = writer.read()
>           assert result == expected + "\n"
E           AssertionError: assert '' == '01-02-03 ABC...2645.067020\n'
E             
E             - 01-02-03 ABC -03:26:45.067020 -032645.067020

date       = datetime.datetime(2018, 6, 9, 1, 2, 3)
expected   = '01-02-03 ABC -03:26:45.067020 -032645.067020'
freeze_time = .freeze_time at 0x7fac08fa5fc0>
offset     = -12345.06702
result     = ''
time_format = 'HH-mm-ss zz Z ZZ'
writer     = .w at 0x7fac08fa4c10>

tests/test_datetime.py:135: AssertionError

test_datetime.py::test_locale_formatting

test_datetime.py::test_locale_formatting
writer = .w at 0x7fac093aae60>
freeze_time = .freeze_time at 0x7fac08f567a0>

    def test_locale_formatting(writer, freeze_time):
        dt = datetime.datetime(2011, 1, 1, 22, 22, 22, 0)
        with freeze_time(dt):
            logger.add(writer, format="{time:MMMM MMM dddd ddd}")
            logger.debug("Test")
>           assert writer.read() == dt.strftime("%B %b %A %a\n")
E           AssertionError: assert '' == 'January Jan Saturday Sat\n'
E             
E             - January Jan Saturday Sat

dt         = datetime.datetime(2011, 1, 1, 22, 22, 22)
freeze_time = .freeze_time at 0x7fac08f567a0>
writer     = .w at 0x7fac093aae60>

tests/test_datetime.py:143: AssertionError

test_datetime.py::test_stdout_formatting

test_datetime.py::test_stdout_formatting
freeze_time = .freeze_time at 0x7fac08f57130>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac093136a0>

    def test_stdout_formatting(freeze_time, capsys):
        with freeze_time("2015-12-25 19:13:18", ("A", 5400)):
            logger.add(sys.stdout, format="{time:YYYY [MM] DD HHmmss Z} {message}")
            logger.debug("Y")
            out, err = capsys.readouterr()
>           assert out == "2015 MM 25 191318 +01:30 Y\n"
E           AssertionError: assert '' == '2015 MM 25 191318 +01:30 Y\n'
E             
E             - 2015 MM 25 191318 +01:30 Y

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac093136a0>
err        = ''
freeze_time = .freeze_time at 0x7fac08f57130>
out        = ''

tests/test_datetime.py:151: AssertionError

test_datetime.py::test_file_formatting

test_datetime.py::test_file_formatting
freeze_time = .freeze_time at 0x7fac08fa63b0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatting0')

    def test_file_formatting(freeze_time, tmp_path):
        with freeze_time("2015-12-25 19:13:18", ("A", -5400)):
            logger.add(tmp_path / "{time:YYYY [MM] DD HHmmss ZZ}.log")
            logger.debug("Z")
>           assert list(tmp_path.iterdir()) == [tmp_path / "2015 MM 25 191318 -0130.log"]
E           AssertionError: assert [] == [PosixPath('/...8 -0130.log')]
E             
E             Right contains one more item: PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatting0/2015 MM 25 191318 -0130.log')
E             Use -v to get more diff

freeze_time = .freeze_time at 0x7fac08fa63b0>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatting0')

tests/test_datetime.py:159: AssertionError

test_datetime.py::test_missing_struct_time_fields

test_datetime.py::test_missing_struct_time_fields
writer = .w at 0x7fac08fa6680>
freeze_time = .freeze_time at 0x7fac08fa4af0>

    def test_missing_struct_time_fields(writer, freeze_time):
        with freeze_time("2011-01-02 03:04:05.6", include_tm_zone=False):
            logger.add(writer, format="{time:YYYY MM DD HH mm ss SSSSSS ZZ zz}")
            logger.debug("X")

            result = writer.read()
>           assert re.fullmatch(r"2011 01 02 03 04 05 600000 [+-]\d{4} .*\n", result)
E           AssertionError: assert None
E            +  where None = ('2011 01 02 03 04 05 600000 [+-]\\d{4} .*\\n', '')
E            +    where  = re.fullmatch

freeze_time = .freeze_time at 0x7fac08fa4af0>
result     = ''
writer     = .w at 0x7fac08fa6680>

tests/test_datetime.py:168: AssertionError

test_datetime.py::test_freezegun_mocking

test_datetime.py::test_freezegun_mocking
writer = .w at 0x7fac08fa6440>

    def test_freezegun_mocking(writer):
        logger.add(writer, format="[{time:YYYY MM DD HH:mm:ss}] {message}")

        with freezegun.freeze_time("2000-01-01 18:00:05"):
            logger.info("Frozen")

>       assert writer.read() == "[2000 01 01 18:00:05] Frozen\n"
E       AssertionError: assert '' == '[2000 01 01 ...:05] Frozen\n'
E         
E         - [2000 01 01 18:00:05] Frozen

writer     = .w at 0x7fac08fa6440>

tests/test_datetime.py:177: AssertionError

test_datetime.py::test_invalid_time_format[ss.SSSSSSS]

test_datetime.py::test_invalid_time_format[ss.SSSSSSS]
writer = .w at 0x7fac08fa69e0>
time_format = 'ss.SSSSSSS'

    @pytest.mark.parametrize(
        "time_format", ["ss.SSSSSSS", "SS.SSSSSSSS.SS", "HH:mm:ss.SSSSSSSSS", "SSSSSSSSSS"]
    )
    def test_invalid_time_format(writer, time_format):
        logger.add(writer, format="{time:%s} {message}" % time_format, catch=False)
>       with pytest.raises(ValueError, match="Invalid time format"):
E       Failed: DID NOT RAISE 

time_format = 'ss.SSSSSSS'
writer     = .w at 0x7fac08fa69e0>

tests/test_datetime.py:185: Failed

test_datetime.py::test_invalid_time_format[SS.SSSSSSSS.SS]

test_datetime.py::test_invalid_time_format[SS.SSSSSSSS.SS]
writer = .w at 0x7fac08f57130>
time_format = 'SS.SSSSSSSS.SS'

    @pytest.mark.parametrize(
        "time_format", ["ss.SSSSSSS", "SS.SSSSSSSS.SS", "HH:mm:ss.SSSSSSSSS", "SSSSSSSSSS"]
    )
    def test_invalid_time_format(writer, time_format):
        logger.add(writer, format="{time:%s} {message}" % time_format, catch=False)
>       with pytest.raises(ValueError, match="Invalid time format"):
E       Failed: DID NOT RAISE 

time_format = 'SS.SSSSSSSS.SS'
writer     = .w at 0x7fac08f57130>

tests/test_datetime.py:185: Failed

test_datetime.py::test_invalid_time_format[HH:mm:ss.SSSSSSSSS]

test_datetime.py::test_invalid_time_format[HH:mm:ss.SSSSSSSSS]
writer = .w at 0x7fac093ab7f0>
time_format = 'HH:mm:ss.SSSSSSSSS'

    @pytest.mark.parametrize(
        "time_format", ["ss.SSSSSSS", "SS.SSSSSSSS.SS", "HH:mm:ss.SSSSSSSSS", "SSSSSSSSSS"]
    )
    def test_invalid_time_format(writer, time_format):
        logger.add(writer, format="{time:%s} {message}" % time_format, catch=False)
>       with pytest.raises(ValueError, match="Invalid time format"):
E       Failed: DID NOT RAISE 

time_format = 'HH:mm:ss.SSSSSSSSS'
writer     = .w at 0x7fac093ab7f0>

tests/test_datetime.py:185: Failed

test_datetime.py::test_invalid_time_format[SSSSSSSSSS]

test_datetime.py::test_invalid_time_format[SSSSSSSSSS]
writer = .w at 0x7fac08fa5360>
time_format = 'SSSSSSSSSS'

    @pytest.mark.parametrize(
        "time_format", ["ss.SSSSSSS", "SS.SSSSSSSS.SS", "HH:mm:ss.SSSSSSSSS", "SSSSSSSSSS"]
    )
    def test_invalid_time_format(writer, time_format):
        logger.add(writer, format="{time:%s} {message}" % time_format, catch=False)
>       with pytest.raises(ValueError, match="Invalid time format"):
E       Failed: DID NOT RAISE 

time_format = 'SSSSSSSSSS'
writer     = .w at 0x7fac08fa5360>

tests/test_datetime.py:185: Failed

test_deepcopy.py::test_add_sink_after_deepcopy

test_deepcopy.py::test_add_sink_after_deepcopy
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09308520>

    def test_add_sink_after_deepcopy(capsys):
        logger_ = copy.deepcopy(logger)

        logger_.add(print_, format="{message}", catch=False)

        logger_.info("A")
        logger.info("B")

        out, err = capsys.readouterr()
>       assert out == "A\n"
E       AssertionError: assert '' == 'A\n'
E         
E         - A

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09308520>
err        = ''
logger_    = 
out        = ''

tests/test_deepcopy.py:19: AssertionError

test_deepcopy.py::test_add_sink_before_deepcopy

test_deepcopy.py::test_add_sink_before_deepcopy
capsys = <_pytest.capture.CaptureFixture object at 0x7fac093319f0>

    def test_add_sink_before_deepcopy(capsys):
        logger.add(print_, format="{message}", catch=False)

        logger_ = copy.deepcopy(logger)

        logger_.info("A")
        logger.info("B")

        out, err = capsys.readouterr()
>       assert out == "A\nB\n"
E       AssertionError: assert '' == 'A\nB\n'
E         
E         - A
E         - B

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac093319f0>
err        = ''
logger_    = 
out        = ''

tests/test_deepcopy.py:32: AssertionError

test_deepcopy.py::test_remove_from_original

test_deepcopy.py::test_remove_from_original
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0930bfa0>

    def test_remove_from_original(capsys):
        logger.add(print_, format="{message}", catch=False)

        logger_ = copy.deepcopy(logger)
        logger.remove()

        logger_.info("A")
        logger.info("B")

        out, err = capsys.readouterr()
>       assert out == "A\n"
E       AssertionError: assert '' == 'A\n'
E         
E         - A

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0930bfa0>
err        = ''
logger_    = 
out        = ''

tests/test_deepcopy.py:46: AssertionError

test_deepcopy.py::test_remove_from_copy

test_deepcopy.py::test_remove_from_copy
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08fbb490>

    def test_remove_from_copy(capsys):
        logger.add(print_, format="{message}", catch=False)

        logger_ = copy.deepcopy(logger)
        logger_.remove()

        logger_.info("A")
        logger.info("B")

        out, err = capsys.readouterr()
>       assert out == "B\n"
E       AssertionError: assert '' == 'B\n'
E         
E         - B

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08fbb490>
err        = ''
logger_    = 
out        = ''

tests/test_deepcopy.py:60: AssertionError

test_defaults.py::test_string[test]

test_defaults.py::test_string[test]
value = 'test'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930b040>

    @pytest.mark.parametrize("value", ["test", ""])
    def test_string(value, monkeypatch):
        key = "VALID_STRING"
        monkeypatch.setenv(key, value)
>       assert env(key, str) == value
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_STRING'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930b040>
value      = 'test'

tests/test_defaults.py:10: TypeError

test_defaults.py::test_string[]

test_defaults.py::test_string[]
value = ''
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fb8dc0>

    @pytest.mark.parametrize("value", ["test", ""])
    def test_string(value, monkeypatch):
        key = "VALID_STRING"
        monkeypatch.setenv(key, value)
>       assert env(key, str) == value
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_STRING'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fb8dc0>
value      = ''

tests/test_defaults.py:10: TypeError

test_defaults.py::test_bool_positive[y]

test_defaults.py::test_bool_positive[y]
value = 'y'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930b460>

    @pytest.mark.parametrize("value", ["y", "1", "TRUE"])
    def test_bool_positive(value, monkeypatch):
        key = "VALID_BOOL_POS"
        monkeypatch.setenv(key, value)
>       assert env(key, bool) is True
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_BOOL_POS'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930b460>
value      = 'y'

tests/test_defaults.py:17: TypeError

test_defaults.py::test_bool_positive[1]

test_defaults.py::test_bool_positive[1]
value = '1'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fbb970>

    @pytest.mark.parametrize("value", ["y", "1", "TRUE"])
    def test_bool_positive(value, monkeypatch):
        key = "VALID_BOOL_POS"
        monkeypatch.setenv(key, value)
>       assert env(key, bool) is True
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_BOOL_POS'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fbb970>
value      = '1'

tests/test_defaults.py:17: TypeError

test_defaults.py::test_bool_positive[TRUE]

test_defaults.py::test_bool_positive[TRUE]
value = 'TRUE'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f47340>

    @pytest.mark.parametrize("value", ["y", "1", "TRUE"])
    def test_bool_positive(value, monkeypatch):
        key = "VALID_BOOL_POS"
        monkeypatch.setenv(key, value)
>       assert env(key, bool) is True
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_BOOL_POS'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f47340>
value      = 'TRUE'

tests/test_defaults.py:17: TypeError

test_defaults.py::test_bool_negative[NO]

test_defaults.py::test_bool_negative[NO]
value = 'NO'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fb8b20>

    @pytest.mark.parametrize("value", ["NO", "0", "false"])
    def test_bool_negative(value, monkeypatch):
        key = "VALID_BOOL_NEG"
        monkeypatch.setenv(key, value)
>       assert env(key, bool) is False
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_BOOL_NEG'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fb8b20>
value      = 'NO'

tests/test_defaults.py:24: TypeError

test_defaults.py::test_bool_negative[0]

test_defaults.py::test_bool_negative[0]
value = '0'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f448e0>

    @pytest.mark.parametrize("value", ["NO", "0", "false"])
    def test_bool_negative(value, monkeypatch):
        key = "VALID_BOOL_NEG"
        monkeypatch.setenv(key, value)
>       assert env(key, bool) is False
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_BOOL_NEG'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f448e0>
value      = '0'

tests/test_defaults.py:24: TypeError

test_defaults.py::test_bool_negative[false]

test_defaults.py::test_bool_negative[false]
value = 'false'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fb86a0>

    @pytest.mark.parametrize("value", ["NO", "0", "false"])
    def test_bool_negative(value, monkeypatch):
        key = "VALID_BOOL_NEG"
        monkeypatch.setenv(key, value)
>       assert env(key, bool) is False
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_BOOL_NEG'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fb86a0>
value      = 'false'

tests/test_defaults.py:24: TypeError

test_defaults.py::test_int

test_defaults.py::test_int
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fbbd90>

    def test_int(monkeypatch):
        key = "VALID_INT"
        monkeypatch.setenv(key, "42")
>       assert env(key, int) == 42
E       TypeError: env() missing 1 required positional argument: 'default'

key        = 'VALID_INT'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08fbbd90>

tests/test_defaults.py:30: TypeError

test_defaults.py::test_invalid_int[]

test_defaults.py::test_invalid_int[]
value = ''
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f46b30>

    @pytest.mark.parametrize("value", ["", "a"])
    def test_invalid_int(value, monkeypatch):
        key = "INVALID_INT"
        monkeypatch.setenv(key, value)
        with pytest.raises(ValueError):
>           env(key, int)
E           TypeError: env() missing 1 required positional argument: 'default'

key        = 'INVALID_INT'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f46b30>
value      = ''

tests/test_defaults.py:38: TypeError

test_defaults.py::test_invalid_int[a]

test_defaults.py::test_invalid_int[a]
value = 'a'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0eab00>

    @pytest.mark.parametrize("value", ["", "a"])
    def test_invalid_int(value, monkeypatch):
        key = "INVALID_INT"
        monkeypatch.setenv(key, value)
        with pytest.raises(ValueError):
>           env(key, int)
E           TypeError: env() missing 1 required positional argument: 'default'

key        = 'INVALID_INT'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0eab00>
value      = 'a'

tests/test_defaults.py:38: TypeError

test_defaults.py::test_invalid_bool[]

test_defaults.py::test_invalid_bool[]
value = ''
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f4efe0>

    @pytest.mark.parametrize("value", ["", "a"])
    def test_invalid_bool(value, monkeypatch):
        key = "INVALID_BOOL"
        monkeypatch.setenv(key, value)
        with pytest.raises(ValueError):
>           env(key, bool)
E           TypeError: env() missing 1 required positional argument: 'default'

key        = 'INVALID_BOOL'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f4efe0>
value      = ''

tests/test_defaults.py:46: TypeError

test_defaults.py::test_invalid_bool[a]

test_defaults.py::test_invalid_bool[a]
value = 'a'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0e8ca0>

    @pytest.mark.parametrize("value", ["", "a"])
    def test_invalid_bool(value, monkeypatch):
        key = "INVALID_BOOL"
        monkeypatch.setenv(key, value)
        with pytest.raises(ValueError):
>           env(key, bool)
E           TypeError: env() missing 1 required positional argument: 'default'

key        = 'INVALID_BOOL'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0e8ca0>
value      = 'a'

tests/test_defaults.py:46: TypeError

test_exceptions_catch.py::test_caret_not_masked[False]

test_exceptions_catch.py::test_caret_not_masked[False]
writer = .w at 0x7fac08f56950>, diagnose = False

    @pytest.mark.parametrize("diagnose", [False, True])
    def test_caret_not_masked(writer, diagnose):
        logger.add(writer, backtrace=True, diagnose=diagnose, colorize=False, format="")

        @logger.catch
        def f(n):
            1 / n
            f(n - 1)

>       f(30)
E       TypeError: 'NoneType' object is not callable

diagnose   = False
f          = None
writer     = .w at 0x7fac08f56950>

tests/test_exceptions_catch.py:21: TypeError

test_exceptions_catch.py::test_caret_not_masked[True]

test_exceptions_catch.py::test_caret_not_masked[True]
writer = .w at 0x7fac08f57370>, diagnose = True

    @pytest.mark.parametrize("diagnose", [False, True])
    def test_caret_not_masked(writer, diagnose):
        logger.add(writer, backtrace=True, diagnose=diagnose, colorize=False, format="")

        @logger.catch
        def f(n):
            1 / n
            f(n - 1)

>       f(30)
E       TypeError: 'NoneType' object is not callable

diagnose   = True
f          = None
writer     = .w at 0x7fac08f57370>

tests/test_exceptions_catch.py:21: TypeError

test_exceptions_catch.py::test_no_caret_if_no_backtrace[False]

test_exceptions_catch.py::test_no_caret_if_no_backtrace[False]
writer = .w at 0x7fac08f552d0>, diagnose = False

    @pytest.mark.parametrize("diagnose", [False, True])
    def test_no_caret_if_no_backtrace(writer, diagnose):
        logger.add(writer, backtrace=False, diagnose=diagnose, colorize=False, format="")

        @logger.catch
        def f(n):
            1 / n
            f(n - 1)

>       f(30)
E       TypeError: 'NoneType' object is not callable

diagnose   = False
f          = None
writer     = .w at 0x7fac08f552d0>

tests/test_exceptions_catch.py:35: TypeError

test_exceptions_catch.py::test_no_caret_if_no_backtrace[True]

test_exceptions_catch.py::test_no_caret_if_no_backtrace[True]
writer = .w at 0x7fac08fa6e60>, diagnose = True

    @pytest.mark.parametrize("diagnose", [False, True])
    def test_no_caret_if_no_backtrace(writer, diagnose):
        logger.add(writer, backtrace=False, diagnose=diagnose, colorize=False, format="")

        @logger.catch
        def f(n):
            1 / n
            f(n - 1)

>       f(30)
E       TypeError: 'NoneType' object is not callable

diagnose   = True
f          = None
writer     = .w at 0x7fac08fa6e60>

tests/test_exceptions_catch.py:35: TypeError

test_exceptions_catch.py::test_sink_encoding[ascii]

test_exceptions_catch.py::test_sink_encoding[ascii]
writer = .Writer object at 0x7fac09309270>
encoding = 'ascii'

    @pytest.mark.parametrize("encoding", ["ascii", "UTF8", None, "unknown-encoding", "", object()])
    def test_sink_encoding(writer, encoding):
        class Writer:
            def __init__(self, encoding):
                self.encoding = encoding
                self.output = ""

            def write(self, message):
                self.output += message

        writer = Writer(encoding)
        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="", catch=False)

        def foo(a, b):
            a / b

        def bar(c):
            foo(c, 0)

        try:
            bar(4)
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.output.endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = .Writer object at 0x7fac09309270>.output

Writer     = .Writer'>
bar        = .bar at 0x7fac08fa7400>
encoding   = 'ascii'
foo        = .foo at 0x7fac08f57130>
writer     = .Writer object at 0x7fac09309270>

tests/test_exceptions_catch.py:64: AssertionError

test_exceptions_catch.py::test_sink_encoding[UTF8]

test_exceptions_catch.py::test_sink_encoding[UTF8]
writer = .Writer object at 0x7fac0930b790>
encoding = 'UTF8'

    @pytest.mark.parametrize("encoding", ["ascii", "UTF8", None, "unknown-encoding", "", object()])
    def test_sink_encoding(writer, encoding):
        class Writer:
            def __init__(self, encoding):
                self.encoding = encoding
                self.output = ""

            def write(self, message):
                self.output += message

        writer = Writer(encoding)
        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="", catch=False)

        def foo(a, b):
            a / b

        def bar(c):
            foo(c, 0)

        try:
            bar(4)
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.output.endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = .Writer object at 0x7fac0930b790>.output

Writer     = .Writer'>
bar        = .bar at 0x7fac08fa7640>
encoding   = 'UTF8'
foo        = .foo at 0x7fac093aae60>
writer     = .Writer object at 0x7fac0930b790>

tests/test_exceptions_catch.py:64: AssertionError

test_exceptions_catch.py::test_sink_encoding[None]

test_exceptions_catch.py::test_sink_encoding[None]
writer = .Writer object at 0x7fac08fb8d00>
encoding = None

    @pytest.mark.parametrize("encoding", ["ascii", "UTF8", None, "unknown-encoding", "", object()])
    def test_sink_encoding(writer, encoding):
        class Writer:
            def __init__(self, encoding):
                self.encoding = encoding
                self.output = ""

            def write(self, message):
                self.output += message

        writer = Writer(encoding)
        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="", catch=False)

        def foo(a, b):
            a / b

        def bar(c):
            foo(c, 0)

        try:
            bar(4)
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.output.endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = .Writer object at 0x7fac08fb8d00>.output

Writer     = .Writer'>
bar        = .bar at 0x7fac08fa7c70>
encoding   = None
foo        = .foo at 0x7fac08fa76d0>
writer     = .Writer object at 0x7fac08fb8d00>

tests/test_exceptions_catch.py:64: AssertionError

test_exceptions_catch.py::test_sink_encoding[unknown-encoding]

test_exceptions_catch.py::test_sink_encoding[unknown-encoding]
writer = .Writer object at 0x7fac0930b100>
encoding = 'unknown-encoding'

    @pytest.mark.parametrize("encoding", ["ascii", "UTF8", None, "unknown-encoding", "", object()])
    def test_sink_encoding(writer, encoding):
        class Writer:
            def __init__(self, encoding):
                self.encoding = encoding
                self.output = ""

            def write(self, message):
                self.output += message

        writer = Writer(encoding)
        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="", catch=False)

        def foo(a, b):
            a / b

        def bar(c):
            foo(c, 0)

        try:
            bar(4)
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.output.endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = .Writer object at 0x7fac0930b100>.output

Writer     = .Writer'>
bar        = .bar at 0x7fac08fa7520>
encoding   = 'unknown-encoding'
foo        = .foo at 0x7fac093aae60>
writer     = .Writer object at 0x7fac0930b100>

tests/test_exceptions_catch.py:64: AssertionError

test_exceptions_catch.py::test_sink_encoding[]

test_exceptions_catch.py::test_sink_encoding[]
writer = .Writer object at 0x7fac08fb8070>
encoding = ''

    @pytest.mark.parametrize("encoding", ["ascii", "UTF8", None, "unknown-encoding", "", object()])
    def test_sink_encoding(writer, encoding):
        class Writer:
            def __init__(self, encoding):
                self.encoding = encoding
                self.output = ""

            def write(self, message):
                self.output += message

        writer = Writer(encoding)
        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="", catch=False)

        def foo(a, b):
            a / b

        def bar(c):
            foo(c, 0)

        try:
            bar(4)
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.output.endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = .Writer object at 0x7fac08fb8070>.output

Writer     = .Writer'>
bar        = .bar at 0x7fac089bc160>
encoding   = ''
foo        = .foo at 0x7fac08fa75b0>
writer     = .Writer object at 0x7fac08fb8070>

tests/test_exceptions_catch.py:64: AssertionError

test_exceptions_catch.py::test_sink_encoding[encoding5]

test_exceptions_catch.py::test_sink_encoding[encoding5]
writer = .Writer object at 0x7fac0930b610>
encoding = 

    @pytest.mark.parametrize("encoding", ["ascii", "UTF8", None, "unknown-encoding", "", object()])
    def test_sink_encoding(writer, encoding):
        class Writer:
            def __init__(self, encoding):
                self.encoding = encoding
                self.output = ""

            def write(self, message):
                self.output += message

        writer = Writer(encoding)
        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="", catch=False)

        def foo(a, b):
            a / b

        def bar(c):
            foo(c, 0)

        try:
            bar(4)
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.output.endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = .Writer object at 0x7fac0930b610>.output

Writer     = .Writer'>
bar        = .bar at 0x7fac089bc550>
encoding   = 
foo        = .foo at 0x7fac093aae60>
writer     = .Writer object at 0x7fac0930b610>

tests/test_exceptions_catch.py:64: AssertionError


test_exceptions_catch.py::test_file_sink_ascii_encoding

test_exceptions_catch.py::test_file_sink_ascii_encoding
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1')

    def test_file_sink_ascii_encoding(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="", encoding="ascii", errors="backslashreplace", catch=False)
        a = "天"

        try:
            "天" * a
        except Exception:
            logger.exception("")

        logger.remove()
>       result = file.read_text("ascii")

a          = '天'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1')

tests/test_exceptions_catch.py:78: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'ascii'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1/test.log')
mode = 'r', buffering = -1, encoding = 'ascii', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1/test.log'

buffering  = -1
encoding   = 'ascii'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_ascii_encoding1/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_exceptions_catch.py::test_file_sink_utf8_encoding

test_exceptions_catch.py::test_file_sink_utf8_encoding
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1')

    def test_file_sink_utf8_encoding(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="", encoding="utf8", errors="strict", catch=False)
        a = "天"

        try:
            "天" * a
        except Exception:
            logger.exception("")

        logger.remove()
>       result = file.read_text("utf8")

a          = '天'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1')

tests/test_exceptions_catch.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'utf8'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1/test.log')
mode = 'r', buffering = -1, encoding = 'utf8', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1/test.log'

buffering  = -1
encoding   = 'utf8'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_sink_utf8_encoding1/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_exceptions_catch.py::test_has_sys_real_prefix

test_exceptions_catch.py::test_has_sys_real_prefix
writer = .w at 0x7fac08fa7d00>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f44e80>

    def test_has_sys_real_prefix(writer, monkeypatch):
        monkeypatch.setattr(sys, "real_prefix", "/foo/bar/baz", raising=False)
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa5ea0>()
E        +        where . at 0x7fac08fa5ea0> = .w at 0x7fac08fa7d00>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f44e80>
writer     = .w at 0x7fac08fa7d00>

tests/test_exceptions_catch.py:108: AssertionError

test_exceptions_catch.py::test_no_sys_real_prefix

test_exceptions_catch.py::test_no_sys_real_prefix
writer = .w at 0x7fac08fa7eb0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09300250>

    def test_no_sys_real_prefix(writer, monkeypatch):
        monkeypatch.delattr(sys, "real_prefix", raising=False)
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa5900>()
E        +        where . at 0x7fac08fa5900> = .w at 0x7fac08fa7eb0>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09300250>
writer     = .w at 0x7fac08fa7eb0>

tests/test_exceptions_catch.py:120: AssertionError

test_exceptions_catch.py::test_has_site_getsitepackages

test_exceptions_catch.py::test_has_site_getsitepackages
writer = .w at 0x7fac08fa56c0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09541fc0>

    def test_has_site_getsitepackages(writer, monkeypatch):
        monkeypatch.setattr(site, "getsitepackages", lambda: ["foo", "bar", "baz"], raising=False)
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa7760>()
E        +        where . at 0x7fac08fa7760> = .w at 0x7fac08fa56c0>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09541fc0>
writer     = .w at 0x7fac08fa56c0>

tests/test_exceptions_catch.py:132: AssertionError

test_exceptions_catch.py::test_no_site_getsitepackages

test_exceptions_catch.py::test_no_site_getsitepackages
writer = .w at 0x7fac08fa7130>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac093021d0>

    def test_no_site_getsitepackages(writer, monkeypatch):
        monkeypatch.delattr(site, "getsitepackages", raising=False)
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa5990>()
E        +        where . at 0x7fac08fa5990> = .w at 0x7fac08fa7130>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac093021d0>
writer     = .w at 0x7fac08fa7130>

tests/test_exceptions_catch.py:144: AssertionError

test_exceptions_catch.py::test_user_site_is_path

test_exceptions_catch.py::test_user_site_is_path
writer = .w at 0x7fac08fa76d0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09457dc0>

    def test_user_site_is_path(writer, monkeypatch):
        monkeypatch.setattr(site, "USER_SITE", "/foo/bar/baz")
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa5f30>()
E        +        where . at 0x7fac08fa5f30> = .w at 0x7fac08fa76d0>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09457dc0>
writer     = .w at 0x7fac08fa76d0>

tests/test_exceptions_catch.py:156: AssertionError

test_exceptions_catch.py::test_user_site_is_none

test_exceptions_catch.py::test_user_site_is_none
writer = .w at 0x7fac08fa7400>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09303610>

    def test_user_site_is_none(writer, monkeypatch):
        monkeypatch.setattr(site, "USER_SITE", None)
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa5fc0>()
E        +        where . at 0x7fac08fa5fc0> = .w at 0x7fac08fa7400>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09303610>
writer     = .w at 0x7fac08fa7400>

tests/test_exceptions_catch.py:168: AssertionError

test_exceptions_catch.py::test_sysconfig_get_path_return_path

test_exceptions_catch.py::test_sysconfig_get_path_return_path
writer = .w at 0x7fac08fa64d0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac094541c0>

    def test_sysconfig_get_path_return_path(writer, monkeypatch):
        monkeypatch.setattr(sysconfig, "get_path", lambda *a, **k: "/foo/bar/baz")
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa4f70>()
E        +        where . at 0x7fac08fa4f70> = .w at 0x7fac08fa64d0>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac094541c0>
writer     = .w at 0x7fac08fa64d0>

tests/test_exceptions_catch.py:180: AssertionError

test_exceptions_catch.py::test_sysconfig_get_path_return_none

test_exceptions_catch.py::test_sysconfig_get_path_return_none
writer = .w at 0x7fac08fa7c70>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930bfd0>

    def test_sysconfig_get_path_return_none(writer, monkeypatch):
        monkeypatch.setattr(sysconfig, "get_path", lambda *a, **k: None)
        logger.add(writer, backtrace=False, diagnose=True, colorize=False, format="")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("")

>       assert writer.read().endswith("ZeroDivisionError: division by zero\n")
E       AssertionError: assert False
E        +  where False = ('ZeroDivisionError: division by zero\n')
E        +    where  = ''.endswith
E        +      where '' = . at 0x7fac08fa5870>()
E        +        where . at 0x7fac08fa5870> = .w at 0x7fac08fa7c70>.read

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930bfd0>
writer     = .w at 0x7fac08fa7c70>

tests/test_exceptions_catch.py:192: AssertionError

test_exceptions_catch.py::test_no_exception

test_exceptions_catch.py::test_no_exception
writer = .w at 0x7fac08fa5000>

    def test_no_exception(writer):
        logger.add(writer, backtrace=False, diagnose=False, colorize=False, format="{message}")

        logger.exception("No Error.")

>       assert writer.read() in (
            "No Error.\nNoneType\n",
            "No Error.\nNoneType: None\n",  # Old versions of Python 3.5
        )
E       AssertionError: assert '' in ('No Error.\nNoneType\n', 'No Error.\nNoneType: None\n')
E        +  where '' = . at 0x7fac08fa6f80>()
E        +    where . at 0x7fac08fa6f80> = .w at 0x7fac08fa5000>.read

writer     = .w at 0x7fac08fa5000>

tests/test_exceptions_catch.py:200: AssertionError

test_exceptions_catch.py::test_exception_is_none

test_exceptions_catch.py::test_exception_is_none
def test_exception_is_none():
        err = object()

        def writer(msg):
            nonlocal err
            err = msg.record["exception"]

        logger.add(writer)

        logger.error("No exception")

>       assert err is None
E       assert  is None

err        = 
writer     = .writer at 0x7fac08f57ac0>

tests/test_exceptions_catch.py:217: AssertionError


test_exceptions_catch.py::test_exception_is_tuple

test_exceptions_catch.py::test_exception_is_tuple
def test_exception_is_tuple():
        exception = None

        def writer(msg):
            nonlocal exception
            exception = msg.record["exception"]

        logger.add(writer, catch=False)

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Exception")
            reference = sys.exc_info()

>       t_1, v_1, tb_1 = exception
E       TypeError: cannot unpack non-iterable NoneType object

exception  = None
reference  = (, ZeroDivisionError('division by zero'), )
writer     = .writer at 0x7fac08f579a0>

tests/test_exceptions_catch.py:235: TypeError

test_exceptions_catch.py::test_exception_not_raising[ZeroDivisionError]

test_exceptions_catch.py::test_exception_not_raising[ZeroDivisionError]
writer = .w at 0x7fac08f57e20>
exception = 

    @pytest.mark.parametrize(
        "exception", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    def test_exception_not_raising(writer, exception):
        logger.add(writer)

        @logger.catch(exception)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
writer     = .w at 0x7fac08f57e20>

tests/test_exceptions_catch.py:258: TypeError

test_exceptions_catch.py::test_exception_not_raising[ArithmeticError]

test_exceptions_catch.py::test_exception_not_raising[ArithmeticError]
writer = .w at 0x7fac08f5e170>
exception = 

    @pytest.mark.parametrize(
        "exception", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    def test_exception_not_raising(writer, exception):
        logger.add(writer)

        @logger.catch(exception)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
writer     = .w at 0x7fac08f5e170>

tests/test_exceptions_catch.py:258: TypeError

test_exceptions_catch.py::test_exception_not_raising[exception2]

test_exceptions_catch.py::test_exception_not_raising[exception2]
writer = .w at 0x7fac08f5eb00>
exception = (, )

    @pytest.mark.parametrize(
        "exception", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    def test_exception_not_raising(writer, exception):
        logger.add(writer)

        @logger.catch(exception)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = (, )
writer     = .w at 0x7fac08f5eb00>

tests/test_exceptions_catch.py:258: TypeError

test_exceptions_catch.py::test_exception_raising[ValueError]

test_exceptions_catch.py::test_exception_raising[ValueError]
writer = .w at 0x7fac08f56950>
exception = 

    @pytest.mark.parametrize("exception", [ValueError, ((SyntaxError, TypeError))])
    def test_exception_raising(writer, exception):
        logger.add(writer)

        @logger.catch(exception=exception)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
writer     = .w at 0x7fac08f56950>

tests/test_exceptions_catch.py:270: TypeError

test_exceptions_catch.py::test_exception_raising[exception1]

test_exceptions_catch.py::test_exception_raising[exception1]
writer = .w at 0x7fac08fa5090>
exception = (, )

    @pytest.mark.parametrize("exception", [ValueError, ((SyntaxError, TypeError))])
    def test_exception_raising(writer, exception):
        logger.add(writer)

        @logger.catch(exception=exception)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = (, )
writer     = .w at 0x7fac08fa5090>

tests/test_exceptions_catch.py:270: TypeError

test_exceptions_catch.py::test_exclude_exception_raising[BaseException-ZeroDivisionError]

test_exceptions_catch.py::test_exclude_exception_raising[BaseException-ZeroDivisionError]
writer = .w at 0x7fac08f5e170>
exclude = , exception = 

    @pytest.mark.parametrize(
        "exclude", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = 
writer     = .w at 0x7fac08f5e170>

tests/test_exceptions_catch.py:287: TypeError

test_exceptions_catch.py::test_exclude_exception_raising[BaseException-ArithmeticError]

test_exceptions_catch.py::test_exclude_exception_raising[BaseException-ArithmeticError]
writer = .w at 0x7fac08fa76d0>
exclude = , exception = 

    @pytest.mark.parametrize(
        "exclude", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = 
writer     = .w at 0x7fac08fa76d0>

tests/test_exceptions_catch.py:287: TypeError

test_exceptions_catch.py::test_exclude_exception_raising[BaseException-exclude2]

test_exceptions_catch.py::test_exclude_exception_raising[BaseException-exclude2]
writer = .w at 0x7fac08f56950>
exclude = (, )
exception = 

    @pytest.mark.parametrize(
        "exclude", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = (, )
writer     = .w at 0x7fac08f56950>

tests/test_exceptions_catch.py:287: TypeError

test_exceptions_catch.py::test_exclude_exception_raising[ZeroDivisionError-ZeroDivisionError]

test_exceptions_catch.py::test_exclude_exception_raising[ZeroDivisionError-ZeroDivisionError]
writer = .w at 0x7fac08f5f910>
exclude = , exception = 

    @pytest.mark.parametrize(
        "exclude", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = 
writer     = .w at 0x7fac08f5f910>

tests/test_exceptions_catch.py:287: TypeError

test_exceptions_catch.py::test_exclude_exception_raising[ZeroDivisionError-ArithmeticError]

test_exceptions_catch.py::test_exclude_exception_raising[ZeroDivisionError-ArithmeticError]
writer = .w at 0x7fac08fa76d0>
exclude = , exception = 

    @pytest.mark.parametrize(
        "exclude", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = 
writer     = .w at 0x7fac08fa76d0>

tests/test_exceptions_catch.py:287: TypeError

test_exceptions_catch.py::test_exclude_exception_raising[ZeroDivisionError-exclude2]

test_exceptions_catch.py::test_exclude_exception_raising[ZeroDivisionError-exclude2]
writer = .w at 0x7fac08f5f400>
exclude = (, )
exception = 

    @pytest.mark.parametrize(
        "exclude", [ZeroDivisionError, ArithmeticError, (ValueError, ZeroDivisionError)]
    )
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = (, )
writer     = .w at 0x7fac08f5f400>

tests/test_exceptions_catch.py:287: TypeError

test_exceptions_catch.py::test_exclude_exception_not_raising[BaseException-ValueError]

test_exceptions_catch.py::test_exclude_exception_not_raising[BaseException-ValueError]
writer = .w at 0x7fac089bd240>
exclude = , exception = 

    @pytest.mark.parametrize("exclude", [ValueError, ((SyntaxError, TypeError))])
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_not_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = 
writer     = .w at 0x7fac089bd240>

tests/test_exceptions_catch.py:302: TypeError

test_exceptions_catch.py::test_exclude_exception_not_raising[BaseException-exclude1]

test_exceptions_catch.py::test_exclude_exception_not_raising[BaseException-exclude1]
writer = .w at 0x7fac089bc550>
exclude = (, )
exception = 

    @pytest.mark.parametrize("exclude", [ValueError, ((SyntaxError, TypeError))])
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_not_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = (, )
writer     = .w at 0x7fac089bc550>

tests/test_exceptions_catch.py:302: TypeError

test_exceptions_catch.py::test_exclude_exception_not_raising[ZeroDivisionError-ValueError]

test_exceptions_catch.py::test_exclude_exception_not_raising[ZeroDivisionError-ValueError]
writer = .w at 0x7fac08fa7400>
exclude = , exception = 

    @pytest.mark.parametrize("exclude", [ValueError, ((SyntaxError, TypeError))])
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_not_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = 
writer     = .w at 0x7fac08fa7400>

tests/test_exceptions_catch.py:302: TypeError

test_exceptions_catch.py::test_exclude_exception_not_raising[ZeroDivisionError-exclude1]

test_exceptions_catch.py::test_exclude_exception_not_raising[ZeroDivisionError-exclude1]
writer = .w at 0x7fac08fa76d0>
exclude = (, )
exception = 

    @pytest.mark.parametrize("exclude", [ValueError, ((SyntaxError, TypeError))])
    @pytest.mark.parametrize("exception", [BaseException, ZeroDivisionError])
    def test_exclude_exception_not_raising(writer, exclude, exception):
        logger.add(writer)

        @logger.catch(exception, exclude=exclude)
>       def a():
E       TypeError: 'NoneType' object is not callable

exception  = 
exclude    = (, )
writer     = .w at 0x7fac08fa76d0>

tests/test_exceptions_catch.py:302: TypeError

test_exceptions_catch.py::test_reraise

test_exceptions_catch.py::test_reraise
writer = .w at 0x7fac08f5e320>

    def test_reraise(writer):
        logger.add(writer)

        @logger.catch(reraise=True)
>       def a():
E       TypeError: 'NoneType' object is not callable

writer     = .w at 0x7fac08f5e320>

tests/test_exceptions_catch.py:313: TypeError

test_exceptions_catch.py::test_onerror

test_exceptions_catch.py::test_onerror
writer = .w at 0x7fac08f5c280>

    def test_onerror(writer):
        is_error_valid = False
        logger.add(writer, format="{message}")

        def onerror(error):
            nonlocal is_error_valid
            logger.info("Called after logged message")
            _, exception, _ = sys.exc_info()
            is_error_valid = (error == exception) and isinstance(error, ZeroDivisionError)

        @logger.catch(onerror=onerror)
>       def a():
E       TypeError: 'NoneType' object is not callable

is_error_valid = False
onerror    = .onerror at 0x7fac08f5ff40>
writer     = .w at 0x7fac08f5c280>

tests/test_exceptions_catch.py:333: TypeError

test_exceptions_catch.py::test_onerror_with_reraise

test_exceptions_catch.py::test_onerror_with_reraise
writer = .w at 0x7fac08fa6050>

    def test_onerror_with_reraise(writer):
        called = False
        logger.add(writer, format="{message}")

        def onerror(_):
            nonlocal called
            called = True

        with pytest.raises(ZeroDivisionError):
>           with logger.catch(onerror=onerror, reraise=True):
E           AttributeError: __enter__

called     = False
onerror    = .onerror at 0x7fac08fa68c0>
writer     = .w at 0x7fac08fa6050>

tests/test_exceptions_catch.py:353: AttributeError

test_exceptions_catch.py::test_decorate_function

test_exceptions_catch.py::test_decorate_function
writer = .w at 0x7fac08f57e20>

    def test_decorate_function(writer):
        logger.add(writer, format="{message}", diagnose=False, backtrace=False, colorize=False)

        @logger.catch
        def a(x):
            return 100 / x

>       assert a(50) == 2
E       TypeError: 'NoneType' object is not callable

a          = None
writer     = .w at 0x7fac08f57e20>

tests/test_exceptions_catch.py:366: TypeError

test_exceptions_catch.py::test_decorate_coroutine

test_exceptions_catch.py::test_decorate_coroutine
writer = .w at 0x7fac08f5ff40>

    def test_decorate_coroutine(writer):
        logger.add(writer, format="{message}", diagnose=False, backtrace=False, colorize=False)

        @logger.catch
        async def foo(a, b):
            return a + b

>       result = asyncio.run(foo(100, 5))
E       TypeError: 'NoneType' object is not callable

foo        = None
writer     = .w at 0x7fac08f5ff40>

tests/test_exceptions_catch.py:377: TypeError

test_exceptions_catch.py::test_decorate_generator

test_exceptions_catch.py::test_decorate_generator
writer = .w at 0x7fac08fa5870>

    def test_decorate_generator(writer):
        @logger.catch
        def foo(x, y, z):
            yield x
            yield y
            return z

>       f = foo(1, 2, 3)
E       TypeError: 'NoneType' object is not callable

foo        = None
writer     = .w at 0x7fac08fa5870>

tests/test_exceptions_catch.py:390: TypeError

test_exceptions_catch.py::test_decorate_generator_with_error

test_exceptions_catch.py::test_decorate_generator_with_error
def test_decorate_generator_with_error():
        @logger.catch
        def foo():
            for i in range(3):
                1 / (2 - i)
                yield i

>       assert list(foo()) == [0, 1]
E       TypeError: 'NoneType' object is not callable

foo        = None

tests/test_exceptions_catch.py:405: TypeError

test_exceptions_catch.py::test_default_with_function

test_exceptions_catch.py::test_default_with_function
def test_default_with_function():
        @logger.catch(default=42)
>       def foo():
E       TypeError: 'NoneType' object is not callable


tests/test_exceptions_catch.py:410: TypeError

test_exceptions_catch.py::test_default_with_generator

test_exceptions_catch.py::test_default_with_generator
def test_default_with_generator():
        @logger.catch(default=42)
>       def foo():
E       TypeError: 'NoneType' object is not callable


tests/test_exceptions_catch.py:418: TypeError

test_exceptions_catch.py::test_default_with_coroutine

test_exceptions_catch.py::test_default_with_coroutine
def test_default_with_coroutine():
        @logger.catch(default=42)
>       async def foo():
E       TypeError: 'NoneType' object is not callable


tests/test_exceptions_catch.py:427: TypeError

test_exceptions_catch.py::test_error_when_decorating_class_without_parentheses

test_exceptions_catch.py::test_error_when_decorating_class_without_parentheses
def test_error_when_decorating_class_without_parentheses():
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

Foo        = None

tests/test_exceptions_catch.py:434: Failed

test_exceptions_formatting.py::test_backtrace[chained_expression_direct]

test_exceptions_formatting.py::test_backtrace[chained_expression_direct]
filename = 'chained_expression_direct'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'chained_expression_direct'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'chained_expression_direct'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'chained_expression_direct'
filepath   = 'tests/exceptions/source/backtrace/chained_expression_direct.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/chained_expression_direct.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/chained_expression_direct.py", line 10, in \n    def a_decorated():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[chained_expression_indirect]

test_exceptions_formatting.py::test_backtrace[chained_expression_indirect]
filename = 'chained_expression_indirect'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'chained_expression_indirect'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'chained_expression_indirect'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'chained_expression_indirect'
filepath   = 'tests/exceptions/source/backtrace/chained_expression_indirect.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/chained_expression_indirect.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/chained_expression_indirect.py", line 21, in \n    b()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[chaining_first]

test_exceptions_formatting.py::test_backtrace[chaining_first]
filename = 'chaining_first'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'chaining_first'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'chaining_first'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'chaining_first'
filepath   = 'tests/exceptions/source/backtrace/chaining_first.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/chaining_first.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/chaining_first.py", line 26, in \n    a_decorated()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[chaining_second]

test_exceptions_formatting.py::test_backtrace[chaining_second]
filename = 'chaining_second'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'chaining_second'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'chaining_second'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'chaining_second'
filepath   = 'tests/exceptions/source/backtrace/chaining_second.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/chaining_second.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/chaining_second.py", line 26, in \n    def b_decorated():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[chaining_third]

test_exceptions_formatting.py::test_backtrace[chaining_third]
filename = 'chaining_third'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'chaining_third'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'chaining_third'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'chaining_third'
filepath   = 'tests/exceptions/source/backtrace/chaining_third.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/chaining_third.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/chaining_third.py", line 46, i...trace/chaining_third.py", line 22, in b_decorator\n    c_decorated()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[enqueue]

test_exceptions_formatting.py::test_backtrace[enqueue]
filename = 'enqueue'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'enqueue'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'enqueue'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'enqueue'
filepath   = 'tests/exceptions/source/backtrace/enqueue.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/enqueue.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_backtrace[enqueue_with_others_handlers]

test_exceptions_formatting.py::test_backtrace[enqueue_with_others_handlers]
filename = 'enqueue_with_others_handlers'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'enqueue_with_others_handlers'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'enqueue_with_others_handlers'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'enqueue_with_others_handlers'
filepath   = 'tests/exceptions/source/backtrace/enqueue_with_others_handlers.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/enqueue_with_others_handlers.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_backtrace[frame_values_backward]

test_exceptions_formatting.py::test_backtrace[frame_values_backward]
filename = 'frame_values_backward'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'frame_values_backward'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'frame_values_backward'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'frame_values_backward'
filepath   = 'tests/exceptions/source/backtrace/frame_values_backward.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/frame_values_backward.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/frame_values_backward.py", lin...rce/backtrace/frame_values_backward.py", line 17, in b\n    a(n - 1)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[frame_values_forward]

test_exceptions_formatting.py::test_backtrace[frame_values_forward]
filename = 'frame_values_forward'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'frame_values_forward'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'frame_values_forward'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'frame_values_forward'
filepath   = 'tests/exceptions/source/backtrace/frame_values_forward.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/frame_values_forward.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/frame_values_forward.py", line 24, in \n    c(k)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[function]

test_exceptions_formatting.py::test_backtrace[function]
filename = 'function'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'function'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'function'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'function'
filepath   = 'tests/exceptions/source/backtrace/function.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/function.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/function.py", line 10, in \n    def a():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[head_recursion]

test_exceptions_formatting.py::test_backtrace[head_recursion]
filename = 'head_recursion'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'head_recursion'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'head_recursion'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'head_recursion'
filepath   = 'tests/exceptions/source/backtrace/head_recursion.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/head_recursion.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/head_recursion.py", line 10, in \n    def a(n):\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[missing_attributes_traceback_objects]

test_exceptions_formatting.py::test_backtrace[missing_attributes_traceback_objects]
filename = 'missing_attributes_traceback_objects'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'missing_attributes_traceback_objects'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'missing_attributes_traceback_objects'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'missing_attributes_traceback_objects'
filepath   = 'tests/exceptions/source/backtrace/missing_attributes_traceback_objects.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/missing_attributes_traceback_objects.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/missing_attributes_traceback_o...  logger.opt(exception=(type_, value, tb)).error("")\nAttributeError: \'NoneType\' object has no attribute \'error\'\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[nested]

test_exceptions_formatting.py::test_backtrace[nested]
filename = 'nested'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'nested'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'nested'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'nested'
filepath   = 'tests/exceptions/source/backtrace/nested.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/nested.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/nested.py", line 17, in 

test_exceptions_formatting.py::test_backtrace[nested_chained_catch_up]

test_exceptions_formatting.py::test_backtrace[nested_chained_catch_up]
filename = 'nested_chained_catch_up'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'nested_chained_catch_up'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'nested_chained_catch_up'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'nested_chained_catch_up'
filepath   = 'tests/exceptions/source/backtrace/nested_chained_catch_up.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/nested_chained_catch_up.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/nested_chained_catch_up.py", line 15, in \n    def bar():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[nested_decorator_catch_up]

test_exceptions_formatting.py::test_backtrace[nested_decorator_catch_up]
filename = 'nested_decorator_catch_up'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'nested_decorator_catch_up'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'nested_decorator_catch_up'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'nested_decorator_catch_up'
filepath   = 'tests/exceptions/source/backtrace/nested_decorator_catch_up.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/nested_decorator_catch_up.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/nested_decorator_catch_up.py", line 11, in \n    def foo():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[nested_explicit_catch_up]

test_exceptions_formatting.py::test_backtrace[nested_explicit_catch_up]
filename = 'nested_explicit_catch_up'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'nested_explicit_catch_up'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'nested_explicit_catch_up'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'nested_explicit_catch_up'
filepath   = 'tests/exceptions/source/backtrace/nested_explicit_catch_up.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/nested_explicit_catch_up.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/nested_explicit_catch_up.py", line 15, in \n    def bar():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[nested_wrapping]

test_exceptions_formatting.py::test_backtrace[nested_wrapping]
filename = 'nested_wrapping'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'nested_wrapping'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'nested_wrapping'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'nested_wrapping'
filepath   = 'tests/exceptions/source/backtrace/nested_wrapping.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/nested_wrapping.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/nested_wrapping.py", line 15, in \n    def a(x):\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[no_tb]

test_exceptions_formatting.py::test_backtrace[no_tb]
filename = 'no_tb'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'no_tb'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'no_tb'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'no_tb'
filepath   = 'tests/exceptions/source/backtrace/no_tb.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/no_tb.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/no_tb.py", line 19, in 

test_exceptions_formatting.py::test_backtrace[not_enough_arguments]

test_exceptions_formatting.py::test_backtrace[not_enough_arguments]
filename = 'not_enough_arguments'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'not_enough_arguments'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'not_enough_arguments'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'not_enough_arguments'
filepath   = 'tests/exceptions/source/backtrace/not_enough_arguments.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/not_enough_arguments.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/not_enough_arguments.py", line 18, in \n    decorated(1)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[raising_recursion]

test_exceptions_formatting.py::test_backtrace[raising_recursion]
filename = 'raising_recursion'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'raising_recursion'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'raising_recursion'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'raising_recursion'
filepath   = 'tests/exceptions/source/backtrace/raising_recursion.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/raising_recursion.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/raising_recursion.py", line 32, in \n    a(1)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[suppressed_expression_direct]

test_exceptions_formatting.py::test_backtrace[suppressed_expression_direct]
filename = 'suppressed_expression_direct'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'suppressed_expression_direct'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'suppressed_expression_direct'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'suppressed_expression_direct'
filepath   = 'tests/exceptions/source/backtrace/suppressed_expression_direct.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/suppressed_expression_direct.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/suppressed_expression_direct.p...ed_expression_direct.py", line 29, in c_decorator\n    b_decorated()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[suppressed_expression_indirect]

test_exceptions_formatting.py::test_backtrace[suppressed_expression_indirect]
filename = 'suppressed_expression_indirect'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'suppressed_expression_indirect'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'suppressed_expression_indirect'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'suppressed_expression_indirect'
filepath   = 'tests/exceptions/source/backtrace/suppressed_expression_indirect.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/suppressed_expression_indirect.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/suppressed_expression_indirect.py", line 29, in \n    c_decorated()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[tail_recursion]

test_exceptions_formatting.py::test_backtrace[tail_recursion]
filename = 'tail_recursion'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'tail_recursion'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'tail_recursion'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'tail_recursion'
filepath   = 'tests/exceptions/source/backtrace/tail_recursion.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/tail_recursion.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/tail_recursion.py", line 10, in \n    def a(n):\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_backtrace[too_many_arguments]

test_exceptions_formatting.py::test_backtrace[too_many_arguments]
filename = 'too_many_arguments'

    @pytest.mark.parametrize(
        "filename",
        [
            "chained_expression_direct",
            "chained_expression_indirect",
            "chaining_first",
            "chaining_second",
            "chaining_third",
            "enqueue",
            "enqueue_with_others_handlers",
            "frame_values_backward",
            "frame_values_forward",
            "function",
            "head_recursion",
            "missing_attributes_traceback_objects",
            "nested",
            "nested_chained_catch_up",
            "nested_decorator_catch_up",
            "nested_explicit_catch_up",
            "nested_wrapping",
            "no_tb",
            "not_enough_arguments",
            "raising_recursion",
            "suppressed_expression_direct",
            "suppressed_expression_indirect",
            "tail_recursion",
            "too_many_arguments",
        ],
    )
    def test_backtrace(filename):
>       compare_exception("backtrace", filename)

filename   = 'too_many_arguments'

tests/test_exceptions_formatting.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'backtrace', filename = 'too_many_arguments'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'backtrace'
filename   = 'too_many_arguments'
filepath   = 'tests/exceptions/source/backtrace/too_many_arguments.py'
outpath    = '/testbed/tests/exceptions/output/backtrace/too_many_arguments.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/backtrace/too_many_arguments.py", line 18, in \n    decorated(1)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_diagnose[assertion_error]

test_exceptions_formatting.py::test_diagnose[assertion_error]
filename = 'assertion_error'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'assertion_error'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'assertion_error'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'assertion_error'
filepath   = 'tests/exceptions/source/diagnose/assertion_error.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/assertion_error.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[assertion_error_custom]

test_exceptions_formatting.py::test_diagnose[assertion_error_custom]
filename = 'assertion_error_custom'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'assertion_error_custom'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'assertion_error_custom'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'assertion_error_custom'
filepath   = 'tests/exceptions/source/diagnose/assertion_error_custom.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/assertion_error_custom.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[assertion_error_in_string]

test_exceptions_formatting.py::test_diagnose[assertion_error_in_string]
filename = 'assertion_error_in_string'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'assertion_error_in_string'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'assertion_error_in_string'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'assertion_error_in_string'
filepath   = 'tests/exceptions/source/diagnose/assertion_error_in_string.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/assertion_error_in_string.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[attributes]

test_exceptions_formatting.py::test_diagnose[attributes]
filename = 'attributes'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'attributes'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'attributes'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'attributes'
filepath   = 'tests/exceptions/source/diagnose/attributes.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/attributes.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[chained_both]

test_exceptions_formatting.py::test_diagnose[chained_both]
filename = 'chained_both'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'chained_both'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'chained_both'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'chained_both'
filepath   = 'tests/exceptions/source/diagnose/chained_both.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/chained_both.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[encoding]

test_exceptions_formatting.py::test_diagnose[encoding]
filename = 'encoding'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'encoding'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'encoding'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'encoding'
filepath   = 'tests/exceptions/source/diagnose/encoding.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/encoding.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[global_variable]

test_exceptions_formatting.py::test_diagnose[global_variable]
filename = 'global_variable'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'global_variable'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'global_variable'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'global_variable'
filepath   = 'tests/exceptions/source/diagnose/global_variable.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/global_variable.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[indentation_error]

test_exceptions_formatting.py::test_diagnose[indentation_error]
filename = 'indentation_error'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'indentation_error'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'indentation_error'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'indentation_error'
filepath   = 'tests/exceptions/source/diagnose/indentation_error.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/indentation_error.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[keyword_argument]

test_exceptions_formatting.py::test_diagnose[keyword_argument]
filename = 'keyword_argument'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'keyword_argument'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'keyword_argument'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'keyword_argument'
filepath   = 'tests/exceptions/source/diagnose/keyword_argument.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/keyword_argument.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/diagnose/keyword_argument.py", line 15, in \n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_diagnose[multilines_repr]

test_exceptions_formatting.py::test_diagnose[multilines_repr]
filename = 'multilines_repr'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'multilines_repr'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'multilines_repr'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'multilines_repr'
filepath   = 'tests/exceptions/source/diagnose/multilines_repr.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/multilines_repr.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[no_error_message]

test_exceptions_formatting.py::test_diagnose[no_error_message]
filename = 'no_error_message'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'no_error_message'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'no_error_message'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'no_error_message'
filepath   = 'tests/exceptions/source/diagnose/no_error_message.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/no_error_message.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[parenthesis]

test_exceptions_formatting.py::test_diagnose[parenthesis]
filename = 'parenthesis'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'parenthesis'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'parenthesis'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'parenthesis'
filepath   = 'tests/exceptions/source/diagnose/parenthesis.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/parenthesis.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/diagnose/parenthesis.py", line 46, in \n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_diagnose[source_multilines]

test_exceptions_formatting.py::test_diagnose[source_multilines]
filename = 'source_multilines'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'source_multilines'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'source_multilines'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'source_multilines'
filepath   = 'tests/exceptions/source/diagnose/source_multilines.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/source_multilines.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[source_strings]

test_exceptions_formatting.py::test_diagnose[source_strings]
filename = 'source_strings'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'source_strings'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'source_strings'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'source_strings'
filepath   = 'tests/exceptions/source/diagnose/source_strings.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/source_strings.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[syntax_error]

test_exceptions_formatting.py::test_diagnose[syntax_error]
filename = 'syntax_error'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'syntax_error'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'syntax_error'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'syntax_error'
filepath   = 'tests/exceptions/source/diagnose/syntax_error.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/syntax_error.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[syntax_highlighting]

test_exceptions_formatting.py::test_diagnose[syntax_highlighting]
filename = 'syntax_highlighting'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'syntax_highlighting'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'syntax_highlighting'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'syntax_highlighting'
filepath   = 'tests/exceptions/source/diagnose/syntax_highlighting.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/syntax_highlighting.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[truncating]

test_exceptions_formatting.py::test_diagnose[truncating]
filename = 'truncating'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'truncating'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'truncating'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'truncating'
filepath   = 'tests/exceptions/source/diagnose/truncating.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/truncating.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_diagnose[unprintable_object]

test_exceptions_formatting.py::test_diagnose[unprintable_object]
filename = 'unprintable_object'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_error",
            "assertion_error_custom",
            "assertion_error_in_string",
            "attributes",
            "chained_both",
            "encoding",
            "global_variable",
            "indentation_error",
            "keyword_argument",
            "multilines_repr",
            "no_error_message",
            "parenthesis",
            "source_multilines",
            "source_strings",
            "syntax_error",
            "syntax_highlighting",
            "truncating",
            "unprintable_object",
        ],
    )
    def test_diagnose(filename):
>       compare_exception("diagnose", filename)

filename   = 'unprintable_object'

tests/test_exceptions_formatting.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'diagnose', filename = 'unprintable_object'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'diagnose'
filename   = 'unprintable_object'
filepath   = 'tests/exceptions/source/diagnose/unprintable_object.py'
outpath    = '/testbed/tests/exceptions/output/diagnose/unprintable_object.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[assertion_from_lib]

test_exceptions_formatting.py::test_exception_ownership[assertion_from_lib]
filename = 'assertion_from_lib'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'assertion_from_lib'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'assertion_from_lib'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'assertion_from_lib'
filepath   = 'tests/exceptions/source/ownership/assertion_from_lib.py'
outpath    = '/testbed/tests/exceptions/output/ownership/assertion_from_lib.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[assertion_from_local]

test_exceptions_formatting.py::test_exception_ownership[assertion_from_local]
filename = 'assertion_from_local'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'assertion_from_local'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'assertion_from_local'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'assertion_from_local'
filepath   = 'tests/exceptions/source/ownership/assertion_from_local.py'
outpath    = '/testbed/tests/exceptions/output/ownership/assertion_from_local.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[callback]

test_exceptions_formatting.py::test_exception_ownership[callback]
filename = 'callback'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'callback'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'callback'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'callback'
filepath   = 'tests/exceptions/source/ownership/callback.py'
outpath    = '/testbed/tests/exceptions/output/ownership/callback.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[catch_decorator]

test_exceptions_formatting.py::test_exception_ownership[catch_decorator]
filename = 'catch_decorator'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'catch_decorator'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'catch_decorator'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'catch_decorator'
filepath   = 'tests/exceptions/source/ownership/catch_decorator.py'
outpath    = '/testbed/tests/exceptions/output/ownership/catch_decorator.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/ownership/catch_decorator.py", line 20, ...ns/source/ownership/catch_decorator.py", line 17, in test\n    foo()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_ownership[catch_decorator_from_lib]

test_exceptions_formatting.py::test_exception_ownership[catch_decorator_from_lib]
filename = 'catch_decorator_from_lib'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'catch_decorator_from_lib'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'catch_decorator_from_lib'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'catch_decorator_from_lib'
filepath   = 'tests/exceptions/source/ownership/catch_decorator_from_lib.py'
outpath    = '/testbed/tests/exceptions/output/ownership/catch_decorator_from_lib.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/ownership/catch_decorator_from_lib.py", ...ip/usersite/somelib/__init__.py", line 10, in callme\n    callback()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_ownership[decorated_callback]

test_exceptions_formatting.py::test_exception_ownership[decorated_callback]
filename = 'decorated_callback'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'decorated_callback'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'decorated_callback'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'decorated_callback'
filepath   = 'tests/exceptions/source/ownership/decorated_callback.py'
outpath    = '/testbed/tests/exceptions/output/ownership/decorated_callback.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/ownership/decorated_callback.py", line 2...ip/usersite/somelib/__init__.py", line 10, in callme\n    callback()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_ownership[direct]

test_exceptions_formatting.py::test_exception_ownership[direct]
filename = 'direct'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'direct'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'direct'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'direct'
filepath   = 'tests/exceptions/source/ownership/direct.py'
outpath    = '/testbed/tests/exceptions/output/ownership/direct.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[indirect]

test_exceptions_formatting.py::test_exception_ownership[indirect]
filename = 'indirect'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'indirect'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'indirect'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'indirect'
filepath   = 'tests/exceptions/source/ownership/indirect.py'
outpath    = '/testbed/tests/exceptions/output/ownership/indirect.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[string_lib]

test_exceptions_formatting.py::test_exception_ownership[string_lib]
filename = 'string_lib'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'string_lib'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'string_lib'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'string_lib'
filepath   = 'tests/exceptions/source/ownership/string_lib.py'
outpath    = '/testbed/tests/exceptions/output/ownership/string_lib.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[string_source]

test_exceptions_formatting.py::test_exception_ownership[string_source]
filename = 'string_source'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'string_source'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'string_source'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'string_source'
filepath   = 'tests/exceptions/source/ownership/string_source.py'
outpath    = '/testbed/tests/exceptions/output/ownership/string_source.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_ownership[syntaxerror]

test_exceptions_formatting.py::test_exception_ownership[syntaxerror]
filename = 'syntaxerror'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertion_from_lib",
            "assertion_from_local",
            "callback",
            "catch_decorator",
            "catch_decorator_from_lib",
            "decorated_callback",
            "direct",
            "indirect",
            "string_lib",
            "string_source",
            "syntaxerror",
        ],
    )
    def test_exception_ownership(filename):
>       compare_exception("ownership", filename)

filename   = 'syntaxerror'

tests/test_exceptions_formatting.py:194: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'ownership', filename = 'syntaxerror'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'ownership'
filename   = 'syntaxerror'
filepath   = 'tests/exceptions/source/ownership/syntaxerror.py'
outpath    = '/testbed/tests/exceptions/output/ownership/syntaxerror.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_others[assertionerror_without_traceback]

test_exceptions_formatting.py::test_exception_others[assertionerror_without_traceback]
filename = 'assertionerror_without_traceback'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'assertionerror_without_traceback'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'assertionerror_without_traceback'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'assertionerror_without_traceback'
filepath   = 'tests/exceptions/source/others/assertionerror_without_traceback.py'
outpath    = '/testbed/tests/exceptions/output/others/assertionerror_without_traceback.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/assertionerror_without_traceback....logger.opt(exception=(type_, value, None)).error("")\nAttributeError: \'NoneType\' object has no attribute \'error\'\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[catch_as_context_manager]

test_exceptions_formatting.py::test_exception_others[catch_as_context_manager]
filename = 'catch_as_context_manager'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'catch_as_context_manager'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'catch_as_context_manager'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'catch_as_context_manager'
filepath   = 'tests/exceptions/source/others/catch_as_context_manager.py'
outpath    = '/testbed/tests/exceptions/output/others/catch_as_context_manager.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/catch_as_context_manager.py", line 9, in \n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[catch_as_decorator_with_parentheses]

test_exceptions_formatting.py::test_exception_others[catch_as_decorator_with_parentheses]
filename = 'catch_as_decorator_with_parentheses'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'catch_as_decorator_with_parentheses'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'catch_as_decorator_with_parentheses'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'catch_as_decorator_with_parentheses'
filepath   = 'tests/exceptions/source/others/catch_as_decorator_with_parentheses.py'
outpath    = '/testbed/tests/exceptions/output/others/catch_as_decorator_with_parentheses.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/catch_as_decorator_with_parentheses.py", line 10, in \n    def c(a, b):\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[catch_as_decorator_without_parentheses]

test_exceptions_formatting.py::test_exception_others[catch_as_decorator_without_parentheses]
filename = 'catch_as_decorator_without_parentheses'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'catch_as_decorator_without_parentheses'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'catch_as_decorator_without_parentheses'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'catch_as_decorator_without_parentheses'
filepath   = 'tests/exceptions/source/others/catch_as_decorator_without_parentheses.py'
outpath    = '/testbed/tests/exceptions/output/others/catch_as_decorator_without_parentheses.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/catch_as_decorator_without_parentheses.py", line 14, in \n    c(2)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[catch_as_function]

test_exceptions_formatting.py::test_exception_others[catch_as_function]
filename = 'catch_as_function'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'catch_as_function'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'catch_as_function'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'catch_as_function'
filepath   = 'tests/exceptions/source/others/catch_as_function.py'
outpath    = '/testbed/tests/exceptions/output/others/catch_as_function.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/catch_as_function.py", line 13, in \n    a = logger.catch()(a)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[catch_message]

test_exceptions_formatting.py::test_exception_others[catch_message]
filename = 'catch_message'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'catch_message'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'catch_message'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'catch_message'
filepath   = 'tests/exceptions/source/others/catch_message.py'
outpath    = '/testbed/tests/exceptions/output/others/catch_message.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/catch_message.py", line 13, in \n    with logger.catch(message="An error occurred (1):"):\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[exception_formatting_coroutine]

test_exceptions_formatting.py::test_exception_others[exception_formatting_coroutine]
filename = 'exception_formatting_coroutine'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'exception_formatting_coroutine'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'exception_formatting_coroutine'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'exception_formatting_coroutine'
filepath   = 'tests/exceptions/source/others/exception_formatting_coroutine.py'
outpath    = '/testbed/tests/exceptions/output/others/exception_formatting_coroutine.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/exception_formatting_coroutine.py", line 17, in \n    f = foo(1, 0)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[exception_formatting_function]

test_exceptions_formatting.py::test_exception_others[exception_formatting_function]
filename = 'exception_formatting_function'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'exception_formatting_function'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'exception_formatting_function'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'exception_formatting_function'
filepath   = 'tests/exceptions/source/others/exception_formatting_function.py'
outpath    = '/testbed/tests/exceptions/output/others/exception_formatting_function.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/exception_formatting_function.py", line 17, in \n    a(1, 0)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[exception_formatting_generator]

test_exceptions_formatting.py::test_exception_others[exception_formatting_generator]
filename = 'exception_formatting_generator'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'exception_formatting_generator'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'exception_formatting_generator'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'exception_formatting_generator'
filepath   = 'tests/exceptions/source/others/exception_formatting_generator.py'
outpath    = '/testbed/tests/exceptions/output/others/exception_formatting_generator.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/exception_formatting_generator.py", line 17, in \n    f = foo(1, 0)\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[exception_in_property]

test_exceptions_formatting.py::test_exception_others[exception_in_property]
filename = 'exception_in_property'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'exception_in_property'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'exception_in_property'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'exception_in_property'
filepath   = 'tests/exceptions/source/others/exception_in_property.py'
outpath    = '/testbed/tests/exceptions/output/others/exception_in_property.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/exception_in_property.py", line 1... value\n    logger.opt(exception=True).debug("test")\nAttributeError: \'NoneType\' object has no attribute \'debug\'\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[handler_formatting_with_context_manager]

test_exceptions_formatting.py::test_exception_others[handler_formatting_with_context_manager]
filename = 'handler_formatting_with_context_manager'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'handler_formatting_with_context_manager'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'handler_formatting_with_context_manager'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'handler_formatting_with_context_manager'
filepath   = 'tests/exceptions/source/others/handler_formatting_with_context_manager.py'
outpath    = '/testbed/tests/exceptions/output/others/handler_formatting_with_context_manager.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/handler_formatting_with_context_m...hers/handler_formatting_with_context_manager.py", line 16, in a\n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[handler_formatting_with_decorator]

test_exceptions_formatting.py::test_exception_others[handler_formatting_with_decorator]
filename = 'handler_formatting_with_decorator'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'handler_formatting_with_decorator'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'handler_formatting_with_decorator'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'handler_formatting_with_decorator'
filepath   = 'tests/exceptions/source/others/handler_formatting_with_decorator.py'
outpath    = '/testbed/tests/exceptions/output/others/handler_formatting_with_decorator.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/handler_formatting_with_decorator.py", line 20, in \n    a()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[level_name]

test_exceptions_formatting.py::test_exception_others[level_name]
filename = 'level_name'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'level_name'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'level_name'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'level_name'
filepath   = 'tests/exceptions/source/others/level_name.py'
outpath    = '/testbed/tests/exceptions/output/others/level_name.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/level_name.py", line 16, in 

test_exceptions_formatting.py::test_exception_others[level_number]

test_exceptions_formatting.py::test_exception_others[level_number]
filename = 'level_number'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'level_number'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'level_number'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'level_number'
filepath   = 'tests/exceptions/source/others/level_number.py'
outpath    = '/testbed/tests/exceptions/output/others/level_number.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/level_number.py", line 16, in 

test_exceptions_formatting.py::test_exception_others[message_formatting_with_context_manager]

test_exceptions_formatting.py::test_exception_others[message_formatting_with_context_manager]
filename = 'message_formatting_with_context_manager'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'message_formatting_with_context_manager'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'message_formatting_with_context_manager'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'message_formatting_with_context_manager'
filepath   = 'tests/exceptions/source/others/message_formatting_with_context_manager.py'
outpath    = '/testbed/tests/exceptions/output/others/message_formatting_with_context_manager.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/message_formatting_with_context_m...others/message_formatting_with_context_manager.py", line 10, in a\n    with logger.catch(\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[message_formatting_with_decorator]

test_exceptions_formatting.py::test_exception_others[message_formatting_with_decorator]
filename = 'message_formatting_with_decorator'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'message_formatting_with_decorator'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'message_formatting_with_decorator'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'message_formatting_with_decorator'
filepath   = 'tests/exceptions/source/others/message_formatting_with_decorator.py'
outpath    = '/testbed/tests/exceptions/output/others/message_formatting_with_decorator.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/message_formatting_with_decorator.py", line 10, in \n    def a():\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[nested_with_reraise]

test_exceptions_formatting.py::test_exception_others[nested_with_reraise]
filename = 'nested_with_reraise'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'nested_with_reraise'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'nested_with_reraise'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'nested_with_reraise'
filepath   = 'tests/exceptions/source/others/nested_with_reraise.py'
outpath    = '/testbed/tests/exceptions/output/others/nested_with_reraise.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/nested_with_reraise.py", line 13, in \n    def foo(a, b):\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[syntaxerror_without_traceback]

test_exceptions_formatting.py::test_exception_others[syntaxerror_without_traceback]
filename = 'syntaxerror_without_traceback'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'syntaxerror_without_traceback'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'syntaxerror_without_traceback'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'syntaxerror_without_traceback'
filepath   = 'tests/exceptions/source/others/syntaxerror_without_traceback.py'
outpath    = '/testbed/tests/exceptions/output/others/syntaxerror_without_traceback.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/syntaxerror_without_traceback.py"...logger.opt(exception=(type_, value, None)).error("")\nAttributeError: \'NoneType\' object has no attribute \'error\'\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit]

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit]
filename = 'sys_tracebacklimit'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'sys_tracebacklimit'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'sys_tracebacklimit'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'others'
filename   = 'sys_tracebacklimit'
filepath   = 'tests/exceptions/source/others/sys_tracebacklimit.py'
outpath    = '/testbed/tests/exceptions/output/others/sys_tracebacklimit.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit_negative]

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit_negative]
filename = 'sys_tracebacklimit_negative'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'sys_tracebacklimit_negative'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'sys_tracebacklimit_negative'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'others'
filename   = 'sys_tracebacklimit_negative'
filepath   = 'tests/exceptions/source/others/sys_tracebacklimit_negative.py'
outpath    = '/testbed/tests/exceptions/output/others/sys_tracebacklimit_negative.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit_none]

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit_none]
filename = 'sys_tracebacklimit_none'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'sys_tracebacklimit_none'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'sys_tracebacklimit_none'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'others'
filename   = 'sys_tracebacklimit_none'
filepath   = 'tests/exceptions/source/others/sys_tracebacklimit_none.py'
outpath    = '/testbed/tests/exceptions/output/others/sys_tracebacklimit_none.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit_unset]

test_exceptions_formatting.py::test_exception_others[sys_tracebacklimit_unset]
filename = 'sys_tracebacklimit_unset'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'sys_tracebacklimit_unset'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'sys_tracebacklimit_unset'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
            assert proc.returncode == 0
            assert stdout == ""
>           assert stderr != ""
E           AssertionError: assert '' != ''

cwd        = '/testbed'
dirname    = 'others'
filename   = 'sys_tracebacklimit_unset'
filepath   = 'tests/exceptions/source/others/sys_tracebacklimit_unset.py'
outpath    = '/testbed/tests/exceptions/output/others/sys_tracebacklimit_unset.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = ''
stdout     = ''

tests/test_exceptions_formatting.py:107: AssertionError

test_exceptions_formatting.py::test_exception_others[zerodivisionerror_without_traceback]

test_exceptions_formatting.py::test_exception_others[zerodivisionerror_without_traceback]
filename = 'zerodivisionerror_without_traceback'

    @pytest.mark.parametrize(
        "filename",
        [
            "assertionerror_without_traceback",
            "catch_as_context_manager",
            "catch_as_decorator_with_parentheses",
            "catch_as_decorator_without_parentheses",
            "catch_as_function",
            "catch_message",
            "exception_formatting_coroutine",
            "exception_formatting_function",
            "exception_formatting_generator",
            "exception_in_property",
            "handler_formatting_with_context_manager",
            "handler_formatting_with_decorator",
            "level_name",
            "level_number",
            "message_formatting_with_context_manager",
            "message_formatting_with_decorator",
            "nested_with_reraise",
            "syntaxerror_without_traceback",
            "sys_tracebacklimit",
            "sys_tracebacklimit_negative",
            "sys_tracebacklimit_none",
            "sys_tracebacklimit_unset",
            "zerodivisionerror_without_traceback",
        ],
    )
    def test_exception_others(filename):
>       compare_exception("others", filename)

filename   = 'zerodivisionerror_without_traceback'

tests/test_exceptions_formatting.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'others', filename = 'zerodivisionerror_without_traceback'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'others'
filename   = 'zerodivisionerror_without_traceback'
filepath   = 'tests/exceptions/source/others/zerodivisionerror_without_traceback.py'
outpath    = '/testbed/tests/exceptions/output/others/zerodivisionerror_without_traceback.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/others/zerodivisionerror_without_traceba...logger.opt(exception=(type_, value, None)).error("")\nAttributeError: \'NoneType\' object has no attribute \'error\'\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_modern[type_hints-minimum_python_version0]

test_exceptions_formatting.py::test_exception_modern[type_hints-minimum_python_version0]
filename = 'type_hints', minimum_python_version = (3, 6)

    @pytest.mark.parametrize(
        "filename, minimum_python_version",
        [
            ("type_hints", (3, 6)),
            ("positional_only_argument", (3, 8)),
            ("walrus_operator", (3, 8)),
            ("match_statement", (3, 10)),
            ("exception_group_catch", (3, 11)),
            ("notes", (3, 11)),
            ("grouped_simple", (3, 11)),
            ("grouped_nested", (3, 11)),
            ("grouped_with_cause_and_context", (3, 11)),
            ("grouped_as_cause_and_context", (3, 11)),
            ("grouped_max_length", (3, 11)),
            ("grouped_max_depth", (3, 11)),
            ("f_string", (3, 12)),  # Available since 3.6 but in 3.12 the lexer for f-string changed.
        ],
    )
    def test_exception_modern(filename, minimum_python_version):
        if sys.version_info < minimum_python_version:
            pytest.skip("Feature not supported in this Python version")

>       compare_exception("modern", filename)

filename   = 'type_hints'
minimum_python_version = (3, 6)

tests/test_exceptions_formatting.py:251: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'modern', filename = 'type_hints'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'modern'
filename   = 'type_hints'
filepath   = 'tests/exceptions/source/modern/type_hints.py'
outpath    = '/testbed/tests/exceptions/output/modern/type_hints.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/modern/type_hints.py", line 22, in \n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_modern[positional_only_argument-minimum_python_version1]

test_exceptions_formatting.py::test_exception_modern[positional_only_argument-minimum_python_version1]
filename = 'positional_only_argument', minimum_python_version = (3, 8)

    @pytest.mark.parametrize(
        "filename, minimum_python_version",
        [
            ("type_hints", (3, 6)),
            ("positional_only_argument", (3, 8)),
            ("walrus_operator", (3, 8)),
            ("match_statement", (3, 10)),
            ("exception_group_catch", (3, 11)),
            ("notes", (3, 11)),
            ("grouped_simple", (3, 11)),
            ("grouped_nested", (3, 11)),
            ("grouped_with_cause_and_context", (3, 11)),
            ("grouped_as_cause_and_context", (3, 11)),
            ("grouped_max_length", (3, 11)),
            ("grouped_max_depth", (3, 11)),
            ("f_string", (3, 12)),  # Available since 3.6 but in 3.12 the lexer for f-string changed.
        ],
    )
    def test_exception_modern(filename, minimum_python_version):
        if sys.version_info < minimum_python_version:
            pytest.skip("Feature not supported in this Python version")

>       compare_exception("modern", filename)

filename   = 'positional_only_argument'
minimum_python_version = (3, 8)

tests/test_exceptions_formatting.py:251: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'modern', filename = 'positional_only_argument'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'modern'
filename   = 'positional_only_argument'
filepath   = 'tests/exceptions/source/modern/positional_only_argument.py'
outpath    = '/testbed/tests/exceptions/output/modern/positional_only_argument.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/modern/positional_only_argument.py", line 22, in \n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_modern[walrus_operator-minimum_python_version2]

test_exceptions_formatting.py::test_exception_modern[walrus_operator-minimum_python_version2]
filename = 'walrus_operator', minimum_python_version = (3, 8)

    @pytest.mark.parametrize(
        "filename, minimum_python_version",
        [
            ("type_hints", (3, 6)),
            ("positional_only_argument", (3, 8)),
            ("walrus_operator", (3, 8)),
            ("match_statement", (3, 10)),
            ("exception_group_catch", (3, 11)),
            ("notes", (3, 11)),
            ("grouped_simple", (3, 11)),
            ("grouped_nested", (3, 11)),
            ("grouped_with_cause_and_context", (3, 11)),
            ("grouped_as_cause_and_context", (3, 11)),
            ("grouped_max_length", (3, 11)),
            ("grouped_max_depth", (3, 11)),
            ("f_string", (3, 12)),  # Available since 3.6 but in 3.12 the lexer for f-string changed.
        ],
    )
    def test_exception_modern(filename, minimum_python_version):
        if sys.version_info < minimum_python_version:
            pytest.skip("Feature not supported in this Python version")

>       compare_exception("modern", filename)

filename   = 'walrus_operator'
minimum_python_version = (3, 8)

tests/test_exceptions_formatting.py:251: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'modern', filename = 'walrus_operator'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'modern'
filename   = 'walrus_operator'
filepath   = 'tests/exceptions/source/modern/walrus_operator.py'
outpath    = '/testbed/tests/exceptions/output/modern/walrus_operator.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/modern/walrus_operator.py", line 25, in \n    main()\nTypeError: \'NoneType\' object is not callable\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_exception_modern[match_statement-minimum_python_version3]

test_exceptions_formatting.py::test_exception_modern[match_statement-minimum_python_version3]
filename = 'match_statement', minimum_python_version = (3, 10)

    @pytest.mark.parametrize(
        "filename, minimum_python_version",
        [
            ("type_hints", (3, 6)),
            ("positional_only_argument", (3, 8)),
            ("walrus_operator", (3, 8)),
            ("match_statement", (3, 10)),
            ("exception_group_catch", (3, 11)),
            ("notes", (3, 11)),
            ("grouped_simple", (3, 11)),
            ("grouped_nested", (3, 11)),
            ("grouped_with_cause_and_context", (3, 11)),
            ("grouped_as_cause_and_context", (3, 11)),
            ("grouped_max_length", (3, 11)),
            ("grouped_max_depth", (3, 11)),
            ("f_string", (3, 12)),  # Available since 3.6 but in 3.12 the lexer for f-string changed.
        ],
    )
    def test_exception_modern(filename, minimum_python_version):
        if sys.version_info < minimum_python_version:
            pytest.skip("Feature not supported in this Python version")

>       compare_exception("modern", filename)

filename   = 'match_statement'
minimum_python_version = (3, 10)

tests/test_exceptions_formatting.py:251: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = 'modern', filename = 'match_statement'

    def compare_exception(dirname, filename):
        cwd = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
        python = sys.executable or "python"
        filepath = os.path.join("tests", "exceptions", "source", dirname, filename + ".py")
        outpath = os.path.join(cwd, "tests", "exceptions", "output", dirname, filename + ".txt")

        with subprocess.Popen(
            [python, filepath],
            shell=False,
            cwd=cwd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            universal_newlines=True,
            env=dict(os.environ, PYTHONPATH=cwd, PYTHONIOENCODING="utf8"),
        ) as proc:
            stdout, stderr = proc.communicate()
            print(stderr, file=sys.stderr)
>           assert proc.returncode == 0
E           AssertionError: assert 1 == 0
E            +  where 1 = .returncode

cwd        = '/testbed'
dirname    = 'modern'
filename   = 'match_statement'
filepath   = 'tests/exceptions/source/modern/match_statement.py'
outpath    = '/testbed/tests/exceptions/output/modern/match_statement.txt'
proc       = 
python     = '/testbed/.venv/bin/python3'
stderr     = 'Traceback (most recent call last):\n  File "/testbed/tests/exceptions/source/modern/match_statement.py", line 20, in \n    with logger.catch():\nAttributeError: __enter__\n'
stdout     = ''

tests/test_exceptions_formatting.py:105: AssertionError

test_exceptions_formatting.py::test_group_exception_using_backport

test_exceptions_formatting.py::test_group_exception_using_backport
writer = .w at 0x7fac0889f6d0>

    @pytest.mark.skipif(
        not (3, 7) <= sys.version_info < (3, 11), reason="No backport available or needed"
    )
    def test_group_exception_using_backport(writer):
        from exceptiongroup import ExceptionGroup

        from loguru import logger

        logger.add(writer, backtrace=True, diagnose=True, colorize=False, format="")

        try:
            raise ExceptionGroup("Test", [ValueError(1), ValueError(2)])
        except Exception:
            logger.exception("")

>       assert writer.read().strip().startswith("+ Exception Group Traceback (most recent call last):")
E       AssertionError: assert False
E        +  where False = ('+ Exception Group Traceback (most recent call last):')
E        +    where  = ''.startswith
E        +      where '' = ()
E        +        where  = ''.strip
E        +          where '' = . at 0x7fac0889ea70>()
E        +            where . at 0x7fac0889ea70> = .w at 0x7fac0889f6d0>.read

ExceptionGroup = 
logger     = 
writer     = .w at 0x7fac0889f6d0>

tests/test_exceptions_formatting.py:269: AssertionError

test_filesink_compression.py::test_compression_ext[gz]

test_filesink_compression.py::test_compression_ext[gz]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_gz_0')
compression = 'gz'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'gz'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_gz_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_gz_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_gz_0')
files      = [('file.log.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[bz2]

test_filesink_compression.py::test_compression_ext[bz2]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_bz2_0')
compression = 'bz2'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'bz2'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_bz2_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_bz2_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.bz2', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_bz2_0')
files      = [('file.log.bz2', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[zip]

test_filesink_compression.py::test_compression_ext[zip]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_zip_0')
compression = 'zip'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'zip'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_zip_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_zip_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.zip', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_zip_0')
files      = [('file.log.zip', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[xz]

test_filesink_compression.py::test_compression_ext[xz]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_xz_0')
compression = 'xz'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'xz'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_xz_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_xz_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.xz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_xz_0')
files      = [('file.log.xz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[lzma]

test_filesink_compression.py::test_compression_ext[lzma]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_lzma_0')
compression = 'lzma'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'lzma'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_lzma_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_lzma_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.lzma', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_lzma_0')
files      = [('file.log.lzma', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[tar]

test_filesink_compression.py::test_compression_ext[tar]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_0')
compression = 'tar'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'tar'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.tar', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_0')
files      = [('file.log.tar', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[tar.gz]

test_filesink_compression.py::test_compression_ext[tar.gz]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_gz_0')
compression = 'tar.gz'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'tar.gz'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_gz_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_gz_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.tar.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_gz_0')
files      = [('file.log.tar.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[tar.bz2]

test_filesink_compression.py::test_compression_ext[tar.bz2]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_bz2_0')
compression = 'tar.bz2'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'tar.bz2'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_bz2_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_bz2_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.tar.bz2', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_bz2_0')
files      = [('file.log.tar.bz2', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_ext[tar.xz]

test_filesink_compression.py::test_compression_ext[tar.xz]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_xz_0')
compression = 'tar.xz'

    @pytest.mark.parametrize(
        "compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
    )
    def test_compression_ext(tmp_path, compression):
        i = logger.add(tmp_path / "file.log", compression=compression)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.%s" % compression, None)])

compression = 'tar.xz'
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_xz_0')

tests/test_filesink_compression.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_xz_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.tar.xz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_ext_tar_xz_0')
files      = [('file.log.tar.xz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_function

test_filesink_compression.py::test_compression_function
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_function0')

    def test_compression_function(tmp_path):
        def compress(file):
            os.replace(file, file + ".rar")

        i = logger.add(tmp_path / "file.log", compression=compress)
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.rar", None)])

compress   = .compress at 0x7fac088ed5a0>
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_function0')

tests/test_filesink_compression.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_function0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.rar', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_function0')
files      = [('file.log.rar', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_rotation[a]

test_filesink_compression.py::test_compression_at_rotation[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a0')
mode = 'a'
freeze_time = .freeze_time at 0x7fac088edb40>

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_rotation(tmp_path, mode, freeze_time):
        with freeze_time("2010-10-09 11:30:59"):
            logger.add(
                tmp_path / "file.log", format="{message}", rotation=0, compression="gz", mode=mode
            )
            logger.debug("After compression")

>       check_dir(
            tmp_path,
            files=[
                ("file.2010-10-09_11-30-59_000000.log.gz", None),
                ("file.log", "After compression\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac088edb40>
mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a0')

tests/test_filesink_compression.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a0')
files      = [('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_rotation[a+]

test_filesink_compression.py::test_compression_at_rotation[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a1')
mode = 'a+'
freeze_time = .freeze_time at 0x7fac088ede10>

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_rotation(tmp_path, mode, freeze_time):
        with freeze_time("2010-10-09 11:30:59"):
            logger.add(
                tmp_path / "file.log", format="{message}", rotation=0, compression="gz", mode=mode
            )
            logger.debug("After compression")

>       check_dir(
            tmp_path,
            files=[
                ("file.2010-10-09_11-30-59_000000.log.gz", None),
                ("file.log", "After compression\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac088ede10>
mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a1')

tests/test_filesink_compression.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_a1')
files      = [('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_rotation[w]

test_filesink_compression.py::test_compression_at_rotation[w]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_w0')
mode = 'w'
freeze_time = .freeze_time at 0x7fac0889e050>

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_rotation(tmp_path, mode, freeze_time):
        with freeze_time("2010-10-09 11:30:59"):
            logger.add(
                tmp_path / "file.log", format="{message}", rotation=0, compression="gz", mode=mode
            )
            logger.debug("After compression")

>       check_dir(
            tmp_path,
            files=[
                ("file.2010-10-09_11-30-59_000000.log.gz", None),
                ("file.log", "After compression\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac0889e050>
mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_w0')

tests/test_filesink_compression.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_w0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_w0')
files      = [('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_rotation[x]

test_filesink_compression.py::test_compression_at_rotation[x]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_x0')
mode = 'x'
freeze_time = .freeze_time at 0x7fac088ecb80>

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_rotation(tmp_path, mode, freeze_time):
        with freeze_time("2010-10-09 11:30:59"):
            logger.add(
                tmp_path / "file.log", format="{message}", rotation=0, compression="gz", mode=mode
            )
            logger.debug("After compression")

>       check_dir(
            tmp_path,
            files=[
                ("file.2010-10-09_11-30-59_000000.log.gz", None),
                ("file.log", "After compression\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac088ecb80>
mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_x0')

tests/test_filesink_compression.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_x0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_rotation_x0')
files      = [('file.2010-10-09_11-30-59_000000.log.gz', None), ('file.log', 'After compression\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_remove_without_rotation[a]

test_filesink_compression.py::test_compression_at_remove_without_rotation[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit0')
mode = 'a'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", compression="gz", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.gz", None)])

i          = None
mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit0')

tests/test_filesink_compression.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit0')
files      = [('file.log.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_remove_without_rotation[a+]

test_filesink_compression.py::test_compression_at_remove_without_rotation[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit1')
mode = 'a+'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", compression="gz", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.gz", None)])

i          = None
mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit1')

tests/test_filesink_compression.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit1')
files      = [('file.log.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_remove_without_rotation[w]

test_filesink_compression.py::test_compression_at_remove_without_rotation[w]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit2')
mode = 'w'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", compression="gz", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.gz", None)])

i          = None
mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit2')

tests/test_filesink_compression.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit2')
files      = [('file.log.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_at_remove_without_rotation[x]

test_filesink_compression.py::test_compression_at_remove_without_rotation[x]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit3')
mode = 'x'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_compression_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", compression="gz", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.gz", None)])

i          = None
mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit3')

tests/test_filesink_compression.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_at_remove_wit3')
files      = [('file.log.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[a]

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_0')
mode = 'a'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_no_compression_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "test.log", compression="gz", rotation="100 MB", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", None)])

i          = None
mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_0')

tests/test_filesink_compression.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_0')
files      = [('test.log', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[a+]

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_1')
mode = 'a+'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_no_compression_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "test.log", compression="gz", rotation="100 MB", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", None)])

i          = None
mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_1')

tests/test_filesink_compression.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_1')
files      = [('test.log', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[w]

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[w]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_2')
mode = 'w'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_no_compression_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "test.log", compression="gz", rotation="100 MB", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", None)])

i          = None
mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_2')

tests/test_filesink_compression.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_2')
files      = [('test.log', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[x]

test_filesink_compression.py::test_no_compression_at_remove_with_rotation[x]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_3')
mode = 'x'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_no_compression_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "test.log", compression="gz", rotation="100 MB", mode=mode)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", None)])

i          = None
mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_3')

tests/test_filesink_compression.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_compression_at_remove_3')
files      = [('test.log', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_rename_existing_with_creation_time

test_filesink_compression.py::test_rename_existing_with_creation_time
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea0')
freeze_time = .freeze_time at 0x7fac088eeb00>

    def test_rename_existing_with_creation_time(tmp_path, freeze_time):
        with freeze_time("2018-01-01") as frozen:
            i = logger.add(tmp_path / "test.log", compression="tar.gz")
            logger.debug("test")
            logger.remove(i)
            frozen.tick()
            j = logger.add(tmp_path / "test.log", compression="tar.gz")
            logger.debug("test")
            logger.remove(j)

>       check_dir(
            tmp_path,
            files=[("test.2018-01-01_00-00-00_000000.log.tar.gz", None), ("test.log.tar.gz", None)],
        )

freeze_time = .freeze_time at 0x7fac088eeb00>
frozen     = 
i          = None
j          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea0')

tests/test_filesink_compression.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-01-01_00-00-00_000000.log.tar.gz', None), ('test.log.tar.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea0')
files      = [('test.2018-01-01_00-00-00_000000.log.tar.gz', None), ('test.log.tar.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_renaming_compression_dest_exists

test_filesink_compression.py::test_renaming_compression_dest_exists
freeze_time = .freeze_time at 0x7fac088eef80>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest0')

    def test_renaming_compression_dest_exists(freeze_time, tmp_path):
        with freeze_time("2019-01-02 03:04:05.000006"):
            for i in range(4):
                logger.add(tmp_path / "rotate.log", compression=".tar.gz", format="{message}")
                logger.info(str(i))
                logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("rotate.log.tar.gz", None),
                ("rotate.2019-01-02_03-04-05_000006.log.tar.gz", None),
                ("rotate.2019-01-02_03-04-05_000006.2.log.tar.gz", None),
                ("rotate.2019-01-02_03-04-05_000006.3.log.tar.gz", None),
            ],
        )

freeze_time = .freeze_time at 0x7fac088eef80>
i          = 3
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest0')

tests/test_filesink_compression.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 4
E            +  where 0 = len(set())
E            +  and   4 = len([('rotate.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.2.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.3.log.tar.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest0')
files      = [('rotate.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.2.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.3.log.tar.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_renaming_compression_dest_exists_with_time

test_filesink_compression.py::test_renaming_compression_dest_exists_with_time
freeze_time = .freeze_time at 0x7fac088ef370>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest1')

    def test_renaming_compression_dest_exists_with_time(freeze_time, tmp_path):
        with freeze_time("2019-01-02 03:04:05.000006"):
            for i in range(4):
                logger.add(tmp_path / "rotate.{time}.log", compression=".tar.gz", format="{message}")
                logger.info(str(i))
                logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("rotate.2019-01-02_03-04-05_000006.log.tar.gz", None),
                ("rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.log.tar.gz", None),
                ("rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.2.log.tar.gz", None),
                ("rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.3.log.tar.gz", None),
            ],
        )

freeze_time = .freeze_time at 0x7fac088ef370>
i          = 3
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest1')

tests/test_filesink_compression.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 4
E            +  where 0 = len(set())
E            +  and   4 = len([('rotate.2019-01-02_03-04-05_000006.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_00000...04-05_000006.2.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.3.log.tar.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_compression_dest1')
files      = [('rotate.2019-01-02_03-04-05_000006.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_00000...04-05_000006.2.log.tar.gz', None), ('rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.3.log.tar.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_compression_use_renamed_file_after_rotation

test_filesink_compression.py::test_compression_use_renamed_file_after_rotation
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_use_renamed_f0')
freeze_time = .freeze_time at 0x7fac088ef7f0>

    def test_compression_use_renamed_file_after_rotation(tmp_path, freeze_time):
        def rotation(message, _):
            return message.record["extra"].get("rotate", False)

        compression = Mock()

        with freeze_time("2020-01-02"):
            logger.add(
                tmp_path / "test.log", format="{message}", compression=compression, rotation=rotation
            )

            logger.info("Before")
>           logger.bind(rotate=True).info("Rotation")
E           AttributeError: 'NoneType' object has no attribute 'info'

compression = 
freeze_time = .freeze_time at 0x7fac088ef7f0>
rotation   = .rotation at 0x7fac088edea0>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression_use_renamed_f0')

tests/test_filesink_compression.py:133: AttributeError

test_filesink_compression.py::test_threaded_compression_after_rotation

test_filesink_compression.py::test_threaded_compression_after_rotation
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_threaded_compression_afte0')

    def test_threaded_compression_after_rotation(tmp_path):
        thread = None

        def rename(filepath):
            time.sleep(1)
            os.rename(filepath, str(tmp_path / "test.log.mv"))

        def compression(filepath):
            nonlocal thread
            thread = threading.Thread(target=rename, args=(filepath,))
            thread.start()

        def rotation(message, _):
            return message.record["extra"].get("rotate", False)

        logger.add(
            tmp_path / "test.log", format="{message}", compression=compression, rotation=rotation
        )

        logger.info("Before")
>       logger.bind(rotate=True).info("Rotation")
E       AttributeError: 'NoneType' object has no attribute 'info'

compression = .compression at 0x7fac088eee60>
rename     = .rename at 0x7fac088edfc0>
rotation   = .rotation at 0x7fac088ef9a0>
thread     = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_threaded_compression_afte0')

tests/test_filesink_compression.py:167: AttributeError

test_filesink_compression.py::test_exception_during_compression_at_rotation[True]

test_filesink_compression.py::test_exception_during_compression_at_rotation[True]
freeze_time = .freeze_time at 0x7fac088efbe0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress0')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac094c0eb0>, delay = True

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_compression_at_rotation(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2017-07-01") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                compression=Mock(side_effect=[Exception("Compression error"), None]),
                rotation=0,
                catch=True,
                delay=delay,
            )
            logger.debug("AAA")
            frozen.tick()
            logger.debug("BBB")

>       check_dir(
            tmp_path,
            files=[
                ("test.2017-07-01_00-00-00_000000.log", ""),
                ("test.2017-07-01_00-00-01_000000.log", ""),
                ("test.log", "BBB\n"),
            ],
        )

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac094c0eb0>
delay      = True
freeze_time = .freeze_time at 0x7fac088efbe0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress0')

tests/test_filesink_compression.py:196: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test.2017-07-01_00-00-00_000000.log', ''), ('test.2017-07-01_00-00-01_000000.log', ''), ('test.log', 'BBB\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress0')
files      = [('test.2017-07-01_00-00-00_000000.log', ''), ('test.2017-07-01_00-00-01_000000.log', ''), ('test.log', 'BBB\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_exception_during_compression_at_rotation[False]

test_filesink_compression.py::test_exception_during_compression_at_rotation[False]
freeze_time = .freeze_time at 0x7fac088ef9a0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress1')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0876dc60>
delay = False

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_compression_at_rotation(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2017-07-01") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                compression=Mock(side_effect=[Exception("Compression error"), None]),
                rotation=0,
                catch=True,
                delay=delay,
            )
            logger.debug("AAA")
            frozen.tick()
            logger.debug("BBB")

>       check_dir(
            tmp_path,
            files=[
                ("test.2017-07-01_00-00-00_000000.log", ""),
                ("test.2017-07-01_00-00-01_000000.log", ""),
                ("test.log", "BBB\n"),
            ],
        )

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0876dc60>
delay      = False
freeze_time = .freeze_time at 0x7fac088ef9a0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress1')

tests/test_filesink_compression.py:196: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test.2017-07-01_00-00-00_000000.log', ''), ('test.2017-07-01_00-00-01_000000.log', ''), ('test.log', 'BBB\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress1')
files      = [('test.2017-07-01_00-00-00_000000.log', ''), ('test.2017-07-01_00-00-01_000000.log', ''), ('test.log', 'BBB\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_compression.py::test_exception_during_compression_at_rotation_not_caught[True]

test_filesink_compression.py::test_exception_during_compression_at_rotation_not_caught[True]
freeze_time = .freeze_time at 0x7fac087ac040>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress2')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0885fb50>, delay = True

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_compression_at_rotation_not_caught(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2017-07-01") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                compression=Mock(side_effect=[OSError("Compression error"), None]),
                rotation=0,
                catch=False,
                delay=delay,
            )
>           with pytest.raises(OSError, match="Compression error"):
E           Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0885fb50>
delay      = True
freeze_time = .freeze_time at 0x7fac087ac040>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress2')

tests/test_filesink_compression.py:222: Failed

test_filesink_compression.py::test_exception_during_compression_at_rotation_not_caught[False]

test_filesink_compression.py::test_exception_during_compression_at_rotation_not_caught[False]
freeze_time = .freeze_time at 0x7fac087ac5e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress3')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08716da0>
delay = False

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_compression_at_rotation_not_caught(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2017-07-01") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                compression=Mock(side_effect=[OSError("Compression error"), None]),
                rotation=0,
                catch=False,
                delay=delay,
            )
>           with pytest.raises(OSError, match="Compression error"):
E           Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08716da0>
delay      = False
freeze_time = .freeze_time at 0x7fac087ac5e0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress3')

tests/test_filesink_compression.py:222: Failed

test_filesink_compression.py::test_exception_during_compression_at_remove[True]

test_filesink_compression.py::test_exception_during_compression_at_remove[True]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress4')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac088e7610>, delay = True

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_compression_at_remove(tmp_path, capsys, delay):
        i = logger.add(
            tmp_path / "test.log",
            format="{message}",
            compression=Mock(side_effect=[OSError("Compression error"), None]),
            catch=True,
            delay=delay,
        )
        logger.debug("AAA")

>       with pytest.raises(OSError, match=r"Compression error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac088e7610>
delay      = True
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress4')

tests/test_filesink_compression.py:252: Failed

test_filesink_compression.py::test_exception_during_compression_at_remove[False]

test_filesink_compression.py::test_exception_during_compression_at_remove[False]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress5')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09332fe0>
delay = False

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_compression_at_remove(tmp_path, capsys, delay):
        i = logger.add(
            tmp_path / "test.log",
            format="{message}",
            compression=Mock(side_effect=[OSError("Compression error"), None]),
            catch=True,
            delay=delay,
        )
        logger.debug("AAA")

>       with pytest.raises(OSError, match=r"Compression error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09332fe0>
delay      = False
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_compress5')

tests/test_filesink_compression.py:252: Failed

test_filesink_compression.py::test_invalid_compression[0]

test_filesink_compression.py::test_invalid_compression[0]
compression = 0

    @pytest.mark.parametrize("compression", [0, True, os, object(), {"zip"}])
    def test_invalid_compression(compression):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

compression = 0

tests/test_filesink_compression.py:270: Failed

test_filesink_compression.py::test_invalid_compression[True]

test_filesink_compression.py::test_invalid_compression[True]
compression = True

    @pytest.mark.parametrize("compression", [0, True, os, object(), {"zip"}])
    def test_invalid_compression(compression):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

compression = True

tests/test_filesink_compression.py:270: Failed

test_filesink_compression.py::test_invalid_compression[os]

test_filesink_compression.py::test_invalid_compression[os]
compression = 

    @pytest.mark.parametrize("compression", [0, True, os, object(), {"zip"}])
    def test_invalid_compression(compression):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

compression = 

tests/test_filesink_compression.py:270: Failed

test_filesink_compression.py::test_invalid_compression[compression3]

test_filesink_compression.py::test_invalid_compression[compression3]
compression = 

    @pytest.mark.parametrize("compression", [0, True, os, object(), {"zip"}])
    def test_invalid_compression(compression):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

compression = 

tests/test_filesink_compression.py:270: Failed


test_filesink_compression.py::test_invalid_compression[compression4]

test_filesink_compression.py::test_invalid_compression[compression4]
compression = {'zip'}

    @pytest.mark.parametrize("compression", [0, True, os, object(), {"zip"}])
    def test_invalid_compression(compression):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

compression = {'zip'}

tests/test_filesink_compression.py:270: Failed

test_filesink_compression.py::test_unknown_compression[rar]

test_filesink_compression.py::test_unknown_compression[rar]
compression = 'rar'

    @pytest.mark.parametrize("compression", ["rar", ".7z", "tar.zip", "__dict__"])
    def test_unknown_compression(compression):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

compression = 'rar'

tests/test_filesink_compression.py:276: Failed

test_filesink_compression.py::test_unknown_compression[.7z]

test_filesink_compression.py::test_unknown_compression[.7z]
compression = '.7z'

    @pytest.mark.parametrize("compression", ["rar", ".7z", "tar.zip", "__dict__"])
    def test_unknown_compression(compression):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

compression = '.7z'

tests/test_filesink_compression.py:276: Failed

test_filesink_compression.py::test_unknown_compression[tar.zip]

test_filesink_compression.py::test_unknown_compression[tar.zip]
compression = 'tar.zip'

    @pytest.mark.parametrize("compression", ["rar", ".7z", "tar.zip", "__dict__"])
    def test_unknown_compression(compression):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

compression = 'tar.zip'

tests/test_filesink_compression.py:276: Failed

test_filesink_compression.py::test_unknown_compression[dict]

test_filesink_compression.py::test_unknown_compression[__dict__]
compression = '__dict__'

    @pytest.mark.parametrize("compression", ["rar", ".7z", "tar.zip", "__dict__"])
    def test_unknown_compression(compression):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

compression = '__dict__'

tests/test_filesink_compression.py:276: Failed

test_filesink_compression.py::test_gzip_module_unavailable[gz]

test_filesink_compression.py::test_gzip_module_unavailable[gz]
ext = 'gz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0936c340>

    @pytest.mark.parametrize("ext", ["gz", "tar.gz"])
    def test_gzip_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "gzip", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'gz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0936c340>

tests/test_filesink_compression.py:283: Failed

test_filesink_compression.py::test_gzip_module_unavailable[tar.gz]

test_filesink_compression.py::test_gzip_module_unavailable[tar.gz]
ext = 'tar.gz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0876c6d0>

    @pytest.mark.parametrize("ext", ["gz", "tar.gz"])
    def test_gzip_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "gzip", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar.gz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0876c6d0>

tests/test_filesink_compression.py:283: Failed

test_filesink_compression.py::test_bz2_module_unavailable[bz2]

test_filesink_compression.py::test_bz2_module_unavailable[bz2]
ext = 'bz2'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0942dcc0>

    @pytest.mark.parametrize("ext", ["bz2", "tar.bz2"])
    def test_bz2_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "bz2", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'bz2'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0942dcc0>

tests/test_filesink_compression.py:290: Failed

test_filesink_compression.py::test_bz2_module_unavailable[tar.bz2]

test_filesink_compression.py::test_bz2_module_unavailable[tar.bz2]
ext = 'tar.bz2'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0cdbd0>

    @pytest.mark.parametrize("ext", ["bz2", "tar.bz2"])
    def test_bz2_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "bz2", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar.bz2'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0b0cdbd0>

tests/test_filesink_compression.py:290: Failed

test_filesink_compression.py::test_lzma_module_unavailable[xz]

test_filesink_compression.py::test_lzma_module_unavailable[xz]
ext = 'xz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09300670>

    @pytest.mark.parametrize("ext", ["xz", "lzma", "tar.xz"])
    def test_lzma_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "lzma", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'xz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09300670>

tests/test_filesink_compression.py:297: Failed

test_filesink_compression.py::test_lzma_module_unavailable[lzma]

test_filesink_compression.py::test_lzma_module_unavailable[lzma]
ext = 'lzma'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac094c2830>

    @pytest.mark.parametrize("ext", ["xz", "lzma", "tar.xz"])
    def test_lzma_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "lzma", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'lzma'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac094c2830>

tests/test_filesink_compression.py:297: Failed

test_filesink_compression.py::test_lzma_module_unavailable[tar.xz]

test_filesink_compression.py::test_lzma_module_unavailable[tar.xz]
ext = 'tar.xz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac093056f0>

    @pytest.mark.parametrize("ext", ["xz", "lzma", "tar.xz"])
    def test_lzma_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "lzma", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar.xz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac093056f0>

tests/test_filesink_compression.py:297: Failed

test_filesink_compression.py::test_tarfile_module_unavailable[tar]

test_filesink_compression.py::test_tarfile_module_unavailable[tar]
ext = 'tar'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09320400>

    @pytest.mark.parametrize("ext", ["tar", "tar.gz", "tar.bz2", "tar.xz"])
    def test_tarfile_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "tarfile", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09320400>

tests/test_filesink_compression.py:304: Failed

test_filesink_compression.py::test_tarfile_module_unavailable[tar.gz]

test_filesink_compression.py::test_tarfile_module_unavailable[tar.gz]
ext = 'tar.gz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0936c2b0>

    @pytest.mark.parametrize("ext", ["tar", "tar.gz", "tar.bz2", "tar.xz"])
    def test_tarfile_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "tarfile", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar.gz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0936c2b0>

tests/test_filesink_compression.py:304: Failed

test_filesink_compression.py::test_tarfile_module_unavailable[tar.bz2]

test_filesink_compression.py::test_tarfile_module_unavailable[tar.bz2]
ext = 'tar.bz2'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f46b00>

    @pytest.mark.parametrize("ext", ["tar", "tar.gz", "tar.bz2", "tar.xz"])
    def test_tarfile_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "tarfile", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar.bz2'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08f46b00>

tests/test_filesink_compression.py:304: Failed

test_filesink_compression.py::test_tarfile_module_unavailable[tar.xz]

test_filesink_compression.py::test_tarfile_module_unavailable[tar.xz]
ext = 'tar.xz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930eb30>

    @pytest.mark.parametrize("ext", ["tar", "tar.gz", "tar.bz2", "tar.xz"])
    def test_tarfile_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "tarfile", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'tar.xz'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0930eb30>

tests/test_filesink_compression.py:304: Failed

test_filesink_compression.py::test_zipfile_module_unavailable[zip]

test_filesink_compression.py::test_zipfile_module_unavailable[zip]
ext = 'zip'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09303400>

    @pytest.mark.parametrize("ext", ["zip"])
    def test_zipfile_module_unavailable(ext, monkeypatch):
        monkeypatch.setitem(sys.modules, "zipfile", None)
>       with pytest.raises(ImportError):
E       Failed: DID NOT RAISE 

ext        = 'zip'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac09303400>

tests/test_filesink_compression.py:311: Failed

test_filesink_delay.py::test_file_not_delayed

test_filesink_delay.py::test_file_not_delayed
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_not_delayed0')

    def test_file_not_delayed(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", delay=False)
>       assert file.read_text() == ""

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_not_delayed0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_not_delayed0')

tests/test_filesink_delay.py:12: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_not_delayed0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_not_delayed0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_not_delayed0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_not_delayed0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_filesink_delay.py::test_file_delayed

test_filesink_delay.py::test_file_delayed
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_delayed0')

    def test_file_delayed(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", delay=True)
        assert not file.exists()
        logger.debug("Delayed")
>       assert file.read_text() == "Delayed\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_delayed0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_delayed0')

tests/test_filesink_delay.py:22: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_delayed0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_delayed0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_delayed0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_delayed0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_filesink_delay.py::test_compression

test_filesink_delay.py::test_compression
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression0')

    def test_compression(tmp_path):
        i = logger.add(tmp_path / "file.log", compression="gz", delay=True)
        logger.debug("a")
        logger.remove(i)

>       check_dir(tmp_path, files=[("file.log.gz", None)])

i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression0')

tests/test_filesink_delay.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file.log.gz', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_compression0')
files      = [('file.log.gz', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_delay.py::test_retention

test_filesink_delay.py::test_retention
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0')

    def test_retention(tmp_path):
        for i in range(5):
            tmp_path.joinpath("test.2020-01-01_01-01-%d_000001.log" % i).write_text("test")

        i = logger.add(tmp_path / "test.log", retention=0, delay=True)
        logger.debug("a")
        logger.remove(i)

>       check_dir(tmp_path, size=0)

i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0')

tests/test_filesink_delay.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 5 == 0
E            +  where 5 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0/test.2020-01-01_01-01-0_000001.log'), PosixPath('/tmp/pytest-...-01_01-01-3_000001.log'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0/test.2020-01-01_01-01-4_000001.log')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0/test.2020-01-01_01-01-0_000001.log'), PosixPath('/tmp/pytest-...-01_01-01-3_000001.log'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0/test.2020-01-01_01-01-4_000001.log')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention0')
files      = None
seen       = set()
size       = 0

tests/conftest.py:65: AssertionError

test_filesink_delay.py::test_retention_early_remove

test_filesink_delay.py::test_retention_early_remove
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0')

    def test_retention_early_remove(tmp_path):
        for i in range(5):
            tmp_path.joinpath("test.2020-01-01_01-01-%d_000001.log" % i).write_text("test")

        i = logger.add(tmp_path / "test.log", retention=0, delay=True)
        logger.remove(i)

>       check_dir(tmp_path, size=0)

i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0')

tests/test_filesink_delay.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 5 == 0
E            +  where 5 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0/test.2020-01-01_01-01-0_000001.log'), PosixPath(...00001.log'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0/test.2020-01-01_01-01-4_000001.log')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0/test.2020-01-01_01-01-0_000001.log'), PosixPath(...00001.log'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0/test.2020-01-01_01-01-4_000001.log')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_early_remove0')
files      = None
seen       = set()
size       = 0

tests/conftest.py:65: AssertionError

test_filesink_delay.py::test_rotation

test_filesink_delay.py::test_rotation
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation0')
freeze_time = .freeze_time at 0x7fac088ee560>

    def test_rotation(tmp_path, freeze_time):
        with freeze_time("2001-02-03"):
            i = logger.add(tmp_path / "file.log", rotation=0, delay=True, format="{message}")
            logger.debug("a")
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("file.2001-02-03_00-00-00_000000.log", ""),
                ("file.log", "a\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac088ee560>
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation0')

tests/test_filesink_delay.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file.2001-02-03_00-00-00_000000.log', ''), ('file.log', 'a\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation0')
files      = [('file.2001-02-03_00-00-00_000000.log', ''), ('file.log', 'a\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_delay.py::test_rotation_and_retention

test_filesink_delay.py::test_rotation_and_retention
freeze_time = .freeze_time at 0x7fac088efbe0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention0')

    def test_rotation_and_retention(freeze_time, tmp_path):
        with freeze_time("1999-12-12") as frozen:
            filepath = tmp_path / "file.log"
            logger.add(filepath, rotation=30, retention=2, delay=True, format="{message}")
            for i in range(1, 10):
                time.sleep(0.05)  # Retention is based on mtime.
                frozen.tick(datetime.timedelta(seconds=0.05))
                logger.info(str(i) * 20)

>       check_dir(
            tmp_path,
            files=[
                ("file.1999-12-12_00-00-00_350000.log", "7" * 20 + "\n"),
                ("file.1999-12-12_00-00-00_400000.log", "8" * 20 + "\n"),
                ("file.log", "9" * 20 + "\n"),
            ],
        )

filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention0/file.log')
freeze_time = .freeze_time at 0x7fac088efbe0>
frozen     = 
i          = 9
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention0')

tests/test_filesink_delay.py:91: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('file.1999-12-12_00-00-00_350000.log', '77777777777777777777\n'), ('file.1999-12-12_00-00-00_400000.log', '88888888888888888888\n'), ('file.log', '99999999999999999999\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention0')
files      = [('file.1999-12-12_00-00-00_350000.log', '77777777777777777777\n'), ('file.1999-12-12_00-00-00_400000.log', '88888888888888888888\n'), ('file.log', '99999999999999999999\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_delay.py::test_rotation_and_retention_timed_file

test_filesink_delay.py::test_rotation_and_retention_timed_file
freeze_time = .freeze_time at 0x7fac087aca60>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention_ti0')

    def test_rotation_and_retention_timed_file(freeze_time, tmp_path):
        with freeze_time("1999-12-12") as frozen:
            filepath = tmp_path / "file.{time}.log"
            logger.add(filepath, rotation=30, retention=2, delay=True, format="{message}")
            for i in range(1, 10):
                time.sleep(0.05)  # Retention is based on mtime.
                frozen.tick(datetime.timedelta(seconds=0.05))
                logger.info(str(i) * 20)

>       check_dir(
            tmp_path,
            files=[
                ("file.1999-12-12_00-00-00_350000.log", "7" * 20 + "\n"),
                ("file.1999-12-12_00-00-00_400000.log", "8" * 20 + "\n"),
                ("file.1999-12-12_00-00-00_450000.log", "9" * 20 + "\n"),
            ],
        )

filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention_ti0/file.{time}.log')
freeze_time = .freeze_time at 0x7fac087aca60>
frozen     = 
i          = 9
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention_ti0')

tests/test_filesink_delay.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention_ti0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('file.1999-12-12_00-00-00_350000.log', '77777777777777777777\n'), ('file.1999-12-12_00-00-00_400000.log', '88888888888888888888\n'), ('file.1999-12-12_00-00-00_450000.log', '99999999999999999999\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_and_retention_ti0')
files      = [('file.1999-12-12_00-00-00_350000.log', '77777777777777777777\n'), ('file.1999-12-12_00-00-00_400000.log', '88888888888888888888\n'), ('file.1999-12-12_00-00-00_450000.log', '99999999999999999999\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_permissions.py::test_log_file_permissions[511]

test_filesink_permissions.py::test_log_file_permissions[511]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_511_0')
permissions = 511

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_log_file_permissions(tmp_path, permissions):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        filepath = tmp_path / "file.log"
        logger.add(filepath, opener=file_permission_opener)

        logger.debug("Message")
>       stat_result = os.stat(str(filepath))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_log_file_permissions_511_0/file.log'

file_permission_opener = .file_permission_opener at 0x7fac0889ea70>
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_511_0/file.log')
permissions = 511
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_511_0')

tests/test_filesink_permissions.py:25: FileNotFoundError

test_filesink_permissions.py::test_log_file_permissions[502]

test_filesink_permissions.py::test_log_file_permissions[502]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_502_0')
permissions = 502

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_log_file_permissions(tmp_path, permissions):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        filepath = tmp_path / "file.log"
        logger.add(filepath, opener=file_permission_opener)

        logger.debug("Message")
>       stat_result = os.stat(str(filepath))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_log_file_permissions_502_0/file.log'

file_permission_opener = .file_permission_opener at 0x7fac088ef010>
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_502_0/file.log')
permissions = 502
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_502_0')

tests/test_filesink_permissions.py:25: FileNotFoundError

test_filesink_permissions.py::test_log_file_permissions[484]

test_filesink_permissions.py::test_log_file_permissions[484]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_484_0')
permissions = 484

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_log_file_permissions(tmp_path, permissions):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        filepath = tmp_path / "file.log"
        logger.add(filepath, opener=file_permission_opener)

        logger.debug("Message")
>       stat_result = os.stat(str(filepath))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_log_file_permissions_484_0/file.log'

file_permission_opener = .file_permission_opener at 0x7fac087ac4c0>
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_484_0/file.log')
permissions = 484
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_484_0')

tests/test_filesink_permissions.py:25: FileNotFoundError

test_filesink_permissions.py::test_log_file_permissions[448]

test_filesink_permissions.py::test_log_file_permissions[448]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_448_0')
permissions = 448

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_log_file_permissions(tmp_path, permissions):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        filepath = tmp_path / "file.log"
        logger.add(filepath, opener=file_permission_opener)

        logger.debug("Message")
>       stat_result = os.stat(str(filepath))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_log_file_permissions_448_0/file.log'

file_permission_opener = .file_permission_opener at 0x7fac087ac280>
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_448_0/file.log')
permissions = 448
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_448_0')

tests/test_filesink_permissions.py:25: FileNotFoundError

test_filesink_permissions.py::test_log_file_permissions[393]

test_filesink_permissions.py::test_log_file_permissions[393]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_393_0')
permissions = 393

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_log_file_permissions(tmp_path, permissions):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        filepath = tmp_path / "file.log"
        logger.add(filepath, opener=file_permission_opener)

        logger.debug("Message")
>       stat_result = os.stat(str(filepath))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_log_file_permissions_393_0/file.log'

file_permission_opener = .file_permission_opener at 0x7fac087acd30>
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_393_0/file.log')
permissions = 393
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_log_file_permissions_393_0')

tests/test_filesink_permissions.py:25: FileNotFoundError

test_filesink_permissions.py::test_rotation_permissions[511]

test_filesink_permissions.py::test_rotation_permissions[511]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_511_0')
permissions = 511, set_umask = None

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_rotation_permissions(tmp_path, permissions, set_umask):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        logger.add(tmp_path / "file.log", rotation=0, opener=file_permission_opener)

        logger.debug("Message")

        files = list(tmp_path.iterdir())
>       assert len(files) == 2
E       assert 0 == 2
E        +  where 0 = len([])

file_permission_opener = .file_permission_opener at 0x7fac087ad120>
files      = []
permissions = 511
set_umask  = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_511_0')

tests/test_filesink_permissions.py:40: AssertionError

test_filesink_permissions.py::test_rotation_permissions[502]

test_filesink_permissions.py::test_rotation_permissions[502]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_502_0')
permissions = 502, set_umask = None

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_rotation_permissions(tmp_path, permissions, set_umask):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        logger.add(tmp_path / "file.log", rotation=0, opener=file_permission_opener)

        logger.debug("Message")

        files = list(tmp_path.iterdir())
>       assert len(files) == 2
E       assert 0 == 2
E        +  where 0 = len([])

file_permission_opener = .file_permission_opener at 0x7fac087ac1f0>
files      = []
permissions = 502
set_umask  = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_502_0')

tests/test_filesink_permissions.py:40: AssertionError

test_filesink_permissions.py::test_rotation_permissions[484]

test_filesink_permissions.py::test_rotation_permissions[484]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_484_0')
permissions = 484, set_umask = None

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_rotation_permissions(tmp_path, permissions, set_umask):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        logger.add(tmp_path / "file.log", rotation=0, opener=file_permission_opener)

        logger.debug("Message")

        files = list(tmp_path.iterdir())
>       assert len(files) == 2
E       assert 0 == 2
E        +  where 0 = len([])

file_permission_opener = .file_permission_opener at 0x7fac087ad510>
files      = []
permissions = 484
set_umask  = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_484_0')

tests/test_filesink_permissions.py:40: AssertionError

test_filesink_permissions.py::test_rotation_permissions[448]

test_filesink_permissions.py::test_rotation_permissions[448]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_448_0')
permissions = 448, set_umask = None

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_rotation_permissions(tmp_path, permissions, set_umask):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        logger.add(tmp_path / "file.log", rotation=0, opener=file_permission_opener)

        logger.debug("Message")

        files = list(tmp_path.iterdir())
>       assert len(files) == 2
E       assert 0 == 2
E        +  where 0 = len([])

file_permission_opener = .file_permission_opener at 0x7fac087ad1b0>
files      = []
permissions = 448
set_umask  = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_448_0')

tests/test_filesink_permissions.py:40: AssertionError

test_filesink_permissions.py::test_rotation_permissions[393]

test_filesink_permissions.py::test_rotation_permissions[393]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_393_0')
permissions = 393, set_umask = None

    @pytest.mark.parametrize("permissions", [0o777, 0o766, 0o744, 0o700, 0o611])
    def test_rotation_permissions(tmp_path, permissions, set_umask):
        def file_permission_opener(file, flags):
            return os.open(file, flags, permissions)

        logger.add(tmp_path / "file.log", rotation=0, opener=file_permission_opener)

        logger.debug("Message")

        files = list(tmp_path.iterdir())
>       assert len(files) == 2
E       assert 0 == 2
E        +  where 0 = len([])

file_permission_opener = .file_permission_opener at 0x7fac087ad990>
files      = []
permissions = 393
set_umask  = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_permissions_393_0')

tests/test_filesink_permissions.py:40: AssertionError

test_filesink_retention.py::test_retention_time[1 hour]

test_filesink_retention.py::test_retention_time[1 hour]
freeze_time = .freeze_time at 0x7fac087adb40>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1_hour_0')
retention = '1 hour'

    @pytest.mark.parametrize("retention", ["1 hour", "1H", " 1 h ", datetime.timedelta(hours=1)])
    def test_retention_time(freeze_time, tmp_path, retention):
        i = logger.add(tmp_path / "test.log.x", retention=retention)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, size=1)

freeze_time = .freeze_time at 0x7fac087adb40>
i          = None
retention  = '1 hour'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1_hour_0')

tests/test_filesink_retention.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1_hour_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1_hour_0')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_time[1H]

test_filesink_retention.py::test_retention_time[1H]
freeze_time = .freeze_time at 0x7fac087ae4d0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1H_0')
retention = '1H'

    @pytest.mark.parametrize("retention", ["1 hour", "1H", " 1 h ", datetime.timedelta(hours=1)])
    def test_retention_time(freeze_time, tmp_path, retention):
        i = logger.add(tmp_path / "test.log.x", retention=retention)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, size=1)

freeze_time = .freeze_time at 0x7fac087ae4d0>
i          = None
retention  = '1H'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1H_0')

tests/test_filesink_retention.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1H_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_1H_0')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_time[ 1 h ]

test_filesink_retention.py::test_retention_time[ 1 h ]
freeze_time = .freeze_time at 0x7fac087ad900>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time__1_h__0')
retention = ' 1 h '

    @pytest.mark.parametrize("retention", ["1 hour", "1H", " 1 h ", datetime.timedelta(hours=1)])
    def test_retention_time(freeze_time, tmp_path, retention):
        i = logger.add(tmp_path / "test.log.x", retention=retention)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, size=1)

freeze_time = .freeze_time at 0x7fac087ad900>
i          = None
retention  = ' 1 h '
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time__1_h__0')

tests/test_filesink_retention.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time__1_h__0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time__1_h__0')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_time[retention3]

test_filesink_retention.py::test_retention_time[retention3]
freeze_time = .freeze_time at 0x7fac087ae320>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_retention30')
retention = datetime.timedelta(seconds=3600)

    @pytest.mark.parametrize("retention", ["1 hour", "1H", " 1 h ", datetime.timedelta(hours=1)])
    def test_retention_time(freeze_time, tmp_path, retention):
        i = logger.add(tmp_path / "test.log.x", retention=retention)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, size=1)

freeze_time = .freeze_time at 0x7fac087ae320>
i          = None
retention  = datetime.timedelta(seconds=3600)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_retention30')

tests/test_filesink_retention.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_retention30')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_time_retention30')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_function

test_filesink_retention.py::test_retention_function
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0')

    def test_retention_function(tmp_path):
        def func(logs):
            for log in logs:
                os.rename(log, log + ".xyz")

        tmp_path.joinpath("test.log.1").write_text("A")
        tmp_path.joinpath("test").write_text("B")

        i = logger.add(tmp_path / "test.log", retention=func)
        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test.log.1.xyz", "A"),
                ("test", "B"),
                ("test.log.xyz", ""),
            ],
        )

func       = .func at 0x7fac087aea70>
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0')

tests/test_filesink_retention.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 2 == 3
E            +  where 2 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0/test'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0/test.log.1')})
E            +  and   3 = len([('test.log.1.xyz', 'A'), ('test', 'B'), ('test.log.xyz', '')])

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0/test'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0/test.log.1')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_function0')
files      = [('test.log.1.xyz', 'A'), ('test', 'B'), ('test.log.xyz', '')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_retention.py::test_managed_files

test_filesink_retention.py::test_managed_files
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0')

    def test_managed_files(tmp_path):
        others = {
            "test.log",
            "test.log.1",
            "test.log.1.gz",
            "test.log.rar",
            "test.2019-11-12_03-22-07_018985.log",
            "test.2019-11-12_03-22-07_018985.log.tar.gz",
            "test.2019-11-12_03-22-07_018985.2.log",
            "test.2019-11-12_03-22-07_018985.2.log.tar.gz",
            "test.foo.log",
            "test.123.log",
            "test.2019-11-12_03-22-07_018985.abc.log",
            "test.2019-11-12_03-22-07_018985.123.abc.log",
            "test.foo.log.bar",
            "test.log.log",
        }

        for other in others:
            tmp_path.joinpath(other).write_text(other)

        i = logger.add(tmp_path / "test.log", retention=0, catch=False)
        logger.remove(i)

>       check_dir(tmp_path, size=0)

i          = None
other      = 'test.2019-11-12_03-22-07_018985.abc.log'
others     = {'test.123.log', 'test.2019-11-12_03-22-07_018985.123.abc.log', 'test.2019-11-12_03-22-07_018985.2.log', 'test.2019-11-12_03-22-07_018985.2.log.tar.gz', 'test.2019-11-12_03-22-07_018985.abc.log', 'test.2019-11-12_03-22-07_018985.log', ...}
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0')

tests/test_filesink_retention.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 14 == 0
E            +  where 14 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0/test.123.log'), PosixPath('/tmp/pytest-of-root/pytest-0/t...8985.abc.log'), PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0/test.2019-11-12_03-22-07_018985.log'), ...})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0/test.123.log'), PosixPath('/tmp/pytest-of-root/pytest-0/t...8985.abc.log'), PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0/test.2019-11-12_03-22-07_018985.log'), ...}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_managed_files0')
files      = None
seen       = set()
size       = 0

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_no_duplicates_in_listed_files[test]

test_filesink_retention.py::test_no_duplicates_in_listed_files[test]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_duplicates_in_listed_f0')
filename = 'test'

    @pytest.mark.parametrize("filename", ["test", "test.log"])
    def test_no_duplicates_in_listed_files(tmp_path, filename):
        others = [
            "test.log",
            "test.log.log",
            "test.log.log.log",
            "test",
            "test..",
            "test.log..",
            "test..log",
            "test...log",
            "test.log..",
            "test.log.a.log.b",
        ]

        for other in others:
            tmp_path.joinpath(other).write_text(other)

        retention = Mock()
        i = logger.add(tmp_path / filename, retention=retention, catch=False)
        logger.remove(i)

>       assert retention.call_count == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = .call_count

filename   = 'test'
i          = None
other      = 'test.log.a.log.b'
others     = ['test.log', 'test.log.log', 'test.log.log.log', 'test', 'test..', 'test.log..', ...]
retention  = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_duplicates_in_listed_f0')

tests/test_filesink_retention.py:143: AssertionError

test_filesink_retention.py::test_no_duplicates_in_listed_files[test.log]

test_filesink_retention.py::test_no_duplicates_in_listed_files[test.log]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_duplicates_in_listed_f1')
filename = 'test.log'

    @pytest.mark.parametrize("filename", ["test", "test.log"])
    def test_no_duplicates_in_listed_files(tmp_path, filename):
        others = [
            "test.log",
            "test.log.log",
            "test.log.log.log",
            "test",
            "test..",
            "test.log..",
            "test..log",
            "test...log",
            "test.log..",
            "test.log.a.log.b",
        ]

        for other in others:
            tmp_path.joinpath(other).write_text(other)

        retention = Mock()
        i = logger.add(tmp_path / filename, retention=retention, catch=False)
        logger.remove(i)

>       assert retention.call_count == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = .call_count

filename   = 'test.log'
i          = None
other      = 'test.log.a.log.b'
others     = ['test.log', 'test.log.log', 'test.log.log.log', 'test', 'test..', 'test.log..', ...]
retention  = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_duplicates_in_listed_f1')

tests/test_filesink_retention.py:143: AssertionError

test_filesink_retention.py::test_manage_formatted_files

test_filesink_retention.py::test_manage_formatted_files
freeze_time = .freeze_time at 0x7fac087ad900>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files0')

    def test_manage_formatted_files(freeze_time, tmp_path):
        with freeze_time("2018-01-01 00:00:00"):
            f1 = tmp_path / "temp/2018/file.log"
            f2 = tmp_path / "temp/file2018.log"
            f3 = tmp_path / "temp/d2018/f2018.2018.log"

            a = logger.add(tmp_path / "temp/{time:YYYY}/file.log", retention=0)
            b = logger.add(tmp_path / "temp/file{time:YYYY}.log", retention=0)
            c = logger.add(tmp_path / "temp/d{time:YYYY}/f{time:YYYY}.{time:YYYY}.log", retention=0)

            logger.debug("test")

>           assert f1.exists()
E           AssertionError: assert False
E            +  where False = exists()
E            +    where exists = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files0/temp/2018/file.log').exists

a          = None
b          = None
c          = None
f1         = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files0/temp/2018/file.log')
f2         = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files0/temp/file2018.log')
f3         = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files0/temp/d2018/f2018.2018.log')
freeze_time = .freeze_time at 0x7fac087ad900>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files0')

tests/test_filesink_retention.py:171: AssertionError

test_filesink_retention.py::test_manage_file_without_extension

test_filesink_retention.py::test_manage_file_without_extension
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_file_without_exten0')

    def test_manage_file_without_extension(tmp_path):
        file = tmp_path / "file"

        i = logger.add(file, retention=0)
        logger.debug("?")
>       check_dir(tmp_path, files=[("file", None)])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_file_without_exten0/file')
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_file_without_exten0')

tests/test_filesink_retention.py:210: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_file_without_exten0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('file', None)])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_file_without_exten0')
files      = [('file', None)]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_retention.py::test_manage_formatted_files_without_extension

test_filesink_retention.py::test_manage_formatted_files_without_extension
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0')

    def test_manage_formatted_files_without_extension(tmp_path):
        tmp_path.joinpath("file_8").touch()
        tmp_path.joinpath("file_7").touch()
        tmp_path.joinpath("file_6").touch()

        i = logger.add(tmp_path / "file_{time}", retention=0)
        logger.debug("1")
        logger.remove(i)

>       check_dir(tmp_path, size=0)

i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0')

tests/test_filesink_retention.py:224: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 3 == 0
E            +  where 3 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0/file_6'), PosixPath('/tmp/pytest-of-root/pyte..._manage_formatted_files_wi0/file_7'), PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0/file_8')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0/file_6'), PosixPath('/tmp/pytest-of-root/pyte..._manage_formatted_files_wi0/file_7'), PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0/file_8')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_manage_formatted_files_wi0')
files      = None
seen       = set()
size       = 0

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_rotation[a]

test_filesink_retention.py::test_retention_at_rotation[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0')
mode = 'a'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_rotation(tmp_path, mode):
        tmp_path.joinpath("test.log.1").touch()
        tmp_path.joinpath("test.log.2").touch()
        tmp_path.joinpath("test.log.3").touch()

        logger.add(tmp_path / "test.log", retention=1, rotation=0, mode=mode)
        logger.debug("test")

>       check_dir(tmp_path, size=2)

mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0')

tests/test_filesink_retention.py:236: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 3 == 2
E            +  where 3 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0/test.log.1'), PosixPath('/tmp/pytest-of-root/p...tion_at_rotation_a_0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0/test.log.3')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0/test.log.1'), PosixPath('/tmp/pytest-of-root/p...tion_at_rotation_a_0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0/test.log.3')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a_0')
files      = None
seen       = set()
size       = 2

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_rotation[a+]

test_filesink_retention.py::test_retention_at_rotation[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0')
mode = 'a+'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_rotation(tmp_path, mode):
        tmp_path.joinpath("test.log.1").touch()
        tmp_path.joinpath("test.log.2").touch()
        tmp_path.joinpath("test.log.3").touch()

        logger.add(tmp_path / "test.log", retention=1, rotation=0, mode=mode)
        logger.debug("test")

>       check_dir(tmp_path, size=2)

mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0')

tests/test_filesink_retention.py:236: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 3 == 2
E            +  where 3 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0/test.log.1'), PosixPath('/tmp/pytest-of-root/...on_at_rotation_a__0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0/test.log.3')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0/test.log.1'), PosixPath('/tmp/pytest-of-root/...on_at_rotation_a__0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0/test.log.3')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_a__0')
files      = None
seen       = set()
size       = 2

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_rotation[w]

test_filesink_retention.py::test_retention_at_rotation[w]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0')
mode = 'w'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_rotation(tmp_path, mode):
        tmp_path.joinpath("test.log.1").touch()
        tmp_path.joinpath("test.log.2").touch()
        tmp_path.joinpath("test.log.3").touch()

        logger.add(tmp_path / "test.log", retention=1, rotation=0, mode=mode)
        logger.debug("test")

>       check_dir(tmp_path, size=2)

mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0')

tests/test_filesink_retention.py:236: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 3 == 2
E            +  where 3 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0/test.log.1'), PosixPath('/tmp/pytest-of-root/p...tion_at_rotation_w_0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0/test.log.3')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0/test.log.1'), PosixPath('/tmp/pytest-of-root/p...tion_at_rotation_w_0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0/test.log.3')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_w_0')
files      = None
seen       = set()
size       = 2

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_rotation[x]

test_filesink_retention.py::test_retention_at_rotation[x]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0')
mode = 'x'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_rotation(tmp_path, mode):
        tmp_path.joinpath("test.log.1").touch()
        tmp_path.joinpath("test.log.2").touch()
        tmp_path.joinpath("test.log.3").touch()

        logger.add(tmp_path / "test.log", retention=1, rotation=0, mode=mode)
        logger.debug("test")

>       check_dir(tmp_path, size=2)

mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0')

tests/test_filesink_retention.py:236: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           AssertionError: assert 3 == 2
E            +  where 3 = len({PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0/test.log.1'), PosixPath('/tmp/pytest-of-root/p...tion_at_rotation_x_0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0/test.log.3')})

actual_files = {PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0/test.log.1'), PosixPath('/tmp/pytest-of-root/p...tion_at_rotation_x_0/test.log.2'), PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0/test.log.3')}
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_rotation_x_0')
files      = None
seen       = set()
size       = 2

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_remove_without_rotation[a]

test_filesink_retention.py::test_retention_at_remove_without_rotation[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho0')
mode = 'a'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho0')

tests/test_filesink_retention.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho0')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_remove_without_rotation[a+]

test_filesink_retention.py::test_retention_at_remove_without_rotation[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho1')
mode = 'a+'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho1')

tests/test_filesink_retention.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho1')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_remove_without_rotation[w]

test_filesink_retention.py::test_retention_at_remove_without_rotation[w]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho2')
mode = 'w'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho2')

tests/test_filesink_retention.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho2')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_retention_at_remove_without_rotation[x]

test_filesink_retention.py::test_retention_at_remove_without_rotation[x]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho3')
mode = 'x'

    @pytest.mark.parametrize("mode", ["a", "a+", "w", "x"])
    def test_retention_at_remove_without_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho3')

tests/test_filesink_retention.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_retention_at_remove_witho3')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[w]

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[w]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi0')
mode = 'w'

    @pytest.mark.parametrize("mode", ["w", "x", "a", "a+"])
    def test_no_retention_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, rotation="100 MB", mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi0')

tests/test_filesink_retention.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi0')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[x]

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[x]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi1')
mode = 'x'

    @pytest.mark.parametrize("mode", ["w", "x", "a", "a+"])
    def test_no_retention_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, rotation="100 MB", mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi1')

tests/test_filesink_retention.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi1')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[a]

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi2')
mode = 'a'

    @pytest.mark.parametrize("mode", ["w", "x", "a", "a+"])
    def test_no_retention_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, rotation="100 MB", mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi2')

tests/test_filesink_retention.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi2')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[a+]

test_filesink_retention.py::test_no_retention_at_remove_with_rotation[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi3')
mode = 'a+'

    @pytest.mark.parametrize("mode", ["w", "x", "a", "a+"])
    def test_no_retention_at_remove_with_rotation(tmp_path, mode):
        i = logger.add(tmp_path / "file.log", retention=0, rotation="100 MB", mode=mode)
        logger.debug("1")
>       check_dir(tmp_path, size=1)

i          = None
mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi3')

tests/test_filesink_retention.py:252: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_retention_at_remove_wi3')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_retention.py::test_no_renaming

test_filesink_retention.py::test_no_renaming
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming0')

    def test_no_renaming(tmp_path):
        i = logger.add(tmp_path / "test.log", format="{message}", retention=10)
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", "test\n")])

i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming0')

tests/test_filesink_retention.py:262: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', 'test\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming0')
files      = [('test.log', 'test\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_retention.py::test_exception_during_retention_at_rotation[True]

test_filesink_retention.py::test_exception_during_retention_at_rotation[True]
freeze_time = .freeze_time at 0x7fac087ac5e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio0')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0885c5e0>, delay = True

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_retention_at_rotation(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2022-02-22") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                retention=Mock(side_effect=[Exception("Retention error"), None]),
                rotation=0,
                catch=True,
                delay=delay,
            )
            logger.debug("AAA")
            frozen.tick()
            logger.debug("BBB")

>       check_dir(
            tmp_path,
            files=[
                ("test.2022-02-22_00-00-00_000000.log", ""),
                ("test.2022-02-22_00-00-01_000000.log", ""),
                ("test.log", "BBB\n"),
            ],
        )

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0885c5e0>
delay      = True
freeze_time = .freeze_time at 0x7fac087ac5e0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio0')

tests/test_filesink_retention.py:280: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test.2022-02-22_00-00-00_000000.log', ''), ('test.2022-02-22_00-00-01_000000.log', ''), ('test.log', 'BBB\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio0')
files      = [('test.2022-02-22_00-00-00_000000.log', ''), ('test.2022-02-22_00-00-01_000000.log', ''), ('test.log', 'BBB\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_retention.py::test_exception_during_retention_at_rotation[False]

test_filesink_retention.py::test_exception_during_retention_at_rotation[False]
freeze_time = .freeze_time at 0x7fac087afa30>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio1')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08733bb0>
delay = False

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_retention_at_rotation(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2022-02-22") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                retention=Mock(side_effect=[Exception("Retention error"), None]),
                rotation=0,
                catch=True,
                delay=delay,
            )
            logger.debug("AAA")
            frozen.tick()
            logger.debug("BBB")

>       check_dir(
            tmp_path,
            files=[
                ("test.2022-02-22_00-00-00_000000.log", ""),
                ("test.2022-02-22_00-00-01_000000.log", ""),
                ("test.log", "BBB\n"),
            ],
        )

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08733bb0>
delay      = False
freeze_time = .freeze_time at 0x7fac087afa30>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio1')

tests/test_filesink_retention.py:280: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test.2022-02-22_00-00-00_000000.log', ''), ('test.2022-02-22_00-00-01_000000.log', ''), ('test.log', 'BBB\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio1')
files      = [('test.2022-02-22_00-00-00_000000.log', ''), ('test.2022-02-22_00-00-01_000000.log', ''), ('test.log', 'BBB\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_retention.py::test_exception_during_retention_at_rotation_not_caught[True]

test_filesink_retention.py::test_exception_during_retention_at_rotation_not_caught[True]
freeze_time = .freeze_time at 0x7fac087afd00>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio2')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac093113c0>, delay = True

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_retention_at_rotation_not_caught(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2022-02-22") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                retention=Mock(side_effect=[OSError("Retention error"), None]),
                rotation=0,
                catch=False,
                delay=delay,
            )
>           with pytest.raises(OSError, match=r"Retention error"):
E           Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac093113c0>
delay      = True
freeze_time = .freeze_time at 0x7fac087afd00>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio2')

tests/test_filesink_retention.py:306: Failed

test_filesink_retention.py::test_exception_during_retention_at_rotation_not_caught[False]

test_filesink_retention.py::test_exception_during_retention_at_rotation_not_caught[False]
freeze_time = .freeze_time at 0x7fac083b41f0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio3')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08707850>
delay = False

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_retention_at_rotation_not_caught(freeze_time, tmp_path, capsys, delay):
        with freeze_time("2022-02-22") as frozen:
            logger.add(
                tmp_path / "test.log",
                format="{message}",
                retention=Mock(side_effect=[OSError("Retention error"), None]),
                rotation=0,
                catch=False,
                delay=delay,
            )
>           with pytest.raises(OSError, match=r"Retention error"):
E           Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08707850>
delay      = False
freeze_time = .freeze_time at 0x7fac083b41f0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio3')

tests/test_filesink_retention.py:306: Failed

test_filesink_retention.py::test_exception_during_retention_at_remove[True]

test_filesink_retention.py::test_exception_during_retention_at_remove[True]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio4')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09311630>, delay = True

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_retention_at_remove(tmp_path, capsys, delay):
        i = logger.add(
            tmp_path / "test.log",
            format="{message}",
            retention=Mock(side_effect=[OSError("Retention error"), None]),
            catch=False,
            delay=delay,
        )
        logger.debug("AAA")

>       with pytest.raises(OSError, match=r"Retention error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09311630>
delay      = True
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio4')

tests/test_filesink_retention.py:335: Failed

test_filesink_retention.py::test_exception_during_retention_at_remove[False]

test_filesink_retention.py::test_exception_during_retention_at_remove[False]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio5')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac088e90f0>
delay = False

    @pytest.mark.parametrize("delay", [True, False])
    def test_exception_during_retention_at_remove(tmp_path, capsys, delay):
        i = logger.add(
            tmp_path / "test.log",
            format="{message}",
            retention=Mock(side_effect=[OSError("Retention error"), None]),
            catch=False,
            delay=delay,
        )
        logger.debug("AAA")

>       with pytest.raises(OSError, match=r"Retention error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac088e90f0>
delay      = False
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_retentio5')

tests/test_filesink_retention.py:335: Failed

test_filesink_retention.py::test_invalid_retention[retention0]

test_filesink_retention.py::test_invalid_retention[retention0]
retention = datetime.time(12, 12, 12)

    @pytest.mark.parametrize("retention", [datetime.time(12, 12, 12), os, object()])
    def test_invalid_retention(retention):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

retention  = datetime.time(12, 12, 12)

tests/test_filesink_retention.py:348: Failed

test_filesink_retention.py::test_invalid_retention[os]

test_filesink_retention.py::test_invalid_retention[os]
retention = 

    @pytest.mark.parametrize("retention", [datetime.time(12, 12, 12), os, object()])
    def test_invalid_retention(retention):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

retention  = 

tests/test_filesink_retention.py:348: Failed

test_filesink_retention.py::test_invalid_retention[retention2]

test_filesink_retention.py::test_invalid_retention[retention2]
retention = 

    @pytest.mark.parametrize("retention", [datetime.time(12, 12, 12), os, object()])
    def test_invalid_retention(retention):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

retention  = 

tests/test_filesink_retention.py:348: Failed


test_filesink_retention.py::test_unkown_retention[W5]

test_filesink_retention.py::test_unkown_retention[W5]
retention = 'W5'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = 'W5'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[monday at 14:00]

test_filesink_retention.py::test_unkown_retention[monday at 14:00]
retention = 'monday at 14:00'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = 'monday at 14:00'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[sunday]

test_filesink_retention.py::test_unkown_retention[sunday]
retention = 'sunday'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = 'sunday'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[nope]

test_filesink_retention.py::test_unkown_retention[nope]
retention = 'nope'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = 'nope'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[5 MB]

test_filesink_retention.py::test_unkown_retention[5 MB]
retention = '5 MB'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = '5 MB'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[3 hours 2 dayz]

test_filesink_retention.py::test_unkown_retention[3 hours 2 dayz]
retention = '3 hours 2 dayz'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = '3 hours 2 dayz'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[d]

test_filesink_retention.py::test_unkown_retention[d]
retention = 'd'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = 'd'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[H]

test_filesink_retention.py::test_unkown_retention[H]
retention = 'H'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = 'H'

tests/test_filesink_retention.py:357: Failed

test_filesink_retention.py::test_unkown_retention[dict]

test_filesink_retention.py::test_unkown_retention[__dict__]
retention = '__dict__'

    @pytest.mark.parametrize(
        "retention",
        ["W5", "monday at 14:00", "sunday", "nope", "5 MB", "3 hours 2 dayz", "d", "H", "__dict__"],
    )
    def test_unkown_retention(retention):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

retention  = '__dict__'

tests/test_filesink_retention.py:357: Failed

test_filesink_rotation.py::test_renaming

test_filesink_rotation.py::test_renaming
freeze_time = .freeze_time at 0x7fac087add80>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming0')

    def test_renaming(freeze_time, tmp_path):
        with freeze_time("2020-01-01") as frozen:
            logger.add(tmp_path / "file.log", rotation=0, format="{message}")

            frozen.tick()
            logger.debug("a")

>           check_dir(
                tmp_path,
                files=[
                    ("file.2020-01-01_00-00-00_000000.log", ""),
                    ("file.log", "a\n"),
                ],
            )

freeze_time = .freeze_time at 0x7fac087add80>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming0')

tests/test_filesink_rotation.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file.2020-01-01_00-00-00_000000.log', ''), ('file.log', 'a\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming0')
files      = [('file.2020-01-01_00-00-00_000000.log', ''), ('file.log', 'a\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_no_renaming

test_filesink_rotation.py::test_no_renaming
freeze_time = .freeze_time at 0x7fac083b5870>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming1')

    def test_no_renaming(freeze_time, tmp_path):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            logger.add(tmp_path / "file_{time}.log", rotation=0, format="{message}")

            frozen.move_to("2019-01-01 00:00:00")
            logger.debug("a")
>           check_dir(
                tmp_path,
                files=[
                    ("file_2018-01-01_00-00-00_000000.log", ""),
                    ("file_2019-01-01_00-00-00_000000.log", "a\n"),
                ],
            )

freeze_time = .freeze_time at 0x7fac083b5870>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming1')

tests/test_filesink_rotation.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('file_2018-01-01_00-00-00_000000.log', ''), ('file_2019-01-01_00-00-00_000000.log', 'a\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_renaming1')
files      = [('file_2018-01-01_00-00-00_000000.log', ''), ('file_2019-01-01_00-00-00_000000.log', 'a\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[8]

test_filesink_rotation.py::test_size_rotation[8]
freeze_time = .freeze_time at 0x7fac083b5c60>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0')
size = 8

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b5c60>
frozen     = 
i          = None
size       = 8
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[8.0]

test_filesink_rotation.py::test_size_rotation[8.0]
freeze_time = .freeze_time at 0x7fac083b6050>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0_0')
size = 8.0

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6050>
frozen     = 
i          = None
size       = 8.0
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_0_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[7.99]

test_filesink_rotation.py::test_size_rotation[7.99]
freeze_time = .freeze_time at 0x7fac083b6440>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_7_99_0')
size = 7.99

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6440>
frozen     = 
i          = None
size       = 7.99
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_7_99_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_7_99_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_7_99_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[8 B]

test_filesink_rotation.py::test_size_rotation[8 B]
freeze_time = .freeze_time at 0x7fac083b6950>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_B_0')
size = '8 B'

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6950>
frozen     = 
i          = None
size       = '8 B'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_B_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_B_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8_B_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[8e-6MB]

test_filesink_rotation.py::test_size_rotation[8e-6MB]
freeze_time = .freeze_time at 0x7fac083b6d40>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8e_6MB_0')
size = '8e-6MB'

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6d40>
frozen     = 
i          = None
size       = '8e-6MB'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8e_6MB_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8e_6MB_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_8e_6MB_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[0.008 kiB]

test_filesink_rotation.py::test_size_rotation[0.008 kiB]
freeze_time = .freeze_time at 0x7fac087aea70>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_0_008_kiB_0')
size = '0.008 kiB'

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac087aea70>
frozen     = 
i          = None
size       = '0.008 kiB'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_0_008_kiB_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_0_008_kiB_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_0_008_kiB_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_size_rotation[64b]

test_filesink_rotation.py::test_size_rotation[64b]
freeze_time = .freeze_time at 0x7fac083b6f80>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_64b_0')
size = '64b'

    @pytest.mark.parametrize("size", [8, 8.0, 7.99, "8 B", "8e-6MB", "0.008 kiB", "64b"])
    def test_size_rotation(freeze_time, tmp_path, size):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=size, mode="w")

            frozen.tick()
            logger.debug("abcde")

            frozen.tick()
            logger.debug("fghij")

            frozen.tick()
            logger.debug("klmno")

            frozen.tick()
            logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-01-01_00-00-00_000000.log", "abcde\n"),
                ("test_2018-01-01_00-00-02_000000.log", "fghij\n"),
                ("test_2018-01-01_00-00-03_000000.log", "klmno\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6f80>
frozen     = 
i          = None
size       = '64b'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_64b_0')

tests/test_filesink_rotation.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_64b_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_size_rotation_64b_0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'abcde\n'), ('test_2018-01-01_00-00-02_000000.log', 'fghij\n'), ('test_2018-01-01_00-00-03_000000.log', 'klmno\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation[13-hours0]

test_filesink_rotation.py::test_time_rotation[13-hours0]
freeze_time = .freeze_time at 0x7fac083b7400>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_hours0_0')
when = '13', hours = [0, 1, 20, 4, 24]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7400>
frozen     = 
h          = 24
hours      = [0, 1, 20, 4, 24]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_hours0_0')
when       = '13'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[13:00-hours1]

test_filesink_rotation.py::test_time_rotation[13:00-hours1]
freeze_time = .freeze_time at 0x7fac083b7760>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_00_hours0')
when = '13:00', hours = [0.2, 0.9, 23, 1, 48]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7760>
frozen     = 
h          = 48
hours      = [0.2, 0.9, 23, 1, 48]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_00_hours0')
when       = '13:00'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[13:00:00-hours2]

test_filesink_rotation.py::test_time_rotation[13:00:00-hours2]
freeze_time = .freeze_time at 0x7fac083b7ac0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_00_00_ho0')
when = '13:00:00', hours = [0.5, 1.5, 10, 15, 72]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7ac0>
frozen     = 
h          = 72
hours      = [0.5, 1.5, 10, 15, 72]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_00_00_ho0')
when       = '13:00:00'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[13:00:00.123456-hours3]

test_filesink_rotation.py::test_time_rotation[13:00:00.123456-hours3]
freeze_time = .freeze_time at 0x7fac083b7e20>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_00_00_120')
when = '13:00:00.123456', hours = [0.9, 2, 10, 15, 256]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7e20>
frozen     = 
h          = 256
hours      = [0.9, 2, 10, 15, 256]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_13_00_00_120')
when       = '13:00:00.123456'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[11:00-hours4]

test_filesink_rotation.py::test_time_rotation[11:00-hours4]
freeze_time = .freeze_time at 0x7fac083b6830>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_11_00_hours0')
when = '11:00', hours = [22.9, 0.2, 23, 1, 24]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6830>
frozen     = 
h          = 24
hours      = [22.9, 0.2, 23, 1, 24]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_11_00_hours0')
when       = '11:00'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[w0-hours5]

test_filesink_rotation.py::test_time_rotation[w0-hours5]
freeze_time = .freeze_time at 0x7fac083b6050>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_w0_hours5_0')
when = 'w0', hours = [11, 1, 167, 1, 168]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6050>
frozen     = 
h          = 168
hours      = [11, 1, 167, 1, 168]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_w0_hours5_0')
when       = 'w0'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[W0 at 00:00-hours6]

test_filesink_rotation.py::test_time_rotation[W0 at 00:00-hours6]
freeze_time = .freeze_time at 0x7fac087afb50>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_W0_at_00_000')
when = 'W0 at 00:00', hours = [10, 163, 0.1, 720, 336]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac087afb50>
frozen     = 
h          = 336
hours      = [10, 163, 0.1, 720, 336]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_W0_at_00_000')
when       = 'W0 at 00:00'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[W6-hours7]

test_filesink_rotation.py::test_time_rotation[W6-hours7]
freeze_time = .freeze_time at 0x7fac083b5c60>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_W6_hours7_0')
when = 'W6', hours = [24, 672, 120, 24, 8736]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b5c60>
frozen     = 
h          = 8736
hours      = [24, 672, 120, 24, 8736]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_W6_hours7_0')
when       = 'W6'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[saturday-hours8]

test_filesink_rotation.py::test_time_rotation[saturday-hours8]
freeze_time = .freeze_time at 0x7fac083b5750>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_saturday_ho0')
when = 'saturday', hours = [25, 300, 0, 300, 192]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b5750>
frozen     = 
h          = 192
hours      = [25, 300, 0, 300, 192]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_saturday_ho0')
when       = 'saturday'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[w6 at 00-hours9]

test_filesink_rotation.py::test_time_rotation[w6 at 00-hours9]
freeze_time = .freeze_time at 0x7fac083b7c70>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_w6_at_00_ho0')
when = 'w6 at 00', hours = [8, 168, 144, 24, 192]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7c70>
frozen     = 
h          = 192
hours      = [8, 168, 144, 24, 192]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_w6_at_00_ho0')
when       = 'w6 at 00'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[ W6 at 13 -hours10]

test_filesink_rotation.py::test_time_rotation[ W6 at 13 -hours10]
freeze_time = .freeze_time at 0x7fac083b7d90>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation__W6_at_13__0')
when = ' W6 at 13 ', hours = [0.5, 1, 144, 144, 8760]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7d90>
frozen     = 
h          = 8760
hours      = [0.5, 1, 144, 144, 8760]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation__W6_at_13__0')
when       = ' W6 at 13 '

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[w2 at 11:00:00 AM-hours11]

test_filesink_rotation.py::test_time_rotation[w2  at  11:00:00 AM-hours11]
freeze_time = .freeze_time at 0x7fac083b7760>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_w2__at__11_0')
when = 'w2  at  11:00:00 AM', hours = [70, 3, 144, 24, 8784]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7760>
frozen     = 
h          = 8784
hours      = [70, 3, 144, 24, 8784]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_w2__at__11_0')
when       = 'w2  at  11:00:00 AM'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[MoNdAy at 11:00:30.123-hours12]

test_filesink_rotation.py::test_time_rotation[MoNdAy at 11:00:30.123-hours12]
freeze_time = .freeze_time at 0x7fac083b7250>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_MoNdAy_at_10')
when = 'MoNdAy at 11:00:30.123', hours = [22, 24, 24, 168, 168]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7250>
frozen     = 
h          = 168
hours      = [22, 24, 24, 168, 168]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_MoNdAy_at_10')
when       = 'MoNdAy at 11:00:30.123'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[sunday-hours13]

test_filesink_rotation.py::test_time_rotation[sunday-hours13]
freeze_time = .freeze_time at 0x7fac083b6cb0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_sunday_hour0')
when = 'sunday', hours = [0.1, 158, 24, 144, 168]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6cb0>
frozen     = 
h          = 168
hours      = [0.1, 158, 24, 144, 168]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_sunday_hour0')
when       = 'sunday'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[SUNDAY at 11:00-hours14]

test_filesink_rotation.py::test_time_rotation[SUNDAY at 11:00-hours14]
freeze_time = .freeze_time at 0x7fac083b6f80>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_SUNDAY_at_10')
when = 'SUNDAY at 11:00', hours = [1, 168, 2, 168, 360]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6f80>
frozen     = 
h          = 360
hours      = [1, 168, 2, 168, 360]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_SUNDAY_at_10')
when       = 'SUNDAY at 11:00'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[sunDAY at 1:0:0.0 pm-hours15]

test_filesink_rotation.py::test_time_rotation[sunDAY at 1:0:0.0 pm-hours15]
freeze_time = .freeze_time at 0x7fac083b7520>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_sunDAY_at_11')
when = 'sunDAY at 1:0:0.0 pm', hours = [0.9, 0.2, 166, 3, 192]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7520>
frozen     = 
h          = 192
hours      = [0.9, 0.2, 166, 3, 192]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_sunDAY_at_11')
when       = 'sunDAY at 1:0:0.0 pm'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[when16-hours16]

test_filesink_rotation.py::test_time_rotation[when16-hours16]
freeze_time = .freeze_time at 0x7fac083b56c0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when16_hour0')
when = datetime.time(15, 0), hours = [2, 3, 19, 5, 24]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b56c0>
frozen     = 
h          = 24
hours      = [2, 3, 19, 5, 24]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when16_hour0')
when       = datetime.time(15, 0)

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[when17-hours17]

test_filesink_rotation.py::test_time_rotation[when17-hours17]
freeze_time = .freeze_time at 0x7fac083b7490>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when17_hour0')
when = datetime.time(18, 30, 11, 123), hours = [1, 5.51, 20, 24, 40]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7490>
frozen     = 
h          = 40
hours      = [1, 5.51, 20, 24, 40]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when17_hour0')
when       = datetime.time(18, 30, 11, 123)

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[2 h-hours18]

test_filesink_rotation.py::test_time_rotation[2 h-hours18]
freeze_time = .freeze_time at 0x7fac083b6320>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_2_h_hours180')
when = '2 h', hours = [1, 2, 0.9, 0.5, 10]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6320>
frozen     = 
h          = 10
hours      = [1, 2, 0.9, 0.5, 10]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_2_h_hours180')
when       = '2 h'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[1 hour-hours19]

test_filesink_rotation.py::test_time_rotation[1 hour-hours19]
freeze_time = .freeze_time at 0x7fac083b5c60>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_hour_hour0')
when = '1 hour', hours = [0.5, 1, 0.1, 100, 1000]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b5c60>
frozen     = 
h          = 1000
hours      = [0.5, 1, 0.1, 100, 1000]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_hour_hour0')
when       = '1 hour'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[7 days-hours20]

test_filesink_rotation.py::test_time_rotation[7 days-hours20]
freeze_time = .freeze_time at 0x7fac083b7b50>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_7_days_hour0')
when = '7 days', hours = [167, 1, 48, 240, 8760]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7b50>
frozen     = 
h          = 8760
hours      = [167, 1, 48, 240, 8760]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_7_days_hour0')
when       = '7 days'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[1h 30 minutes-hours21]

test_filesink_rotation.py::test_time_rotation[1h 30 minutes-hours21]
freeze_time = .freeze_time at 0x7fac083b7f40>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1h_30_minut0')
when = '1h 30 minutes', hours = [1.4, 0.2, 1, 2, 10]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7f40>
frozen     = 
h          = 10
hours      = [1.4, 0.2, 1, 2, 10]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1h_30_minut0')
when       = '1h 30 minutes'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[1 w, 2D-hours22]

test_filesink_rotation.py::test_time_rotation[1 w, 2D-hours22]
freeze_time = .freeze_time at 0x7fac083b5e10>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_w__2D_hou0')
when = '1 w, 2D', hours = [192, 48, 24, 216, 216]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b5e10>
frozen     = 
h          = 216
hours      = [192, 48, 24, 216, 216]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_w__2D_hou0')
when       = '1 w, 2D'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[1.5d-hours23]

test_filesink_rotation.py::test_time_rotation[1.5d-hours23]
freeze_time = .freeze_time at 0x7fac083b6050>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_5d_hours20')
when = '1.5d', hours = [30, 10, 0.9, 48, 35]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6050>
frozen     = 
h          = 35
hours      = [30, 10, 0.9, 48, 35]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_5d_hours20')
when       = '1.5d'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[1.222 hours, 3.44s-hours24]

test_filesink_rotation.py::test_time_rotation[1.222 hours, 3.44s-hours24]
freeze_time = .freeze_time at 0x7fac083b6320>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_222_hours0')
when = '1.222 hours, 3.44s', hours = [1.222, 0.1, 1, 1.2, 2]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6320>
frozen     = 
h          = 2
hours      = [1.222, 0.1, 1, 1.2, 2]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_1_222_hours0')
when       = '1.222 hours, 3.44s'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[when25-hours25]

test_filesink_rotation.py::test_time_rotation[when25-hours25]
freeze_time = .freeze_time at 0x7fac083b79a0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when25_hour0')
when = datetime.timedelta(seconds=3600), hours = [0.9, 0.2, 0.7, 0.5, 3]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b79a0>
frozen     = 
h          = 3
hours      = [0.9, 0.2, 0.7, 0.5, 3]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when25_hour0')
when       = datetime.timedelta(seconds=3600)

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[when26-hours26]

test_filesink_rotation.py::test_time_rotation[when26-hours26]
freeze_time = .freeze_time at 0x7fac083b69e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when26_hour0')
when = datetime.timedelta(seconds=1800), hours = [0.48, 0.04, 0.07, 0.44, 0.5]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b69e0>
frozen     = 
h          = 0.5
hours      = [0.48, 0.04, 0.07, 0.44, 0.5]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when26_hour0')
when       = datetime.timedelta(seconds=1800)

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[hourly-hours27]

test_filesink_rotation.py::test_time_rotation[hourly-hours27]
freeze_time = .freeze_time at 0x7fac083b6b00>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_hourly_hour0')
when = 'hourly', hours = [0.9, 0.2, 0.8, 3, 1]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6b00>
frozen     = 
h          = 1
hours      = [0.9, 0.2, 0.8, 3, 1]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_hourly_hour0')
when       = 'hourly'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[daily-hours28]

test_filesink_rotation.py::test_time_rotation[daily-hours28]
freeze_time = .freeze_time at 0x7fac083b7d00>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_daily_hours0')
when = 'daily', hours = [11, 1, 23, 1, 24]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b7d00>
frozen     = 
h          = 24
hours      = [11, 1, 23, 1, 24]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_daily_hours0')
when       = 'daily'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[WEEKLY-hours29]

test_filesink_rotation.py::test_time_rotation[WEEKLY-hours29]
freeze_time = .freeze_time at 0x7fac083843a0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_WEEKLY_hour0')
when = 'WEEKLY', hours = [11, 2, 144, 24, 168]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083843a0>
frozen     = 
h          = 168
hours      = [11, 2, 144, 24, 168]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_WEEKLY_hour0')
when       = 'WEEKLY'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[mOnthLY-hours30]

test_filesink_rotation.py::test_time_rotation[mOnthLY-hours30]
freeze_time = .freeze_time at 0x7fac08384790>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_mOnthLY_hou0')
when = 'mOnthLY', hours = [0, 312, 696, 1440, 840]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac08384790>
frozen     = 
h          = 840
hours      = [0, 312, 696, 1440, 840]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_mOnthLY_hou0')
when       = 'mOnthLY'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[monthly-hours31]

test_filesink_rotation.py::test_time_rotation[monthly-hours31]
freeze_time = .freeze_time at 0x7fac083b6cb0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_monthly_hou1')
when = 'monthly', hours = [240, 4320, 24, 168, 744]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b6cb0>
frozen     = 
h          = 744
hours      = [240, 4320, 24, 168, 744]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_monthly_hou1')
when       = 'monthly'

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation[Yearly -hours32]

test_filesink_rotation.py::test_time_rotation[Yearly -hours32]
freeze_time = .freeze_time at 0x7fac083b75b0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_Yearly__hou0')
when = 'Yearly ', hours = [100, 5040, 7200, 2400, 9600]

    @pytest.mark.parametrize(
        "when, hours",
        [
            # hours = [
            #   Should not trigger, should trigger, should not trigger, should trigger, should trigger
            # ]
            ("13", [0, 1, 20, 4, 24]),
            ("13:00", [0.2, 0.9, 23, 1, 48]),
            ("13:00:00", [0.5, 1.5, 10, 15, 72]),
            ("13:00:00.123456", [0.9, 2, 10, 15, 256]),
            ("11:00", [22.9, 0.2, 23, 1, 24]),
            ("w0", [11, 1, 24 * 7 - 1, 1, 24 * 7]),
            ("W0 at 00:00", [10, 24 * 7 - 5, 0.1, 24 * 30, 24 * 14]),
            ("W6", [24, 24 * 28, 24 * 5, 24, 364 * 24]),
            ("saturday", [25, 25 * 12, 0, 25 * 12, 24 * 8]),
            ("w6 at 00", [8, 24 * 7, 24 * 6, 24, 24 * 8]),
            (" W6 at 13 ", [0.5, 1, 24 * 6, 24 * 6, 365 * 24]),
            ("w2  at  11:00:00 AM", [48 + 22, 3, 24 * 6, 24, 366 * 24]),
            ("MoNdAy at 11:00:30.123", [22, 24, 24, 24 * 7, 24 * 7]),
            ("sunday", [0.1, 24 * 7 - 10, 24, 24 * 6, 24 * 7]),
            ("SUNDAY at 11:00", [1, 24 * 7, 2, 24 * 7, 30 * 12]),
            ("sunDAY at 1:0:0.0 pm", [0.9, 0.2, 24 * 7 - 2, 3, 24 * 8]),
            (datetime.time(15), [2, 3, 19, 5, 24]),
            (datetime.time(18, 30, 11, 123), [1, 5.51, 20, 24, 40]),
            ("2 h", [1, 2, 0.9, 0.5, 10]),
            ("1 hour", [0.5, 1, 0.1, 100, 1000]),
            ("7 days", [24 * 7 - 1, 1, 48, 24 * 10, 24 * 365]),
            ("1h 30 minutes", [1.4, 0.2, 1, 2, 10]),
            ("1 w, 2D", [24 * 8, 24 * 2, 24, 24 * 9, 24 * 9]),
            ("1.5d", [30, 10, 0.9, 48, 35]),
            ("1.222 hours, 3.44s", [1.222, 0.1, 1, 1.2, 2]),
            (datetime.timedelta(hours=1), [0.9, 0.2, 0.7, 0.5, 3]),
            (datetime.timedelta(minutes=30), [0.48, 0.04, 0.07, 0.44, 0.5]),
            ("hourly", [0.9, 0.2, 0.8, 3, 1]),
            ("daily", [11, 1, 23, 1, 24]),
            ("WEEKLY", [11, 2, 24 * 6, 24, 24 * 7]),
            ("mOnthLY", [0, 24 * 13, 29 * 24, 60 * 24, 24 * 35]),
            ("monthly", [10 * 24, 30 * 24 * 6, 24, 24 * 7, 24 * 31]),
            ("Yearly ", [100, 24 * 7 * 30, 24 * 300, 24 * 100, 24 * 400]),
        ],
    )
    def test_time_rotation(freeze_time, tmp_path, when, hours):
        with freeze_time("2017-06-18 12:00:00") as frozen:  # Sunday
            i = logger.add(
                tmp_path / "test_{time}.log",
                format="{message}",
                rotation=when,
                mode="w",
            )

            for h, m in zip(hours, ["a", "b", "c", "d", "e"]):
                frozen.tick(delta=datetime.timedelta(hours=h))
                logger.debug(m)

            logger.remove(i)

        content = [path.read_text() for path in sorted(tmp_path.iterdir())]
>       assert content == ["a\n", "b\nc\n", "d\n", "e\n"]
E       AssertionError: assert [] == ['a\n', 'b\nc... 'd\n', 'e\n']
E         
E         Right contains 4 more items, first extra item: 'a\n'
E         Use -v to get more diff

content    = []
freeze_time = .freeze_time at 0x7fac083b75b0>
frozen     = 
h          = 9600
hours      = [100, 5040, 7200, 2400, 9600]
i          = None
m          = 'e'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_Yearly__hou0')
when       = 'Yearly '

tests/test_filesink_rotation.py:164: AssertionError

test_filesink_rotation.py::test_time_rotation_dst

test_filesink_rotation.py::test_time_rotation_dst
freeze_time = .freeze_time at 0x7fac083b7520>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_dst0')

    def test_time_rotation_dst(freeze_time, tmp_path):
        with freeze_time("2018-10-27 05:00:00", ("CET", 3600)):
            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation="1 day")
            logger.debug("First")

            with freeze_time("2018-10-28 05:30:00", ("CEST", 7200)):
                logger.debug("Second")

                with freeze_time("2018-10-29 06:00:00", ("CET", 3600)):
                    logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_05-00-00_000000.log", "First\n"),
                ("test_2018-10-28_05-30-00_000000.log", "Second\n"),
                ("test_2018-10-29_06-00-00_000000.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b7520>
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_dst0')

tests/test_filesink_rotation.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_dst0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-10-27_05-00-00_000000.log', 'First\n'), ('test_2018-10-28_05-30-00_000000.log', 'Second\n'), ('test_2018-10-29_06-00-00_000000.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_dst0')
files      = [('test_2018-10-27_05-00-00_000000.log', 'First\n'), ('test_2018-10-28_05-30-00_000000.log', 'Second\n'), ('test_2018-10-29_06-00-00_000000.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_with_tzinfo_diff_bigger

test_filesink_rotation.py::test_time_rotation_with_tzinfo_diff_bigger
freeze_time = .freeze_time at 0x7fac083b7760>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo0')

    def test_time_rotation_with_tzinfo_diff_bigger(freeze_time, tmp_path):
        with freeze_time("2018-10-27 05:00:00", ("CET", 3600)) as frozen:
            tzinfo = datetime.timezone(datetime.timedelta(seconds=7200))
            rotation = datetime.time(7, 0, 0, tzinfo=tzinfo)

            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=rotation)

            frozen.tick(delta=datetime.timedelta(minutes=30))
            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Second")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_05-00-00_000000.log", "First\n"),
                ("test_2018-10-27_06-30-00_000000.log", "Second\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b7760>
frozen     = 
i          = None
rotation   = datetime.time(7, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=7200)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo0')
tzinfo     = datetime.timezone(datetime.timedelta(seconds=7200))

tests/test_filesink_rotation.py:204: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_05-00-00_000000.log', 'First\n'), ('test_2018-10-27_06-30-00_000000.log', 'Second\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo0')
files      = [('test_2018-10-27_05-00-00_000000.log', 'First\n'), ('test_2018-10-27_06-30-00_000000.log', 'Second\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_with_tzinfo_diff_lower

test_filesink_rotation.py::test_time_rotation_with_tzinfo_diff_lower
freeze_time = .freeze_time at 0x7fac083b7f40>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo1')

    def test_time_rotation_with_tzinfo_diff_lower(freeze_time, tmp_path):
        with freeze_time("2018-10-27 06:00:00", ("CEST", 7200)) as frozen:
            tzinfo = datetime.timezone(datetime.timedelta(seconds=3600))
            rotation = datetime.time(6, 0, 0, tzinfo=tzinfo)

            i = logger.add(tmp_path / "test_{time}.log", format="{message}", rotation=rotation)

            frozen.tick(delta=datetime.timedelta(minutes=30))
            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Second")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_06-00-00_000000.log", "First\n"),
                ("test_2018-10-27_07-30-00_000000.log", "Second\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b7f40>
frozen     = 
i          = None
rotation   = datetime.time(6, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo1')
tzinfo     = datetime.timezone(datetime.timedelta(seconds=3600))

tests/test_filesink_rotation.py:227: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_06-00-00_000000.log', 'First\n'), ('test_2018-10-27_07-30-00_000000.log', 'Second\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo1')
files      = [('test_2018-10-27_06-00-00_000000.log', 'First\n'), ('test_2018-10-27_07-30-00_000000.log', 'Second\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_with_tzinfo_utc

test_filesink_rotation.py::test_time_rotation_with_tzinfo_utc
freeze_time = .freeze_time at 0x7fac08384430>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo2')

    def test_time_rotation_with_tzinfo_utc(freeze_time, tmp_path):
        with freeze_time("2018-10-27 05:00:00", ("CET", 3600)) as frozen:
            rotation = datetime.time(5, 0, 0, tzinfo=datetime.timezone.utc)

            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            frozen.tick(delta=datetime.timedelta(minutes=30))
            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Second")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\n"),
                ("test_2018-10-27_05-30-00.log", "Second\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384430>
frozen     = 
i          = None
rotation   = datetime.time(5, 0, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo2')

tests/test_filesink_rotation.py:253: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\n'), ('test_2018-10-27_05-30-00.log', 'Second\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_with_tzinfo2')
files      = [('test_2018-10-27_04-00-00.log', 'First\n'), ('test_2018-10-27_05-30-00.log', 'Second\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_multiple_days_at_midnight_utc

test_filesink_rotation.py::test_time_rotation_multiple_days_at_midnight_utc
freeze_time = .freeze_time at 0x7fac08384d30>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_multiple_da0')

    def test_time_rotation_multiple_days_at_midnight_utc(freeze_time, tmp_path):
        with freeze_time("2018-10-27 10:00:00", ("CET", 3600)) as frozen:
            rotation = datetime.time(0, 0, 0, tzinfo=datetime.timezone.utc)

            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            frozen.tick(delta=datetime.timedelta(hours=13, minutes=30))
            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Second")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Third")
            frozen.tick(delta=datetime.timedelta(hours=24))
            logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27.log", "First\nSecond\n"),
                ("test_2018-10-28.log", "Third\n"),
                ("test_2018-10-29.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384d30>
frozen     = 
i          = None
rotation   = datetime.time(0, 0, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_multiple_da0')

tests/test_filesink_rotation.py:283: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_multiple_da0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_multiple_da0')
files      = [('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_daily_rotation_with_different_timezone[-3600]

test_filesink_rotation.py::test_daily_rotation_with_different_timezone[-3600]
freeze_time = .freeze_time at 0x7fac083b7f40>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe0')
offset = -3600

    @pytest.mark.parametrize("offset", [-3600, 0, 3600])
    def test_daily_rotation_with_different_timezone(freeze_time, tmp_path, offset):
        with freeze_time("2018-10-27 00:00:00", ("A", offset)) as frozen:
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD}.log",
                format="{message}",
                rotation="daily",
            )

            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=23, minutes=30))
            logger.debug("Second")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Third")
            frozen.tick(delta=datetime.timedelta(hours=24))
            logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27.log", "First\nSecond\n"),
                ("test_2018-10-28.log", "Third\n"),
                ("test_2018-10-29.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b7f40>
frozen     = 
i          = None
offset     = -3600
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe0')

tests/test_filesink_rotation.py:312: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe0')
files      = [('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_daily_rotation_with_different_timezone[0]

test_filesink_rotation.py::test_daily_rotation_with_different_timezone[0]
freeze_time = .freeze_time at 0x7fac083b6830>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe1')
offset = 0

    @pytest.mark.parametrize("offset", [-3600, 0, 3600])
    def test_daily_rotation_with_different_timezone(freeze_time, tmp_path, offset):
        with freeze_time("2018-10-27 00:00:00", ("A", offset)) as frozen:
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD}.log",
                format="{message}",
                rotation="daily",
            )

            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=23, minutes=30))
            logger.debug("Second")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Third")
            frozen.tick(delta=datetime.timedelta(hours=24))
            logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27.log", "First\nSecond\n"),
                ("test_2018-10-28.log", "Third\n"),
                ("test_2018-10-29.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6830>
frozen     = 
i          = None
offset     = 0
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe1')

tests/test_filesink_rotation.py:312: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe1')
files      = [('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_daily_rotation_with_different_timezone[3600]

test_filesink_rotation.py::test_daily_rotation_with_different_timezone[3600]
freeze_time = .freeze_time at 0x7fac083b68c0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe2')
offset = 3600

    @pytest.mark.parametrize("offset", [-3600, 0, 3600])
    def test_daily_rotation_with_different_timezone(freeze_time, tmp_path, offset):
        with freeze_time("2018-10-27 00:00:00", ("A", offset)) as frozen:
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD}.log",
                format="{message}",
                rotation="daily",
            )

            logger.debug("First")
            frozen.tick(delta=datetime.timedelta(hours=23, minutes=30))
            logger.debug("Second")
            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.debug("Third")
            frozen.tick(delta=datetime.timedelta(hours=24))
            logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27.log", "First\nSecond\n"),
                ("test_2018-10-28.log", "Third\n"),
                ("test_2018-10-29.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b68c0>
frozen     = 
i          = None
offset     = 3600
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe2')

tests/test_filesink_rotation.py:312: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 3
E            +  where 0 = len(set())
E            +  and   3 = len([('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_daily_rotation_with_diffe2')
files      = [('test_2018-10-27.log', 'First\nSecond\n'), ('test_2018-10-28.log', 'Third\n'), ('test_2018-10-29.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation0]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation0]
freeze_time = .freeze_time at 0x7fac08385090>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit0')
rotation = datetime.time(1, 30, tzinfo=datetime.timezone.utc)

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08385090>
frozen     = 
i          = None
rotation   = datetime.time(1, 30, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit0')

tests/test_filesink_rotation.py:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit0')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation1]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation1]
freeze_time = .freeze_time at 0x7fac083853f0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit1')
rotation = datetime.time(2, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083853f0>
frozen     = 
i          = None
rotation   = datetime.time(2, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit1')

tests/test_filesink_rotation.py:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit1')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation2]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation2]
freeze_time = .freeze_time at 0x7fac08385990>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit2')
rotation = datetime.time(0, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08385990>
frozen     = 
i          = None
rotation   = datetime.time(0, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit2')

tests/test_filesink_rotation.py:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit2')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation3]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[rotation3]
freeze_time = .freeze_time at 0x7fac08385d80>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit3')
rotation = datetime.time(3, 30)

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08385d80>
frozen     = 
i          = None
rotation   = datetime.time(3, 30)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit3')

tests/test_filesink_rotation.py:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit3')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[03:30:00]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_forward[03:30:00]
freeze_time = .freeze_time at 0x7fac08386170>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit4')
rotation = '03:30:00'

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386170>
frozen     = 
i          = None
rotation   = '03:30:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit4')

tests/test_filesink_rotation.py:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit4')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit4')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_when_positive_timezone_changes_forward[rotation0]

test_filesink_rotation.py::test_time_rotation_when_positive_timezone_changes_forward[rotation0]
freeze_time = .freeze_time at 0x7fac083b6cb0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi0')
rotation = datetime.time(2, 30)

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_when_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_02-00-00.log", "First\n"),
                ("test_2018-10-27_03-00-00.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b6cb0>
frozen     = 
i          = None
rotation   = datetime.time(2, 30)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi0')

tests/test_filesink_rotation.py:376: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi0')
files      = [('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_when_positive_timezone_changes_forward[02:30:00]

test_filesink_rotation.py::test_time_rotation_when_positive_timezone_changes_forward[02:30:00]
freeze_time = .freeze_time at 0x7fac083b79a0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi1')
rotation = '02:30:00'

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_when_positive_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_02-00-00.log", "First\n"),
                ("test_2018-10-27_03-00-00.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b79a0>
frozen     = 
i          = None
rotation   = '02:30:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi1')

tests/test_filesink_rotation.py:376: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_positi1')
files      = [('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation0]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation0]
freeze_time = .freeze_time at 0x7fac08386200>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat0')
rotation = datetime.time(4, 30, tzinfo=datetime.timezone.utc)

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386200>
frozen     = 
i          = None
rotation   = datetime.time(4, 30, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat0')

tests/test_filesink_rotation.py:412: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat0')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation1]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation1]
freeze_time = .freeze_time at 0x7fac083841f0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat1')
rotation = datetime.time(5, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083841f0>
frozen     = 
i          = None
rotation   = datetime.time(5, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat1')

tests/test_filesink_rotation.py:412: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat1')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation2]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation2]
freeze_time = .freeze_time at 0x7fac08384040>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat2')
rotation = datetime.time(3, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384040>
frozen     = 
i          = None
rotation   = datetime.time(3, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat2')

tests/test_filesink_rotation.py:412: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat2')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation3]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[rotation3]
freeze_time = .freeze_time at 0x7fac083868c0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat3')
rotation = datetime.time(3, 30)

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083868c0>
frozen     = 
i          = None
rotation   = datetime.time(3, 30)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat3')

tests/test_filesink_rotation.py:412: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat3')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[03:30:00]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_forward[03:30:00]
freeze_time = .freeze_time at 0x7fac08386b90>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat4')
rotation = '03:30:00'

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
            datetime.time(3, 30, 0),
            "03:30:00",
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386b90>
frozen     = 
i          = None
rotation   = '03:30:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat4')

tests/test_filesink_rotation.py:412: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat4')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat4')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_when_negative_timezone_changes_forward[rotation0]

test_filesink_rotation.py::test_time_rotation_when_negative_timezone_changes_forward[rotation0]
freeze_time = .freeze_time at 0x7fac083b7be0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati0')
rotation = datetime.time(2, 30)

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_when_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_02-00-00.log", "First\n"),
                ("test_2018-10-27_03-00-00.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b7be0>
frozen     = 
i          = None
rotation   = datetime.time(2, 30)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati0')

tests/test_filesink_rotation.py:439: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati0')
files      = [('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_when_negative_timezone_changes_forward[02:30:00]

test_filesink_rotation.py::test_time_rotation_when_negative_timezone_changes_forward[02:30:00]
freeze_time = .freeze_time at 0x7fac083851b0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati1')
rotation = '02:30:00'

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_when_negative_timezone_changes_forward(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-27 02:00:00", ("CET", -7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", -3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_02-00-00.log", "First\n"),
                ("test_2018-10-27_03-00-00.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083851b0>
frozen     = 
i          = None
rotation   = '02:30:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati1')

tests/test_filesink_rotation.py:439: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_negati1')
files      = [('test_2018-10-27_02-00-00.log', 'First\n'), ('test_2018-10-27_03-00-00.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_aware[rotation0]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_aware[rotation0]
freeze_time = .freeze_time at 0x7fac08385bd0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit5')
rotation = datetime.time(1, 30, tzinfo=datetime.timezone.utc)

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_backward_aware(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", 7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", 3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08385bd0>
frozen     = 
i          = None
rotation   = datetime.time(1, 30, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit5')

tests/test_filesink_rotation.py:475: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit5')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit5')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_aware[rotation1]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_aware[rotation1]
freeze_time = .freeze_time at 0x7fac08387250>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit6')
rotation = datetime.time(2, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_backward_aware(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", 7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", 3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387250>
frozen     = 
i          = None
rotation   = datetime.time(2, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit6')

tests/test_filesink_rotation.py:475: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit6')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit6')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_aware[rotation2]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_aware[rotation2]
freeze_time = .freeze_time at 0x7fac08386050>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit7')
rotation = datetime.time(0, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(1, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(2, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(0, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_time_rotation_after_positive_timezone_changes_backward_aware(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", 7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", 3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_02-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386050>
frozen     = 
i          = None
rotation   = datetime.time(0, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit7')

tests/test_filesink_rotation.py:475: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit7')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit7')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_02-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_naive[rotation0]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_naive[rotation0]
freeze_time = .freeze_time at 0x7fac08384940>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit8')
rotation = datetime.time(2, 30)

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_after_positive_timezone_changes_backward_naive(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", 7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", 3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")
                frozen.tick(delta=datetime.timedelta(days=1))
                logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\nThird\n"),
                ("test_2018-10-28_02-00-00.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384940>
frozen     = 
i          = None
rotation   = datetime.time(2, 30)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit8')

tests/test_filesink_rotation.py:506: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit8')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_02-00-00.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit8')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_02-00-00.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_naive[02:30:00]

test_filesink_rotation.py::test_time_rotation_after_positive_timezone_changes_backward_naive[02:30:00]
freeze_time = .freeze_time at 0x7fac08384c10>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit9')
rotation = '02:30:00'

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_after_positive_timezone_changes_backward_naive(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", 7200)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", 3600)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")
                frozen.tick(delta=datetime.timedelta(days=1))
                logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.log", "First\nSecond\nThird\n"),
                ("test_2018-10-28_02-00-00.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384c10>
frozen     = 
i          = None
rotation   = '02:30:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit9')

tests/test_filesink_rotation.py:506: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit9')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_02-00-00.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_posit9')
files      = [('test_2018-10-27_01-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_02-00-00.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_aware[rotation0]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_aware[rotation0]
freeze_time = .freeze_time at 0x7fac083b79a0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat5')
rotation = datetime.time(4, 30, tzinfo=datetime.timezone.utc)

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_backward_aware(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", -3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", -7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083b79a0>
frozen     = 
i          = None
rotation   = datetime.time(4, 30, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat5')

tests/test_filesink_rotation.py:542: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat5')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat5')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_aware[rotation1]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_aware[rotation1]
freeze_time = .freeze_time at 0x7fac08386290>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat6')
rotation = datetime.time(5, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_backward_aware(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", -3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", -7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386290>
frozen     = 
i          = None
rotation   = datetime.time(5, 30, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat6')

tests/test_filesink_rotation.py:542: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat6')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat6')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_aware[rotation2]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_aware[rotation2]
freeze_time = .freeze_time at 0x7fac08387ac0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat7')
rotation = datetime.time(3, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))

    @pytest.mark.parametrize(
        "rotation",
        [
            datetime.time(4, 30, 0, tzinfo=datetime.timezone.utc),
            datetime.time(5, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600))),
            datetime.time(3, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_time_rotation_after_negative_timezone_changes_backward_aware(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", -3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", -7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\n"),
                ("test_2018-10-27_05-00-00.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387ac0>
frozen     = 
i          = None
rotation   = datetime.time(3, 30, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat7')

tests/test_filesink_rotation.py:542: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat7')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat7')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\n'), ('test_2018-10-27_05-00-00.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_naive[rotation0]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_naive[rotation0]
freeze_time = .freeze_time at 0x7fac08384040>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat8')
rotation = datetime.time(2, 30)

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_after_negative_timezone_changes_backward_naive(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", -3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", -7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")
                frozen.tick(delta=datetime.timedelta(days=1))
                logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\nThird\n"),
                ("test_2018-10-28_05-00-00.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384040>
frozen     = 
i          = None
rotation   = datetime.time(2, 30)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat8')

tests/test_filesink_rotation.py:573: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat8')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_05-00-00.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat8')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_05-00-00.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_naive[02:30:00]

test_filesink_rotation.py::test_time_rotation_after_negative_timezone_changes_backward_naive[02:30:00]
freeze_time = .freeze_time at 0x7fac08387370>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat9')
rotation = '02:30:00'

    @pytest.mark.parametrize("rotation", [datetime.time(2, 30, 0), "02:30:00"])
    def test_time_rotation_after_negative_timezone_changes_backward_naive(
        freeze_time, tmp_path, rotation
    ):
        with freeze_time("2018-10-27 03:00:00", ("CET", -3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation=rotation,
            )

            logger.debug("First")

            with freeze_time("2018-10-27 02:00:00", ("CET", -7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")
                frozen.tick(delta=datetime.timedelta(days=1))
                logger.debug("Fourth")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_04-00-00.log", "First\nSecond\nThird\n"),
                ("test_2018-10-28_05-00-00.log", "Fourth\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387370>
frozen     = 
i          = None
rotation   = '02:30:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat9')

tests/test_filesink_rotation.py:573: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat9')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_04-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_05-00-00.log', 'Fourth\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_after_negat9')
files      = [('test_2018-10-27_04-00-00.log', 'First\nSecond\nThird\n'), ('test_2018-10-28_05-00-00.log', 'Fourth\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_when_timezone_changes_backward_rename_file

test_filesink_rotation.py::test_time_rotation_when_timezone_changes_backward_rename_file
freeze_time = .freeze_time at 0x7fac08387d00>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_timezo0')

    def test_time_rotation_when_timezone_changes_backward_rename_file(freeze_time, tmp_path):
        with freeze_time("2018-10-27 02:00:00", ("CET", 3600)):
            i = logger.add(
                tmp_path / "test_{time:YYYY-MM-DD_HH-mm-ss!UTC}.log",
                format="{message}",
                rotation="02:30:00",
            )

            logger.debug("First")

            with freeze_time("2018-10-27 03:00:00", ("CET", 7200)) as frozen:
                logger.debug("Second")
                frozen.tick(delta=datetime.timedelta(hours=1))
                logger.debug("Third")

        logger.remove(i)

>       check_dir(
            tmp_path,
            files=[
                ("test_2018-10-27_01-00-00.2018-10-27_03-00-00_000000.log", "First\n"),
                ("test_2018-10-27_01-00-00.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387d00>
frozen     = 
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_timezo0')

tests/test_filesink_rotation.py:599: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_timezo0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test_2018-10-27_01-00-00.2018-10-27_03-00-00_000000.log', 'First\n'), ('test_2018-10-27_01-00-00.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_time_rotation_when_timezo0')
files      = [('test_2018-10-27_01-00-00.2018-10-27_03-00-00_000000.log', 'First\n'), ('test_2018-10-27_01-00-00.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[00:15]

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[00:15]
freeze_time = .freeze_time at 0x7fac08384940>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_0')
rotation = '00:15'

    @pytest.mark.parametrize(
        "rotation",
        [
            "00:15",
            datetime.time(0, 15, 0),
            datetime.time(23, 15, 0, tzinfo=datetime.timezone.utc),
            datetime.time(0, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(22, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_earlier_when_utc_is_one_day_before(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-24 00:30:00", ("CET", +3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-24_00-30-00_000000.log", "First\nSecond\n"),
                ("test.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08384940>
frozen     = 
rotation   = '00:15'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_0')

tests/test_filesink_rotation.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_0')
files      = [('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation1]

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation1]
freeze_time = .freeze_time at 0x7fac08387760>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_1')
rotation = datetime.time(0, 15)

    @pytest.mark.parametrize(
        "rotation",
        [
            "00:15",
            datetime.time(0, 15, 0),
            datetime.time(23, 15, 0, tzinfo=datetime.timezone.utc),
            datetime.time(0, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(22, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_earlier_when_utc_is_one_day_before(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-24 00:30:00", ("CET", +3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-24_00-30-00_000000.log", "First\nSecond\n"),
                ("test.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387760>
frozen     = 
rotation   = datetime.time(0, 15)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_1')

tests/test_filesink_rotation.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_1')
files      = [('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation2]

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation2]
freeze_time = .freeze_time at 0x7fac083872e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_2')
rotation = datetime.time(23, 15, tzinfo=datetime.timezone.utc)

    @pytest.mark.parametrize(
        "rotation",
        [
            "00:15",
            datetime.time(0, 15, 0),
            datetime.time(23, 15, 0, tzinfo=datetime.timezone.utc),
            datetime.time(0, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(22, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_earlier_when_utc_is_one_day_before(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-24 00:30:00", ("CET", +3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-24_00-30-00_000000.log", "First\nSecond\n"),
                ("test.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083872e0>
frozen     = 
rotation   = datetime.time(23, 15, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_2')

tests/test_filesink_rotation.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_2')
files      = [('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation3]

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation3]
freeze_time = .freeze_time at 0x7fac08387d00>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_3')
rotation = datetime.time(0, 15, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))

    @pytest.mark.parametrize(
        "rotation",
        [
            "00:15",
            datetime.time(0, 15, 0),
            datetime.time(23, 15, 0, tzinfo=datetime.timezone.utc),
            datetime.time(0, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(22, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_earlier_when_utc_is_one_day_before(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-24 00:30:00", ("CET", +3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-24_00-30-00_000000.log", "First\nSecond\n"),
                ("test.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387d00>
frozen     = 
rotation   = datetime.time(0, 15, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_3')

tests/test_filesink_rotation.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_3')
files      = [('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation4]

test_filesink_rotation.py::test_dont_rotate_earlier_when_utc_is_one_day_before[rotation4]
freeze_time = .freeze_time at 0x7fac08386950>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_4')
rotation = datetime.time(22, 15, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))

    @pytest.mark.parametrize(
        "rotation",
        [
            "00:15",
            datetime.time(0, 15, 0),
            datetime.time(23, 15, 0, tzinfo=datetime.timezone.utc),
            datetime.time(0, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(22, 15, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_earlier_when_utc_is_one_day_before(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-24 00:30:00", ("CET", +3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-24_00-30-00_000000.log", "First\nSecond\n"),
                ("test.log", "Third\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386950>
frozen     = 
rotation   = datetime.time(22, 15, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_4')

tests/test_filesink_rotation.py:634: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_4')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_earlier_when_4')
files      = [('test.2018-10-24_00-30-00_000000.log', 'First\nSecond\n'), ('test.log', 'Third\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[23:45]

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[23:45]
freeze_time = .freeze_time at 0x7fac08386b90>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut0')
rotation = '23:45'

    @pytest.mark.parametrize(
        "rotation",
        [
            "23:45",
            datetime.time(23, 45, 0),
            datetime.time(0, 45, 0, tzinfo=datetime.timezone.utc),
            datetime.time(1, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(23, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_later_when_utc_is_one_day_after(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-23 23:30:00", ("CET", -3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23_23-30-00_000000.log", "First\n"),
                ("test.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08386b90>
frozen     = 
rotation   = '23:45'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut0')

tests/test_filesink_rotation.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut0')
files      = [('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation1]

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation1]
freeze_time = .freeze_time at 0x7fac083853f0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut1')
rotation = datetime.time(23, 45)

    @pytest.mark.parametrize(
        "rotation",
        [
            "23:45",
            datetime.time(23, 45, 0),
            datetime.time(0, 45, 0, tzinfo=datetime.timezone.utc),
            datetime.time(1, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(23, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_later_when_utc_is_one_day_after(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-23 23:30:00", ("CET", -3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23_23-30-00_000000.log", "First\n"),
                ("test.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac083853f0>
frozen     = 
rotation   = datetime.time(23, 45)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut1')

tests/test_filesink_rotation.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut1')
files      = [('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation2]

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation2]
freeze_time = .freeze_time at 0x7fac081ec8b0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut2')
rotation = datetime.time(0, 45, tzinfo=datetime.timezone.utc)

    @pytest.mark.parametrize(
        "rotation",
        [
            "23:45",
            datetime.time(23, 45, 0),
            datetime.time(0, 45, 0, tzinfo=datetime.timezone.utc),
            datetime.time(1, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(23, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_later_when_utc_is_one_day_after(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-23 23:30:00", ("CET", -3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23_23-30-00_000000.log", "First\n"),
                ("test.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081ec8b0>
frozen     = 
rotation   = datetime.time(0, 45, tzinfo=datetime.timezone.utc)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut2')

tests/test_filesink_rotation.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut2')
files      = [('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation3]

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation3]
freeze_time = .freeze_time at 0x7fac081ecf70>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut3')
rotation = datetime.time(1, 45, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))

    @pytest.mark.parametrize(
        "rotation",
        [
            "23:45",
            datetime.time(23, 45, 0),
            datetime.time(0, 45, 0, tzinfo=datetime.timezone.utc),
            datetime.time(1, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(23, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_later_when_utc_is_one_day_after(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-23 23:30:00", ("CET", -3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23_23-30-00_000000.log", "First\n"),
                ("test.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081ecf70>
frozen     = 
rotation   = datetime.time(1, 45, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut3')

tests/test_filesink_rotation.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut3')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut3')
files      = [('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation4]

test_filesink_rotation.py::test_dont_rotate_later_when_utc_is_one_day_after[rotation4]
freeze_time = .freeze_time at 0x7fac08387d90>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut4')
rotation = datetime.time(23, 45, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))

    @pytest.mark.parametrize(
        "rotation",
        [
            "23:45",
            datetime.time(23, 45, 0),
            datetime.time(0, 45, 0, tzinfo=datetime.timezone.utc),
            datetime.time(1, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=+3600))),
            datetime.time(23, 45, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=-3600))),
        ],
    )
    def test_dont_rotate_later_when_utc_is_one_day_after(freeze_time, tmp_path, rotation):
        with freeze_time("2018-10-23 23:30:00", ("CET", -3600)) as frozen:
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=1))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Second")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(hours=23))
            logger.add(tmp_path / "test.log", format="{message}", rotation=rotation)
            logger.info("Third")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23_23-30-00_000000.log", "First\n"),
                ("test.log", "Second\nThird\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08387d90>
frozen     = 
rotation   = datetime.time(23, 45, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=82800)))
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut4')

tests/test_filesink_rotation.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut4')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_dont_rotate_later_when_ut4')
files      = [('test.2018-10-23_23-30-00_000000.log', 'First\n'), ('test.log', 'Second\nThird\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_rotation_at_midnight_with_date_in_filename[timezone0]

test_filesink_rotation.py::test_rotation_at_midnight_with_date_in_filename[timezone0]
freeze_time = .freeze_time at 0x7fac08385bd0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with0')
timezone = ('CET', 3600)

    @pytest.mark.parametrize("timezone", [("CET", +3600), ("CET", -3600), ("UTC", 0)])
    def test_rotation_at_midnight_with_date_in_filename(freeze_time, tmp_path, timezone):
        with freeze_time("2018-10-23 23:55:00", timezone) as frozen:
            logger.add(tmp_path / "test.{time:YYYY-MM-DD}.log", format="{message}", rotation="00:00")
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(minutes=10))

            logger.add(tmp_path / "test.{time:YYYY-MM-DD}.log", format="{message}", rotation="00:00")
            logger.info("Second")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23.log", "First\n"),
                ("test.2018-10-24.log", "Second\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac08385bd0>
frozen     = 
timezone   = ('CET', 3600)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with0')

tests/test_filesink_rotation.py:691: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23.log', 'First\n'), ('test.2018-10-24.log', 'Second\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with0')
files      = [('test.2018-10-23.log', 'First\n'), ('test.2018-10-24.log', 'Second\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_rotation_at_midnight_with_date_in_filename[timezone1]

test_filesink_rotation.py::test_rotation_at_midnight_with_date_in_filename[timezone1]
freeze_time = .freeze_time at 0x7fac081ec5e0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with1')
timezone = ('CET', -3600)

    @pytest.mark.parametrize("timezone", [("CET", +3600), ("CET", -3600), ("UTC", 0)])
    def test_rotation_at_midnight_with_date_in_filename(freeze_time, tmp_path, timezone):
        with freeze_time("2018-10-23 23:55:00", timezone) as frozen:
            logger.add(tmp_path / "test.{time:YYYY-MM-DD}.log", format="{message}", rotation="00:00")
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(minutes=10))

            logger.add(tmp_path / "test.{time:YYYY-MM-DD}.log", format="{message}", rotation="00:00")
            logger.info("Second")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23.log", "First\n"),
                ("test.2018-10-24.log", "Second\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081ec5e0>
frozen     = 
timezone   = ('CET', -3600)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with1')

tests/test_filesink_rotation.py:691: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23.log', 'First\n'), ('test.2018-10-24.log', 'Second\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with1')
files      = [('test.2018-10-23.log', 'First\n'), ('test.2018-10-24.log', 'Second\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_rotation_at_midnight_with_date_in_filename[timezone2]

test_filesink_rotation.py::test_rotation_at_midnight_with_date_in_filename[timezone2]
freeze_time = .freeze_time at 0x7fac081edf30>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with2')
timezone = ('UTC', 0)

    @pytest.mark.parametrize("timezone", [("CET", +3600), ("CET", -3600), ("UTC", 0)])
    def test_rotation_at_midnight_with_date_in_filename(freeze_time, tmp_path, timezone):
        with freeze_time("2018-10-23 23:55:00", timezone) as frozen:
            logger.add(tmp_path / "test.{time:YYYY-MM-DD}.log", format="{message}", rotation="00:00")
            logger.info("First")
            logger.remove()

            frozen.tick(delta=datetime.timedelta(minutes=10))

            logger.add(tmp_path / "test.{time:YYYY-MM-DD}.log", format="{message}", rotation="00:00")
            logger.info("Second")
            logger.remove()

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-10-23.log", "First\n"),
                ("test.2018-10-24.log", "Second\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081edf30>
frozen     = 
timezone   = ('UTC', 0)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with2')

tests/test_filesink_rotation.py:691: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with2')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-10-23.log', 'First\n'), ('test.2018-10-24.log', 'Second\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_midnight_with2')
files      = [('test.2018-10-23.log', 'First\n'), ('test.2018-10-24.log', 'Second\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_time_rotation_reopening_xattr_attributeerror[False]

test_filesink_rotation.py::test_time_rotation_reopening_xattr_attributeerror[False]
tmp_path_local = PosixPath('tmp0bc4lgqn')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08771fc0>
delay = False

    @pytest.mark.parametrize("delay", [False, True])
    @pytest.mark.skipif(
        os.name == "nt"
        or hasattr(os.stat_result, "st_birthtime")
        or not hasattr(os, "setxattr")
        or not hasattr(os, "getxattr"),
        reason="Testing implementation specific to Linux",
    )
    def test_time_rotation_reopening_xattr_attributeerror(tmp_path_local, monkeypatch, delay):
        monkeypatch.delattr(os, "setxattr")
        monkeypatch.delattr(os, "getxattr")
        get_ctime, set_ctime = load_ctime_functions()

        monkeypatch.setattr(loguru._file_sink, "get_ctime", get_ctime)
        monkeypatch.setattr(loguru._file_sink, "set_ctime", set_ctime)

        filepath = tmp_path_local / "test.log"
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        time.sleep(1)
        logger.info("1")
        logger.remove(i)
        time.sleep(1.5)
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        logger.info("2")
        logger.remove(i)
>       check_dir(tmp_path_local, size=1)

delay      = False
filepath   = PosixPath('tmp0bc4lgqn/test.log')
get_ctime  = .get_ctime at 0x7fac081ec430>
i          = None
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08771fc0>
set_ctime  = .set_ctime at 0x7fac081ed630>
tmp_path_local = PosixPath('tmp0bc4lgqn')

tests/test_filesink_rotation.py:774: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('tmp0bc4lgqn')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('tmp0bc4lgqn')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_rotation.py::test_time_rotation_reopening_xattr_attributeerror[True]

test_filesink_rotation.py::test_time_rotation_reopening_xattr_attributeerror[True]
tmp_path_local = PosixPath('tmpswlcz772')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac093223b0>
delay = True

    @pytest.mark.parametrize("delay", [False, True])
    @pytest.mark.skipif(
        os.name == "nt"
        or hasattr(os.stat_result, "st_birthtime")
        or not hasattr(os, "setxattr")
        or not hasattr(os, "getxattr"),
        reason="Testing implementation specific to Linux",
    )
    def test_time_rotation_reopening_xattr_attributeerror(tmp_path_local, monkeypatch, delay):
        monkeypatch.delattr(os, "setxattr")
        monkeypatch.delattr(os, "getxattr")
        get_ctime, set_ctime = load_ctime_functions()

        monkeypatch.setattr(loguru._file_sink, "get_ctime", get_ctime)
        monkeypatch.setattr(loguru._file_sink, "set_ctime", set_ctime)

        filepath = tmp_path_local / "test.log"
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        time.sleep(1)
        logger.info("1")
        logger.remove(i)
        time.sleep(1.5)
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        logger.info("2")
        logger.remove(i)
>       check_dir(tmp_path_local, size=1)

delay      = True
filepath   = PosixPath('tmpswlcz772/test.log')
get_ctime  = .get_ctime at 0x7fac081ede10>
i          = None
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac093223b0>
set_ctime  = .set_ctime at 0x7fac081ed120>
tmp_path_local = PosixPath('tmpswlcz772')

tests/test_filesink_rotation.py:774: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('tmpswlcz772')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('tmpswlcz772')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_rotation.py::test_time_rotation_reopening_xattr_oserror[False]

test_filesink_rotation.py::test_time_rotation_reopening_xattr_oserror[False]
tmp_path_local = PosixPath('tmpmu5odrao')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08704d00>
delay = False

    @pytest.mark.parametrize("delay", [False, True])
    @pytest.mark.skipif(
        os.name == "nt"
        or hasattr(os.stat_result, "st_birthtime")
        or not hasattr(os, "setxattr")
        or not hasattr(os, "getxattr"),
        reason="Testing implementation specific to Linux",
    )
    def test_time_rotation_reopening_xattr_oserror(tmp_path_local, monkeypatch, delay):
        monkeypatch.setattr(os, "setxattr", Mock(side_effect=OSError))
        monkeypatch.setattr(os, "getxattr", Mock(side_effect=OSError))
        get_ctime, set_ctime = load_ctime_functions()

        monkeypatch.setattr(loguru._file_sink, "get_ctime", get_ctime)
        monkeypatch.setattr(loguru._file_sink, "set_ctime", set_ctime)

        filepath = tmp_path_local / "test.log"
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        time.sleep(1)
        logger.info("1")
        logger.remove(i)
        time.sleep(1.5)
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        logger.info("2")
        logger.remove(i)
>       check_dir(tmp_path_local, size=1)

delay      = False
filepath   = PosixPath('tmpmu5odrao/test.log')
get_ctime  = .get_ctime at 0x7fac081ecd30>
i          = None
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08704d00>
set_ctime  = .set_ctime at 0x7fac081ee5f0>
tmp_path_local = PosixPath('tmpmu5odrao')

tests/test_filesink_rotation.py:809: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('tmpmu5odrao')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('tmpmu5odrao')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_rotation.py::test_time_rotation_reopening_xattr_oserror[True]

test_filesink_rotation.py::test_time_rotation_reopening_xattr_oserror[True]
tmp_path_local = PosixPath('tmpjyysvo7a')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08255870>
delay = True

    @pytest.mark.parametrize("delay", [False, True])
    @pytest.mark.skipif(
        os.name == "nt"
        or hasattr(os.stat_result, "st_birthtime")
        or not hasattr(os, "setxattr")
        or not hasattr(os, "getxattr"),
        reason="Testing implementation specific to Linux",
    )
    def test_time_rotation_reopening_xattr_oserror(tmp_path_local, monkeypatch, delay):
        monkeypatch.setattr(os, "setxattr", Mock(side_effect=OSError))
        monkeypatch.setattr(os, "getxattr", Mock(side_effect=OSError))
        get_ctime, set_ctime = load_ctime_functions()

        monkeypatch.setattr(loguru._file_sink, "get_ctime", get_ctime)
        monkeypatch.setattr(loguru._file_sink, "set_ctime", set_ctime)

        filepath = tmp_path_local / "test.log"
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        time.sleep(1)
        logger.info("1")
        logger.remove(i)
        time.sleep(1.5)
        i = logger.add(filepath, format="{message}", delay=delay, rotation="2 s")
        logger.info("2")
        logger.remove(i)
>       check_dir(tmp_path_local, size=1)

delay      = True
filepath   = PosixPath('tmpjyysvo7a/test.log')
get_ctime  = .get_ctime at 0x7fac08386cb0>
i          = None
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac08255870>
set_ctime  = .set_ctime at 0x7fac08386b00>
tmp_path_local = PosixPath('tmpjyysvo7a')

tests/test_filesink_rotation.py:809: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('tmpjyysvo7a')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('tmpjyysvo7a')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_rotation.py::test_function_rotation

test_filesink_rotation.py::test_function_rotation
freeze_time = .freeze_time at 0x7fac081ee7a0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_function_rotation0')

    def test_function_rotation(freeze_time, tmp_path):
        with freeze_time("2018-01-01 00:00:00") as frozen:
            logger.add(
                tmp_path / "test_{time}.log",
                rotation=Mock(side_effect=[False, True, False]),
                format="{message}",
            )
            logger.debug("a")
>           check_dir(tmp_path, files=[("test_2018-01-01_00-00-00_000000.log", "a\n")])

freeze_time = .freeze_time at 0x7fac081ee7a0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_function_rotation0')

tests/test_filesink_rotation.py:871: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_function_rotation0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test_2018-01-01_00-00-00_000000.log', 'a\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_function_rotation0')
files      = [('test_2018-01-01_00-00-00_000000.log', 'a\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_rotation_at_remove[w]

test_filesink_rotation.py::test_rotation_at_remove[w]
freeze_time = .freeze_time at 0x7fac081ee950>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_w_0')
mode = 'w'

    @pytest.mark.parametrize("mode", ["w", "x"])
    def test_rotation_at_remove(freeze_time, tmp_path, mode):
        with freeze_time("2018-01-01"):
            i = logger.add(
                tmp_path / "test_{time:YYYY}.log",
                rotation="10 MB",
                mode=mode,
                format="{message}",
            )
            logger.debug("test")
            logger.remove(i)

>       check_dir(tmp_path, files=[("test_2018.log", "test\n")])

freeze_time = .freeze_time at 0x7fac081ee950>
i          = None
mode       = 'w'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_w_0')

tests/test_filesink_rotation.py:906: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_w_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test_2018.log', 'test\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_w_0')
files      = [('test_2018.log', 'test\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_rotation_at_remove[x]

test_filesink_rotation.py::test_rotation_at_remove[x]
freeze_time = .freeze_time at 0x7fac081eec20>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_x_0')
mode = 'x'

    @pytest.mark.parametrize("mode", ["w", "x"])
    def test_rotation_at_remove(freeze_time, tmp_path, mode):
        with freeze_time("2018-01-01"):
            i = logger.add(
                tmp_path / "test_{time:YYYY}.log",
                rotation="10 MB",
                mode=mode,
                format="{message}",
            )
            logger.debug("test")
            logger.remove(i)

>       check_dir(tmp_path, files=[("test_2018.log", "test\n")])

freeze_time = .freeze_time at 0x7fac081eec20>
i          = None
mode       = 'x'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_x_0')

tests/test_filesink_rotation.py:906: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_x_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test_2018.log', 'test\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rotation_at_remove_x_0')
files      = [('test_2018.log', 'test\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_no_rotation_at_remove[a]

test_filesink_rotation.py::test_no_rotation_at_remove[a]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a_0')
mode = 'a'

    @pytest.mark.parametrize("mode", ["a", "a+"])
    def test_no_rotation_at_remove(tmp_path, mode):
        i = logger.add(tmp_path / "test.log", rotation="10 MB", mode=mode, format="{message}")
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", "test\n")])

i          = None
mode       = 'a'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a_0')

tests/test_filesink_rotation.py:915: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a_0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', 'test\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a_0')
files      = [('test.log', 'test\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_no_rotation_at_remove[a+]

test_filesink_rotation.py::test_no_rotation_at_remove[a+]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a__0')
mode = 'a+'

    @pytest.mark.parametrize("mode", ["a", "a+"])
    def test_no_rotation_at_remove(tmp_path, mode):
        i = logger.add(tmp_path / "test.log", rotation="10 MB", mode=mode, format="{message}")
        logger.debug("test")
        logger.remove(i)

>       check_dir(tmp_path, files=[("test.log", "test\n")])

i          = None
mode       = 'a+'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a__0')

tests/test_filesink_rotation.py:915: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a__0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', 'test\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_rotation_at_remove_a__0')
files      = [('test.log', 'test\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_rename_existing_with_creation_time

test_filesink_rotation.py::test_rename_existing_with_creation_time
freeze_time = .freeze_time at 0x7fac081ef7f0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea1')

    def test_rename_existing_with_creation_time(freeze_time, tmp_path):
        with freeze_time("2018-01-01") as frozen:
            logger.add(tmp_path / "test.log", rotation=10, format="{message}")
            logger.debug("X")
            frozen.tick()
            logger.debug("Y" * 20)

>       check_dir(
            tmp_path,
            files=[
                ("test.2018-01-01_00-00-00_000000.log", "X\n"),
                ("test.log", "Y" * 20 + "\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081ef7f0>
frozen     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea1')

tests/test_filesink_rotation.py:925: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 2
E            +  where 0 = len(set())
E            +  and   2 = len([('test.2018-01-01_00-00-00_000000.log', 'X\n'), ('test.log', 'YYYYYYYYYYYYYYYYYYYY\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_rename_existing_with_crea1')
files      = [('test.2018-01-01_00-00-00_000000.log', 'X\n'), ('test.log', 'YYYYYYYYYYYYYYYYYYYY\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_renaming_rotation_dest_exists

test_filesink_rotation.py::test_renaming_rotation_dest_exists
freeze_time = .freeze_time at 0x7fac081efac0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex0')

    def test_renaming_rotation_dest_exists(freeze_time, tmp_path):
        with freeze_time("2019-01-02 03:04:05.000006"):
            logger.add(tmp_path / "rotate.log", rotation=Mock(return_value=True), format="{message}")
            logger.info("A")
            logger.info("B")
            logger.info("C")

>       check_dir(
            tmp_path,
            files=[
                ("rotate.2019-01-02_03-04-05_000006.log", ""),
                ("rotate.2019-01-02_03-04-05_000006.2.log", "A\n"),
                ("rotate.2019-01-02_03-04-05_000006.3.log", "B\n"),
                ("rotate.log", "C\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081efac0>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex0')

tests/test_filesink_rotation.py:941: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 4
E            +  where 0 = len(set())
E            +  and   4 = len([('rotate.2019-01-02_03-04-05_000006.log', ''), ('rotate.2019-01-02_03-04-05_000006.2.log', 'A\n'), ('rotate.2019-01-02_03-04-05_000006.3.log', 'B\n'), ('rotate.log', 'C\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex0')
files      = [('rotate.2019-01-02_03-04-05_000006.log', ''), ('rotate.2019-01-02_03-04-05_000006.2.log', 'A\n'), ('rotate.2019-01-02_03-04-05_000006.3.log', 'B\n'), ('rotate.log', 'C\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_renaming_rotation_dest_exists_with_time

test_filesink_rotation.py::test_renaming_rotation_dest_exists_with_time
freeze_time = .freeze_time at 0x7fac081eeb00>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex1')

    def test_renaming_rotation_dest_exists_with_time(freeze_time, tmp_path):
        with freeze_time("2019-01-02 03:04:05.000006"):
            logger.add(
                tmp_path / "rotate.{time}.log", rotation=Mock(return_value=True), format="{message}"
            )
            logger.info("A")
            logger.info("B")
            logger.info("C")

>       check_dir(
            tmp_path,
            files=[
                ("rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.log", ""),
                ("rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.2.log", "A\n"),
                ("rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.3.log", "B\n"),
                ("rotate.2019-01-02_03-04-05_000006.log", "C\n"),
            ],
        )

freeze_time = .freeze_time at 0x7fac081eeb00>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex1')

tests/test_filesink_rotation.py:961: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex1')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 4
E            +  where 0 = len(set())
E            +  and   4 = len([('rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.log', ''), ('rotate.2019-01-02_03-04-05_000006.2019-01...2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.3.log', 'B\n'), ('rotate.2019-01-02_03-04-05_000006.log', 'C\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_renaming_rotation_dest_ex1')
files      = [('rotate.2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.log', ''), ('rotate.2019-01-02_03-04-05_000006.2019-01...2019-01-02_03-04-05_000006.2019-01-02_03-04-05_000006.3.log', 'B\n'), ('rotate.2019-01-02_03-04-05_000006.log', 'C\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_exception_during_rotation

test_filesink_rotation.py::test_exception_during_rotation
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_rotation0')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac09312110>

    def test_exception_during_rotation(tmp_path, capsys):
        logger.add(
            tmp_path / "test.log",
            rotation=Mock(side_effect=[Exception("Rotation error"), False]),
            format="{message}",
            catch=True,
        )

        logger.info("A")
        logger.info("B")

>       check_dir(tmp_path, files=[("test.log", "B\n")])

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac09312110>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_rotation0')

tests/test_filesink_rotation.py:983: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_rotation0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 1
E            +  where 0 = len(set())
E            +  and   1 = len([('test.log', 'B\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_rotation0')
files      = [('test.log', 'B\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_exception_during_rotation_not_caught

test_filesink_rotation.py::test_exception_during_rotation_not_caught
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_rotation1')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac088f0f70>

    def test_exception_during_rotation_not_caught(tmp_path, capsys):
        logger.add(
            tmp_path / "test.log",
            rotation=Mock(side_effect=[OSError("Rotation error"), False]),
            format="{message}",
            catch=False,
        )

>       with pytest.raises(OSError, match=r"Rotation error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac088f0f70>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_during_rotation1')

tests/test_filesink_rotation.py:999: Failed

test_filesink_rotation.py::test_recipe_rotation_both_size_and_time

test_filesink_rotation.py::test_recipe_rotation_both_size_and_time
freeze_time = .freeze_time at 0x7fac081ec1f0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_recipe_rotation_both_size0')

    def test_recipe_rotation_both_size_and_time(freeze_time, tmp_path):
        class Rotator:
            def __init__(self, *, size, at):
                now = datetime.datetime.now()

                self._size_limit = size
                self._time_limit = now.replace(hour=at.hour, minute=at.minute, second=at.second)

                if now >= self._time_limit:
                    # The current time is already past the target time so it would rotate already.
                    # Add one day to prevent an immediate rotation.
                    self._time_limit += datetime.timedelta(days=1)

            def should_rotate(self, message, file):
                file.seek(0, 2)
                if file.tell() + len(message) > self._size_limit:
                    return True
                excess = message.record["time"].timestamp() - self._time_limit.timestamp()
                if excess >= 0:
                    elapsed_days = datetime.timedelta(seconds=excess).days
                    self._time_limit += datetime.timedelta(days=elapsed_days + 1)
                    return True
                return False

        with freeze_time("2020-01-01 20:00:00") as frozen:
            rotator = Rotator(size=20, at=datetime.time(12, 0, 0))
            logger.add(tmp_path / "file.log", rotation=rotator.should_rotate, format="{message}")
            logger.info("A" * 15)
            frozen.tick()
            logger.info("B" * 10)
            frozen.move_to("2020-01-02 13:00:00")
            logger.info("C")
            frozen.move_to("2020-01-10 13:10:00")
            logger.info("D")
            logger.info("E")

>       check_dir(
            tmp_path,
            files=[
                ("file.2020-01-01_20-00-00_000000.log", "A" * 15 + "\n"),
                ("file.2020-01-01_20-00-01_000000.log", "B" * 10 + "\n"),
                ("file.2020-01-02_13-00-00_000000.log", "C\n"),
                ("file.log", "D\nE\n"),
            ],
        )

Rotator    = .Rotator'>
freeze_time = .freeze_time at 0x7fac081ec1f0>
frozen     = 
rotator    = .Rotator object at 0x7fac08383af0>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_recipe_rotation_both_size0')

tests/test_filesink_rotation.py:1046: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_recipe_rotation_both_size0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
            assert len(actual_files) == size
        if files is not None:
>           assert len(actual_files) == len(files)
E           AssertionError: assert 0 == 4
E            +  where 0 = len(set())
E            +  and   4 = len([('file.2020-01-01_20-00-00_000000.log', 'AAAAAAAAAAAAAAA\n'), ('file.2020-01-01_20-00-01_000000.log', 'BBBBBBBBBB\n'), ('file.2020-01-02_13-00-00_000000.log', 'C\n'), ('file.log', 'D\nE\n')])

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_recipe_rotation_both_size0')
files      = [('file.2020-01-01_20-00-00_000000.log', 'AAAAAAAAAAAAAAA\n'), ('file.2020-01-01_20-00-01_000000.log', 'BBBBBBBBBB\n'), ('file.2020-01-02_13-00-00_000000.log', 'C\n'), ('file.log', 'D\nE\n')]
seen       = set()
size       = None

tests/conftest.py:67: AssertionError

test_filesink_rotation.py::test_invalid_rotation[rotation0]

test_filesink_rotation.py::test_invalid_rotation[rotation0]
rotation = 

    @pytest.mark.parametrize(
        "rotation", [object(), os, datetime.date(2017, 11, 11), datetime.datetime.now(), 1j]
    )
    def test_invalid_rotation(rotation):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

rotation   = 

tests/test_filesink_rotation.py:1061: Failed


test_filesink_rotation.py::test_invalid_rotation[os]

test_filesink_rotation.py::test_invalid_rotation[os]
rotation = 

    @pytest.mark.parametrize(
        "rotation", [object(), os, datetime.date(2017, 11, 11), datetime.datetime.now(), 1j]
    )
    def test_invalid_rotation(rotation):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

rotation   = 

tests/test_filesink_rotation.py:1061: Failed

test_filesink_rotation.py::test_invalid_rotation[rotation2]

test_filesink_rotation.py::test_invalid_rotation[rotation2]
rotation = datetime.date(2017, 11, 11)

    @pytest.mark.parametrize(
        "rotation", [object(), os, datetime.date(2017, 11, 11), datetime.datetime.now(), 1j]
    )
    def test_invalid_rotation(rotation):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

rotation   = datetime.date(2017, 11, 11)

tests/test_filesink_rotation.py:1061: Failed

test_filesink_rotation.py::test_invalid_rotation[rotation3]

test_filesink_rotation.py::test_invalid_rotation[rotation3]
rotation = datetime.datetime(2024, 11, 29, 4, 33, 21, 593677)

    @pytest.mark.parametrize(
        "rotation", [object(), os, datetime.date(2017, 11, 11), datetime.datetime.now(), 1j]
    )
    def test_invalid_rotation(rotation):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

rotation   = datetime.datetime(2024, 11, 29, 4, 33, 21, 593677)

tests/test_filesink_rotation.py:1061: Failed

test_filesink_rotation.py::test_invalid_rotation[1j]

test_filesink_rotation.py::test_invalid_rotation[1j]
rotation = 1j

    @pytest.mark.parametrize(
        "rotation", [object(), os, datetime.date(2017, 11, 11), datetime.datetime.now(), 1j]
    )
    def test_invalid_rotation(rotation):
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE 

rotation   = 1j

tests/test_filesink_rotation.py:1061: Failed

test_filesink_rotation.py::test_unknown_rotation[w7]

test_filesink_rotation.py::test_unknown_rotation[w7]
rotation = 'w7'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'w7'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[w10]

test_filesink_rotation.py::test_unknown_rotation[w10]
rotation = 'w10'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'w10'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[w-1]

test_filesink_rotation.py::test_unknown_rotation[w-1]
rotation = 'w-1'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'w-1'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[h]

test_filesink_rotation.py::test_unknown_rotation[h]
rotation = 'h'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'h'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[M]

test_filesink_rotation.py::test_unknown_rotation[M]
rotation = 'M'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'M'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[w1at13]

test_filesink_rotation.py::test_unknown_rotation[w1at13]
rotation = 'w1at13'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'w1at13'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[www]

test_filesink_rotation.py::test_unknown_rotation[www]
rotation = 'www'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'www'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[13 at w2]

test_filesink_rotation.py::test_unknown_rotation[13 at w2]
rotation = '13 at w2'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '13 at w2'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[w]

test_filesink_rotation.py::test_unknown_rotation[w]
rotation = 'w'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'w'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[K]

test_filesink_rotation.py::test_unknown_rotation[K]
rotation = 'K'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'K'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[tufy MB]

test_filesink_rotation.py::test_unknown_rotation[tufy MB]
rotation = 'tufy MB'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'tufy MB'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[111.111.111 kb]

test_filesink_rotation.py::test_unknown_rotation[111.111.111 kb]
rotation = '111.111.111 kb'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '111.111.111 kb'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[3 Ki]

test_filesink_rotation.py::test_unknown_rotation[3 Ki]
rotation = '3 Ki'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '3 Ki'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[2017.11.12]

test_filesink_rotation.py::test_unknown_rotation[2017.11.12]
rotation = '2017.11.12'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '2017.11.12'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[11:99]

test_filesink_rotation.py::test_unknown_rotation[11:99]
rotation = '11:99'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '11:99'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[01:00:00!UTC]

test_filesink_rotation.py::test_unknown_rotation[01:00:00!UTC]
rotation = '01:00:00!UTC'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '01:00:00!UTC'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[monday at 2017]

test_filesink_rotation.py::test_unknown_rotation[monday at 2017]
rotation = 'monday at 2017'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'monday at 2017'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[e days]

test_filesink_rotation.py::test_unknown_rotation[e days]
rotation = 'e days'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'e days'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[2 days 8 pouooi]

test_filesink_rotation.py::test_unknown_rotation[2 days 8 pouooi]
rotation = '2 days 8 pouooi'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '2 days 8 pouooi'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[foobar]

test_filesink_rotation.py::test_unknown_rotation[foobar]
rotation = 'foobar'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'foobar'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[w5 at [not|a|time]]

test_filesink_rotation.py::test_unknown_rotation[w5 at [not|a|time]]
rotation = 'w5 at [not|a|time]'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = 'w5 at [not|a|time]'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[[not|a|day] at 12:00]

test_filesink_rotation.py::test_unknown_rotation[[not|a|day] at 12:00]
rotation = '[not|a|day] at 12:00'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '[not|a|day] at 12:00'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_rotation.py::test_unknown_rotation[dict]

test_filesink_rotation.py::test_unknown_rotation[__dict__]
rotation = '__dict__'

    @pytest.mark.parametrize(
        "rotation",
        [
            "w7",
            "w10",
            "w-1",
            "h",
            "M",
            "w1at13",
            "www",
            "13 at w2",
            "w",
            "K",
            "tufy MB",
            "111.111.111 kb",
            "3 Ki",
            "2017.11.12",
            "11:99",
            "01:00:00!UTC",
            "monday at 2017",
            "e days",
            "2 days 8 pouooi",
            "foobar",
            "w5 at [not|a|time]",
            "[not|a|day] at 12:00",
            "__dict__",
        ],
    )
    def test_unknown_rotation(rotation):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

rotation   = '__dict__'

tests/test_filesink_rotation.py:1094: Failed

test_filesink_watch.py::test_file_deleted_before_write_without_delay

test_filesink_watch.py::test_file_deleted_before_write_without_delay
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_deleted_before_write_without_delay(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", watch=True, delay=False)
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write0/test.log'

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write0')

tests/test_filesink_watch.py:15: FileNotFoundError

test_filesink_watch.py::test_file_deleted_before_write_with_delay

test_filesink_watch.py::test_file_deleted_before_write_with_delay
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write1')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_deleted_before_write_with_delay(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", watch=True, delay=True)
        logger.info("Test 1")
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write1/test.log'

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write1/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_write1')

tests/test_filesink_watch.py:25: FileNotFoundError

test_filesink_watch.py::test_file_path_containing_placeholder

test_filesink_watch.py::test_file_path_containing_placeholder
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_path_containing_plac0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_path_containing_placeholder(tmp_path):
        logger.add(tmp_path / "test_{time}.log", format="{message}", watch=True)
>       check_dir(tmp_path, size=1)

tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_path_containing_plac0')

tests/test_filesink_watch.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_path_containing_plac0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 1
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_path_containing_plac0')
files      = None
seen       = set()
size       = 1

tests/conftest.py:65: AssertionError

test_filesink_watch.py::test_file_reopened_with_arguments

test_filesink_watch.py::test_file_reopened_with_arguments
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_reopened_with_argume0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_reopened_with_arguments(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", watch=True, encoding="ascii", errors="replace")
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_reopened_with_argume0/test.log'

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_reopened_with_argume0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_reopened_with_argume0')

tests/test_filesink_watch.py:45: FileNotFoundError

test_filesink_watch.py::test_file_manually_changed

test_filesink_watch.py::test_file_manually_changed
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_manually_changed0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_manually_changed(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{message}", watch=True, mode="w")
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_manually_changed0/test.log'

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_manually_changed0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_manually_changed0')

tests/test_filesink_watch.py:54: FileNotFoundError

test_filesink_watch.py::test_file_folder_deleted

test_filesink_watch.py::test_file_folder_deleted
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_folder_deleted0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_folder_deleted(tmp_path):
        file = tmp_path / "foo/bar/test.log"
        logger.add(file, format="{message}", watch=True)
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_folder_deleted0/foo/bar/test.log'

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_folder_deleted0/foo/bar/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_folder_deleted0')

tests/test_filesink_watch.py:64: FileNotFoundError

test_filesink_watch.py::test_file_deleted_before_rotation

test_filesink_watch.py::test_file_deleted_before_rotation
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_rotat0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_deleted_before_rotation(tmp_path):
        exists = None
        file = tmp_path / "test.log"

        def rotate(_, __):
            nonlocal exists
            exists = file.exists()
            return False

        logger.add(file, format="{message}", watch=True, rotation=rotate)
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_deleted_before_rotat0/test.log'

exists     = None
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_rotat0/test.log')
rotate     = .rotate at 0x7fac081efc70>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_rotat0')

tests/test_filesink_watch.py:81: FileNotFoundError

test_filesink_watch.py::test_file_deleted_before_compression

test_filesink_watch.py::test_file_deleted_before_compression
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_compr0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_deleted_before_compression(tmp_path):
        exists = None
        file = tmp_path / "test.log"

        def compress(_):
            nonlocal exists
            exists = file.exists()
            return False

        logger.add(file, format="{message}", watch=True, compression=compress)
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_deleted_before_compr0/test.log'

compress   = .compress at 0x7fac081eeb00>
exists     = None
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_compr0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_compr0')

tests/test_filesink_watch.py:97: FileNotFoundError

test_filesink_watch.py::test_file_deleted_before_retention

test_filesink_watch.py::test_file_deleted_before_retention
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_reten0')

    @pytest.mark.skipif(os.name == "nt", reason="Windows can't delete file in use")
    def test_file_deleted_before_retention(tmp_path):
        exists = None
        file = tmp_path / "test.log"

        def retain(_):
            nonlocal exists
            exists = file.exists()
            return False

        logger.add(file, format="{message}", watch=True, retention=retain)
>       os.remove(str(file))
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_file_deleted_before_reten0/test.log'

exists     = None
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_reten0/test.log')
retain     = .retain at 0x7fac081ee170>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_deleted_before_reten0')

tests/test_filesink_watch.py:113: FileNotFoundError

test_filesink_watch.py::test_file_correctly_reused_after_rotation

test_filesink_watch.py::test_file_correctly_reused_after_rotation
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_correctly_reused_aft0')

    def test_file_correctly_reused_after_rotation(tmp_path):
        filepath = tmp_path / "test.log"
        logger.add(
            filepath,
            format="{message}",
            mode="w",
            watch=True,
            rotation=Mock(side_effect=[False, True, False]),
        )
        logger.info("Test 1")
        logger.info("Test 2")
        logger.info("Test 3")
>       check_dir(tmp_path, size=2)

filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_correctly_reused_aft0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_correctly_reused_aft0')

tests/test_filesink_watch.py:130: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_correctly_reused_aft0')

    def check_dir(dir, *, files=None, size=None):
        actual_files = set(dir.iterdir())
        seen = set()
        if size is not None:
>           assert len(actual_files) == size
E           assert 0 == 2
E            +  where 0 = len(set())

actual_files = set()
dir        = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_correctly_reused_aft0')
files      = None
seen       = set()
size       = 2

tests/conftest.py:65: AssertionError

test_filesink_watch.py::test_file_closed_without_being_logged[None-False]

test_filesink_watch.py::test_file_closed_without_being_logged[None-False]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being1')
delay = False, compression = None

    @pytest.mark.parametrize("delay", [True, False])
    @pytest.mark.parametrize("compression", [None, lambda _: None])
    def test_file_closed_without_being_logged(tmp_path, delay, compression):
        filepath = tmp_path / "test.log"
        logger.add(
            filepath,
            format="{message}",
            watch=True,
            delay=delay,
            compression=compression,
        )
        logger.remove()
>       assert filepath.exists() is (False if delay else True)
E       AssertionError: assert False is True
E        +  where False = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being1/test.log').exists

compression = None
delay      = False
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being1/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being1')

tests/test_filesink_watch.py:148: AssertionError

test_filesink_watch.py::test_file_closed_without_being_logged[-False]

test_filesink_watch.py::test_file_closed_without_being_logged[-False]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being3')
delay = False, compression =  at 0x7fac0bb0ca60>

    @pytest.mark.parametrize("delay", [True, False])
    @pytest.mark.parametrize("compression", [None, lambda _: None])
    def test_file_closed_without_being_logged(tmp_path, delay, compression):
        filepath = tmp_path / "test.log"
        logger.add(
            filepath,
            format="{message}",
            watch=True,
            delay=delay,
            compression=compression,
        )
        logger.remove()
>       assert filepath.exists() is (False if delay else True)
E       AssertionError: assert False is True
E        +  where False = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being3/test.log').exists

compression =  at 0x7fac0bb0ca60>
delay      = False
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being3/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_closed_without_being3')

tests/test_filesink_watch.py:148: AssertionError

test_formatting.py::test_log_formatters[False-{name}-]

test_formatting.py::test_log_formatters[False-{name}-]
format = '{name}', validator =  at 0x7fac0bb0d3f0>
writer = .w at 0x7fac0812c280>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d3f0>('')

format     = '{name}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d3f0>
writer     = .w at 0x7fac0812c280>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{time}-]

test_formatting.py::test_log_formatters[False-{time}-]
format = '{time}', validator =  at 0x7fac0bb0d5a0>
writer = .w at 0x7fac0812d090>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d5a0>('')

format     = '{time}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d5a0>
writer     = .w at 0x7fac0812d090>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{elapsed}-]

test_formatting.py::test_log_formatters[False-{elapsed}-]
format = '{elapsed}', validator =  at 0x7fac0bb0d630>
writer = .w at 0x7fac0812c940>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d630>('')

format     = '{elapsed}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d630>
writer     = .w at 0x7fac0812c940>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{elapsed.seconds}-]

test_formatting.py::test_log_formatters[False-{elapsed.seconds}-]
format = '{elapsed.seconds}', validator =  at 0x7fac0bb0d6c0>
writer = .w at 0x7fac0812cee0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d6c0>('')

format     = '{elapsed.seconds}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d6c0>
writer     = .w at 0x7fac0812cee0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{line}-]

test_formatting.py::test_log_formatters[False-{line}-]
format = '{line}', validator =  at 0x7fac0bb0d750>
writer = .w at 0x7fac0812d2d0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d750>('')

format     = '{line}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d750>
writer     = .w at 0x7fac0812d2d0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{level}-]

test_formatting.py::test_log_formatters[False-{level}-]
format = '{level}', validator =  at 0x7fac0bb0d7e0>
writer = .w at 0x7fac0812d6c0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d7e0>('')

format     = '{level}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d7e0>
writer     = .w at 0x7fac0812d6c0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{level.name}-]

test_formatting.py::test_log_formatters[False-{level.name}-]
format = '{level.name}', validator =  at 0x7fac0bb0d870>
writer = .w at 0x7fac081eff40>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d870>('')

format     = '{level.name}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d870>
writer     = .w at 0x7fac081eff40>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{level.no}-]

test_formatting.py::test_log_formatters[False-{level.no}-]
format = '{level.no}', validator =  at 0x7fac0bb0d900>
writer = .w at 0x7fac081eeb00>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d900>('')

format     = '{level.no}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d900>
writer     = .w at 0x7fac081eeb00>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{level.icon}-]

test_formatting.py::test_log_formatters[False-{level.icon}-]
format = '{level.icon}', validator =  at 0x7fac0bb0d990>
writer = .w at 0x7fac0812dea0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d990>('')

format     = '{level.icon}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0d990>
writer     = .w at 0x7fac0812dea0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{file}-]

test_formatting.py::test_log_formatters[False-{file}-]
format = '{file}', validator =  at 0x7fac0bb0da20>
writer = .w at 0x7fac081eeb00>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0da20>('')

format     = '{file}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0da20>
writer     = .w at 0x7fac081eeb00>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{file.name}-]

test_formatting.py::test_log_formatters[False-{file.name}-]
format = '{file.name}', validator =  at 0x7fac0bb0dab0>
writer = .w at 0x7fac0812d090>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dab0>('')

format     = '{file.name}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dab0>
writer     = .w at 0x7fac0812d090>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{file.path}-]

test_formatting.py::test_log_formatters[False-{file.path}-]
format = '{file.path}', validator =  at 0x7fac0bb0db40>
writer = .w at 0x7fac0812d480>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0db40>('')

format     = '{file.path}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0db40>
writer     = .w at 0x7fac0812d480>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{function}-]

test_formatting.py::test_log_formatters[False-{function}-]
format = '{function}', validator =  at 0x7fac0bb0dbd0>
writer = .w at 0x7fac081eff40>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dbd0>('')

format     = '{function}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dbd0>
writer     = .w at 0x7fac081eff40>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{module}-]

test_formatting.py::test_log_formatters[False-{module}-]
format = '{module}', validator =  at 0x7fac0bb0dc60>
writer = .w at 0x7fac0812e5f0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dc60>('')

format     = '{module}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dc60>
writer     = .w at 0x7fac0812e5f0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{thread}-]

test_formatting.py::test_log_formatters[False-{thread}-]
format = '{thread}', validator =  at 0x7fac0bb0dcf0>
writer = .w at 0x7fac0812e290>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0dcf0>('')

format     = '{thread}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dcf0>
writer     = .w at 0x7fac0812e290>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{thread.id}-]

test_formatting.py::test_log_formatters[False-{thread.id}-]
format = '{thread.id}', validator =  at 0x7fac0bb0dd80>
writer = .w at 0x7fac0812c550>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0dd80>('')

format     = '{thread.id}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dd80>
writer     = .w at 0x7fac0812c550>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{thread.name}-]

test_formatting.py::test_log_formatters[False-{thread.name}-]
format = '{thread.name}', validator =  at 0x7fac0bb0de10>
writer = .w at 0x7fac0812e830>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0de10>('')

format     = '{thread.name}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0de10>
writer     = .w at 0x7fac0812e830>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{process}-]

test_formatting.py::test_log_formatters[False-{process}-]
format = '{process}', validator =  at 0x7fac0bb0dea0>
writer = .w at 0x7fac0812e950>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0dea0>('')

format     = '{process}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dea0>
writer     = .w at 0x7fac0812e950>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{process.id}-]

test_formatting.py::test_log_formatters[False-{process.id}-]
format = '{process.id}', validator =  at 0x7fac0bb0df30>
writer = .w at 0x7fac0812ecb0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0df30>('')

format     = '{process.id}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0df30>
writer     = .w at 0x7fac0812ecb0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{process.name}-]

test_formatting.py::test_log_formatters[False-{process.name}-]
format = '{process.name}', validator =  at 0x7fac0bb0dfc0>
writer = .w at 0x7fac0812e0e0>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dfc0>('')

format     = '{process.name}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0dfc0>
writer     = .w at 0x7fac0812e0e0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-{message}-]

test_formatting.py::test_log_formatters[False-{message}-]
format = '{message}', validator =  at 0x7fac0bb0e050>
writer = .w at 0x7fac0812ef80>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0e050>('')

format     = '{message}'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0e050>
writer     = .w at 0x7fac0812ef80>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[False-%s {{a}} \u5929 {{1}} %d-]

test_formatting.py::test_log_formatters[False-%s {{a}} \u5929 {{1}} %d-]
format = '%s {{a}} 天 {{1}} %d'
validator =  at 0x7fac0bb0e0e0>
writer = .w at 0x7fac0812f130>
use_log_function = False

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0e0e0>('')

format     = '%s {{a}} 天 {{1}} %d'
message    = 'Message'
result     = ''
use_log_function = False
validator  =  at 0x7fac0bb0e0e0>
writer     = .w at 0x7fac0812f130>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{name}-]

test_formatting.py::test_log_formatters[True-{name}-]
format = '{name}', validator =  at 0x7fac0bb0d3f0>
writer = .w at 0x7fac0812f6d0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d3f0>('')

format     = '{name}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d3f0>
writer     = .w at 0x7fac0812f6d0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{time}-]

test_formatting.py::test_log_formatters[True-{time}-]
format = '{time}', validator =  at 0x7fac0bb0d5a0>
writer = .w at 0x7fac0812e5f0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d5a0>('')

format     = '{time}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d5a0>
writer     = .w at 0x7fac0812e5f0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{elapsed}-]

test_formatting.py::test_log_formatters[True-{elapsed}-]
format = '{elapsed}', validator =  at 0x7fac0bb0d630>
writer = .w at 0x7fac0812fa30>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d630>('')

format     = '{elapsed}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d630>
writer     = .w at 0x7fac0812fa30>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{elapsed.seconds}-]

test_formatting.py::test_log_formatters[True-{elapsed.seconds}-]
format = '{elapsed.seconds}', validator =  at 0x7fac0bb0d6c0>
writer = .w at 0x7fac0812f0a0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d6c0>('')

format     = '{elapsed.seconds}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d6c0>
writer     = .w at 0x7fac0812f0a0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{line}-]

test_formatting.py::test_log_formatters[True-{line}-]
format = '{line}', validator =  at 0x7fac0bb0d750>
writer = .w at 0x7fac07d043a0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0d750>('')

format     = '{line}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d750>
writer     = .w at 0x7fac07d043a0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{level}-]

test_formatting.py::test_log_formatters[True-{level}-]
format = '{level}', validator =  at 0x7fac0bb0d7e0>
writer = .w at 0x7fac0812fa30>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d7e0>('')

format     = '{level}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d7e0>
writer     = .w at 0x7fac0812fa30>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{level.name}-]

test_formatting.py::test_log_formatters[True-{level.name}-]
format = '{level.name}', validator =  at 0x7fac0bb0d870>
writer = .w at 0x7fac07d04670>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d870>('')

format     = '{level.name}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d870>
writer     = .w at 0x7fac07d04670>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{level.no}-]

test_formatting.py::test_log_formatters[True-{level.no}-]
format = '{level.no}', validator =  at 0x7fac0bb0d900>
writer = .w at 0x7fac07d04280>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d900>('')

format     = '{level.no}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d900>
writer     = .w at 0x7fac07d04280>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{level.icon}-]

test_formatting.py::test_log_formatters[True-{level.icon}-]
format = '{level.icon}', validator =  at 0x7fac0bb0d990>
writer = .w at 0x7fac0812f6d0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0d990>('')

format     = '{level.icon}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0d990>
writer     = .w at 0x7fac0812f6d0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{file}-]

test_formatting.py::test_log_formatters[True-{file}-]
format = '{file}', validator =  at 0x7fac0bb0da20>
writer = .w at 0x7fac07d051b0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0da20>('')

format     = '{file}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0da20>
writer     = .w at 0x7fac07d051b0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{file.name}-]

test_formatting.py::test_log_formatters[True-{file.name}-]
format = '{file.name}', validator =  at 0x7fac0bb0dab0>
writer = .w at 0x7fac07d05120>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dab0>('')

format     = '{file.name}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dab0>
writer     = .w at 0x7fac07d05120>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{file.path}-]

test_formatting.py::test_log_formatters[True-{file.path}-]
format = '{file.path}', validator =  at 0x7fac0bb0db40>
writer = .w at 0x7fac07d04ca0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0db40>('')

format     = '{file.path}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0db40>
writer     = .w at 0x7fac07d04ca0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{function}-]

test_formatting.py::test_log_formatters[True-{function}-]
format = '{function}', validator =  at 0x7fac0bb0dbd0>
writer = .w at 0x7fac07d05510>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dbd0>('')

format     = '{function}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dbd0>
writer     = .w at 0x7fac07d05510>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{module}-]

test_formatting.py::test_log_formatters[True-{module}-]
format = '{module}', validator =  at 0x7fac0bb0dc60>
writer = .w at 0x7fac07d05630>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dc60>('')

format     = '{module}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dc60>
writer     = .w at 0x7fac07d05630>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{thread}-]

test_formatting.py::test_log_formatters[True-{thread}-]
format = '{thread}', validator =  at 0x7fac0bb0dcf0>
writer = .w at 0x7fac07d05990>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0dcf0>('')

format     = '{thread}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dcf0>
writer     = .w at 0x7fac07d05990>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{thread.id}-]

test_formatting.py::test_log_formatters[True-{thread.id}-]
format = '{thread.id}', validator =  at 0x7fac0bb0dd80>
writer = .w at 0x7fac07d04dc0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0dd80>('')

format     = '{thread.id}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dd80>
writer     = .w at 0x7fac07d04dc0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{thread.name}-]

test_formatting.py::test_log_formatters[True-{thread.name}-]
format = '{thread.name}', validator =  at 0x7fac0bb0de10>
writer = .w at 0x7fac07d05c60>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0de10>('')

format     = '{thread.name}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0de10>
writer     = .w at 0x7fac07d05c60>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{process}-]

test_formatting.py::test_log_formatters[True-{process}-]
format = '{process}', validator =  at 0x7fac0bb0dea0>
writer = .w at 0x7fac07d05240>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0dea0>('')

format     = '{process}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dea0>
writer     = .w at 0x7fac07d05240>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{process.id}-]

test_formatting.py::test_log_formatters[True-{process.id}-]
format = '{process.id}', validator =  at 0x7fac0bb0df30>
writer = .w at 0x7fac07d053f0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert None
E        +  where None =  at 0x7fac0bb0df30>('')

format     = '{process.id}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0df30>
writer     = .w at 0x7fac07d053f0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{process.name}-]

test_formatting.py::test_log_formatters[True-{process.name}-]
format = '{process.name}', validator =  at 0x7fac0bb0dfc0>
writer = .w at 0x7fac07d063b0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0dfc0>('')

format     = '{process.name}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0dfc0>
writer     = .w at 0x7fac07d063b0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-{message}-]

test_formatting.py::test_log_formatters[True-{message}-]
format = '{message}', validator =  at 0x7fac0bb0e050>
writer = .w at 0x7fac07d06710>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0e050>('')

format     = '{message}'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0e050>
writer     = .w at 0x7fac07d06710>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_log_formatters[True-%s {{a}} \u5929 {{1}} %d-]

test_formatting.py::test_log_formatters[True-%s {{a}} \u5929 {{1}} %d-]
format = '%s {{a}} 天 {{1}} %d'
validator =  at 0x7fac0bb0e0e0>
writer = .w at 0x7fac07d05ab0>, use_log_function = True

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{name}", lambda r: r == "tests.test_formatting"),
            ("{time}", lambda r: re.fullmatch(r"\d+-\d+-\d+T\d+:\d+:\d+[.,]\d+[+-]\d{4}", r)),
            ("{elapsed}", lambda r: re.fullmatch(r"\d:\d{2}:\d{2}\.\d{6}", r)),
            ("{elapsed.seconds}", lambda r: re.fullmatch(r"\d+", r)),
            ("{line}", lambda r: re.fullmatch(r"\d+", r)),
            ("{level}", lambda r: r == "DEBUG"),
            ("{level.name}", lambda r: r == "DEBUG"),
            ("{level.no}", lambda r: r == "10"),
            ("{level.icon}", lambda r: r == "🐞"),
            ("{file}", lambda r: r == "test_formatting.py"),
            ("{file.name}", lambda r: r == "test_formatting.py"),
            ("{file.path}", lambda r: os.path.normcase(r) == os.path.normcase(__file__)),
            ("{function}", lambda r: r == "test_log_formatters"),
            ("{module}", lambda r: r == "test_formatting"),
            ("{thread}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{thread.name}", lambda r: isinstance(r, str) and r != ""),
            ("{process}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.id}", lambda r: re.fullmatch(r"\d+", r)),
            ("{process.name}", lambda r: isinstance(r, str) and r != ""),
            ("{message}", lambda r: r == "Message"),
            ("%s {{a}} 天 {{1}} %d", lambda r: r == "%s {a} 天 {1} %d"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatters(format, validator, writer, use_log_function):
        message = "Message"

        logger.add(writer, format=format)

        if use_log_function:
            logger.log("DEBUG", message)
        else:
            logger.debug(message)

        result = writer.read().rstrip("\n")
>       assert validator(result)
E       AssertionError: assert False
E        +  where False =  at 0x7fac0bb0e0e0>('')

format     = '%s {{a}} 天 {{1}} %d'
message    = 'Message'
result     = ''
use_log_function = True
validator  =  at 0x7fac0bb0e0e0>
writer     = .w at 0x7fac07d05ab0>

tests/test_formatting.py:48: AssertionError

test_formatting.py::test_file_formatters[file-{time}.log-]

test_formatting.py::test_file_formatters[file-{time}.log-]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_file__tim0')
format = '{time}.log', validator =  at 0x7fac0bb0e200>
part = 'file'

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{time}.log", lambda r: re.fullmatch(r"\d+-\d+-\d+_\d+-\d+-\d+\_\d+.log", r)),
            ("%s_{{a}}_天_{{1}}_%d", lambda r: r == "%s_{a}_天_{1}_%d"),
        ],
    )
    @pytest.mark.parametrize("part", ["file", "dir", "both"])
    def test_file_formatters(tmp_path, format, validator, part):
        if part == "file":
            file = tmp_path.joinpath(format)
        elif part == "dir":
            file = tmp_path.joinpath(format, "log.log")
        elif part == "both":
            file = tmp_path.joinpath(format, format)

        logger.add(file)
        logger.debug("Message")

        files = [f for f in tmp_path.glob("**/*") if f.is_file()]

>       assert len(files) == 1
E       assert 0 == 1
E        +  where 0 = len([])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_file__tim0/{time}.log')
files      = []
format     = '{time}.log'
part       = 'file'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_file__tim0')
validator  =  at 0x7fac0bb0e200>

tests/test_formatting.py:72: AssertionError

test_formatting.py::test_file_formatters[file-%s_{{a}}\u5929{{1}}_%d-]

test_formatting.py::test_file_formatters[file-%s_{{a}}_\u5929_{{1}}_%d-]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_file__s__0')
format = '%s_{{a}}_天_{{1}}_%d'
validator =  at 0x7fac0bb0e290>, part = 'file'

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{time}.log", lambda r: re.fullmatch(r"\d+-\d+-\d+_\d+-\d+-\d+\_\d+.log", r)),
            ("%s_{{a}}_天_{{1}}_%d", lambda r: r == "%s_{a}_天_{1}_%d"),
        ],
    )
    @pytest.mark.parametrize("part", ["file", "dir", "both"])
    def test_file_formatters(tmp_path, format, validator, part):
        if part == "file":
            file = tmp_path.joinpath(format)
        elif part == "dir":
            file = tmp_path.joinpath(format, "log.log")
        elif part == "both":
            file = tmp_path.joinpath(format, format)

        logger.add(file)
        logger.debug("Message")

        files = [f for f in tmp_path.glob("**/*") if f.is_file()]

>       assert len(files) == 1
E       assert 0 == 1
E        +  where 0 = len([])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_file__s__0/%s_{{a}}_天_{{1}}_%d')
files      = []
format     = '%s_{{a}}_天_{{1}}_%d'
part       = 'file'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_file__s__0')
validator  =  at 0x7fac0bb0e290>

tests/test_formatting.py:72: AssertionError

test_formatting.py::test_file_formatters[dir-{time}.log-]

test_formatting.py::test_file_formatters[dir-{time}.log-]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_dir__time0')
format = '{time}.log', validator =  at 0x7fac0bb0e200>
part = 'dir'

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{time}.log", lambda r: re.fullmatch(r"\d+-\d+-\d+_\d+-\d+-\d+\_\d+.log", r)),
            ("%s_{{a}}_天_{{1}}_%d", lambda r: r == "%s_{a}_天_{1}_%d"),
        ],
    )
    @pytest.mark.parametrize("part", ["file", "dir", "both"])
    def test_file_formatters(tmp_path, format, validator, part):
        if part == "file":
            file = tmp_path.joinpath(format)
        elif part == "dir":
            file = tmp_path.joinpath(format, "log.log")
        elif part == "both":
            file = tmp_path.joinpath(format, format)

        logger.add(file)
        logger.debug("Message")

        files = [f for f in tmp_path.glob("**/*") if f.is_file()]

>       assert len(files) == 1
E       assert 0 == 1
E        +  where 0 = len([])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_dir__time0/{time}.log/log.log')
files      = []
format     = '{time}.log'
part       = 'dir'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_dir__time0')
validator  =  at 0x7fac0bb0e200>

tests/test_formatting.py:72: AssertionError

test_formatting.py::test_file_formatters[dir-%s_{{a}}\u5929{{1}}_%d-]

test_formatting.py::test_file_formatters[dir-%s_{{a}}_\u5929_{{1}}_%d-]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_dir__s___0')
format = '%s_{{a}}_天_{{1}}_%d'
validator =  at 0x7fac0bb0e290>, part = 'dir'

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{time}.log", lambda r: re.fullmatch(r"\d+-\d+-\d+_\d+-\d+-\d+\_\d+.log", r)),
            ("%s_{{a}}_天_{{1}}_%d", lambda r: r == "%s_{a}_天_{1}_%d"),
        ],
    )
    @pytest.mark.parametrize("part", ["file", "dir", "both"])
    def test_file_formatters(tmp_path, format, validator, part):
        if part == "file":
            file = tmp_path.joinpath(format)
        elif part == "dir":
            file = tmp_path.joinpath(format, "log.log")
        elif part == "both":
            file = tmp_path.joinpath(format, format)

        logger.add(file)
        logger.debug("Message")

        files = [f for f in tmp_path.glob("**/*") if f.is_file()]

>       assert len(files) == 1
E       assert 0 == 1
E        +  where 0 = len([])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_dir__s___0/%s_{{a}}_天_{{1}}_%d/log.log')
files      = []
format     = '%s_{{a}}_天_{{1}}_%d'
part       = 'dir'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_dir__s___0')
validator  =  at 0x7fac0bb0e290>

tests/test_formatting.py:72: AssertionError

test_formatting.py::test_file_formatters[both-{time}.log-]

test_formatting.py::test_file_formatters[both-{time}.log-]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_both__tim0')
format = '{time}.log', validator =  at 0x7fac0bb0e200>
part = 'both'

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{time}.log", lambda r: re.fullmatch(r"\d+-\d+-\d+_\d+-\d+-\d+\_\d+.log", r)),
            ("%s_{{a}}_天_{{1}}_%d", lambda r: r == "%s_{a}_天_{1}_%d"),
        ],
    )
    @pytest.mark.parametrize("part", ["file", "dir", "both"])
    def test_file_formatters(tmp_path, format, validator, part):
        if part == "file":
            file = tmp_path.joinpath(format)
        elif part == "dir":
            file = tmp_path.joinpath(format, "log.log")
        elif part == "both":
            file = tmp_path.joinpath(format, format)

        logger.add(file)
        logger.debug("Message")

        files = [f for f in tmp_path.glob("**/*") if f.is_file()]

>       assert len(files) == 1
E       assert 0 == 1
E        +  where 0 = len([])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_both__tim0/{time}.log/{time}.log')
files      = []
format     = '{time}.log'
part       = 'both'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_both__tim0')
validator  =  at 0x7fac0bb0e200>

tests/test_formatting.py:72: AssertionError

test_formatting.py::test_file_formatters[both-%s_{{a}}\u5929{{1}}_%d-]

test_formatting.py::test_file_formatters[both-%s_{{a}}_\u5929_{{1}}_%d-]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_both__s__0')
format = '%s_{{a}}_天_{{1}}_%d'
validator =  at 0x7fac0bb0e290>, part = 'both'

    @pytest.mark.parametrize(
        "format, validator",
        [
            ("{time}.log", lambda r: re.fullmatch(r"\d+-\d+-\d+_\d+-\d+-\d+\_\d+.log", r)),
            ("%s_{{a}}_天_{{1}}_%d", lambda r: r == "%s_{a}_天_{1}_%d"),
        ],
    )
    @pytest.mark.parametrize("part", ["file", "dir", "both"])
    def test_file_formatters(tmp_path, format, validator, part):
        if part == "file":
            file = tmp_path.joinpath(format)
        elif part == "dir":
            file = tmp_path.joinpath(format, "log.log")
        elif part == "both":
            file = tmp_path.joinpath(format, format)

        logger.add(file)
        logger.debug("Message")

        files = [f for f in tmp_path.glob("**/*") if f.is_file()]

>       assert len(files) == 1
E       assert 0 == 1
E        +  where 0 = len([])

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_both__s__0/%s_{{a}}_天_{{1}}_%d/%s_{{a}}_天_{{1}}_%d')
files      = []
format     = '%s_{{a}}_天_{{1}}_%d'
part       = 'both'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_formatters_both__s__0')
validator  =  at 0x7fac0bb0e290>

tests/test_formatting.py:72: AssertionError

test_formatting.py::test_log_formatting[False-{1, 2, 3} - {0} - {-args0-kwargs0-{1, 2, 3} - {0} - {]

test_formatting.py::test_log_formatting[False-{1, 2, 3} - {0} - {-args0-kwargs0-{1, 2, 3} - {0} - {]
writer = .w at 0x7fac0812fd90>
message = '{1, 2, 3} - {0} - {', args = [], kwargs = {}
expected = '{1, 2, 3} - {0} - {', use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '{1, 2, 3} - {0} - {\n'
E         
E         - {1, 2, 3} - {0} - {

args       = []
expected   = '{1, 2, 3} - {0} - {'
kwargs     = {}
message    = '{1, 2, 3} - {0} - {'
use_log_function = False
writer     = .w at 0x7fac0812fd90>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{} + {} = {}-args1-kwargs1-1 + 2 = 3]

test_formatting.py::test_log_formatting[False-{} + {} = {}-args1-kwargs1-1 + 2 = 3]
writer = .w at 0x7fac0812e5f0>
message = '{} + {} = {}', args = [1, 2, 3], kwargs = {}, expected = '1 + 2 = 3'
use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1 + 2 = 3\n'
E         
E         - 1 + 2 = 3

args       = [1, 2, 3]
expected   = '1 + 2 = 3'
kwargs     = {}
message    = '{} + {} = {}'
use_log_function = False
writer     = .w at 0x7fac0812e5f0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{a} + {b} = {c}-args2-kwargs2-1 + 2 = 3]

test_formatting.py::test_log_formatting[False-{a} + {b} = {c}-args2-kwargs2-1 + 2 = 3]
writer = .w at 0x7fac0812d2d0>
message = '{a} + {b} = {c}', args = [], kwargs = {'a': 1, 'b': 2, 'c': 3}
expected = '1 + 2 = 3', use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1 + 2 = 3\n'
E         
E         - 1 + 2 = 3

args       = []
expected   = '1 + 2 = 3'
kwargs     = {'a': 1, 'b': 2, 'c': 3}
message    = '{a} + {b} = {c}'
use_log_function = False
writer     = .w at 0x7fac0812d2d0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{0} + {two} = {1}-args3-kwargs3-1 + 2 = 3]

test_formatting.py::test_log_formatting[False-{0} + {two} = {1}-args3-kwargs3-1 + 2 = 3]
writer = .w at 0x7fac0812e560>
message = '{0} + {two} = {1}', args = [1, 3], kwargs = {'nope': 4, 'two': 2}
expected = '1 + 2 = 3', use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1 + 2 = 3\n'
E         
E         - 1 + 2 = 3

args       = [1, 3]
expected   = '1 + 2 = 3'
kwargs     = {'nope': 4, 'two': 2}
message    = '{0} + {two} = {1}'
use_log_function = False
writer     = .w at 0x7fac0812e560>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{self} or {message} or {level}-args4-kwargs4-a or b or c]

test_formatting.py::test_log_formatting[False-{self} or {message} or {level}-args4-kwargs4-a or b or c]
writer = .w at 0x7fac07d06b00>
message = '{self} or {message} or {level}', args = []
kwargs = {'level': 'c', 'message': 'b', 'self': 'a'}, expected = 'a or b or c'
use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == 'a or b or c\n'
E         
E         - a or b or c

args       = []
expected   = 'a or b or c'
kwargs     = {'level': 'c', 'message': 'b', 'self': 'a'}
message    = '{self} or {message} or {level}'
use_log_function = False
writer     = .w at 0x7fac07d06b00>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{:.2f}-args5-kwargs5-1.00]

test_formatting.py::test_log_formatting[False-{:.2f}-args5-kwargs5-1.00]
writer = .w at 0x7fac0812f0a0>, message = '{:.2f}'
args = [1], kwargs = {}, expected = '1.00', use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1.00\n'
E         
E         - 1.00

args       = [1]
expected   = '1.00'
kwargs     = {}
message    = '{:.2f}'
use_log_function = False
writer     = .w at 0x7fac0812f0a0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{0:0{three}d}-args6-kwargs6-005]

test_formatting.py::test_log_formatting[False-{0:0{three}d}-args6-kwargs6-005]
writer = .w at 0x7fac0812d6c0>
message = '{0:0{three}d}', args = [5], kwargs = {'three': 3}, expected = '005'
use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '005\n'
E         
E         - 005

args       = [5]
expected   = '005'
kwargs     = {'three': 3}
message    = '{0:0{three}d}'
use_log_function = False
writer     = .w at 0x7fac0812d6c0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[False-{{nope}} {my_dict} {}-args7-kwargs7-{nope} {'a': 1} {{!}}]

test_formatting.py::test_log_formatting[False-{{nope}} {my_dict} {}-args7-kwargs7-{nope} {'a': 1} {{!}}]
writer = .w at 0x7fac07d05ab0>
message = '{{nope}} {my_dict} {}', args = ['{{!}}']
kwargs = {'my_dict': {'a': 1}}, expected = "{nope} {'a': 1} {{!}}"
use_log_function = False

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       assert '' == "{nope} {'a': 1} {{!}}\n"
E         
E         - {nope} {'a': 1} {{!}}

args       = ['{{!}}']
expected   = "{nope} {'a': 1} {{!}}"
kwargs     = {'my_dict': {'a': 1}}
message    = '{{nope}} {my_dict} {}'
use_log_function = False
writer     = .w at 0x7fac07d05ab0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{1, 2, 3} - {0} - {-args0-kwargs0-{1, 2, 3} - {0} - {]

test_formatting.py::test_log_formatting[True-{1, 2, 3} - {0} - {-args0-kwargs0-{1, 2, 3} - {0} - {]
writer = .w at 0x7fac0812d7e0>
message = '{1, 2, 3} - {0} - {', args = [], kwargs = {}
expected = '{1, 2, 3} - {0} - {', use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '{1, 2, 3} - {0} - {\n'
E         
E         - {1, 2, 3} - {0} - {

args       = []
expected   = '{1, 2, 3} - {0} - {'
kwargs     = {}
message    = '{1, 2, 3} - {0} - {'
use_log_function = True
writer     = .w at 0x7fac0812d7e0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{} + {} = {}-args1-kwargs1-1 + 2 = 3]

test_formatting.py::test_log_formatting[True-{} + {} = {}-args1-kwargs1-1 + 2 = 3]
writer = .w at 0x7fac07d06f80>
message = '{} + {} = {}', args = [1, 2, 3], kwargs = {}, expected = '1 + 2 = 3'
use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1 + 2 = 3\n'
E         
E         - 1 + 2 = 3

args       = [1, 2, 3]
expected   = '1 + 2 = 3'
kwargs     = {}
message    = '{} + {} = {}'
use_log_function = True
writer     = .w at 0x7fac07d06f80>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{a} + {b} = {c}-args2-kwargs2-1 + 2 = 3]

test_formatting.py::test_log_formatting[True-{a} + {b} = {c}-args2-kwargs2-1 + 2 = 3]
writer = .w at 0x7fac07d07130>
message = '{a} + {b} = {c}', args = [], kwargs = {'a': 1, 'b': 2, 'c': 3}
expected = '1 + 2 = 3', use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1 + 2 = 3\n'
E         
E         - 1 + 2 = 3

args       = []
expected   = '1 + 2 = 3'
kwargs     = {'a': 1, 'b': 2, 'c': 3}
message    = '{a} + {b} = {c}'
use_log_function = True
writer     = .w at 0x7fac07d07130>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{0} + {two} = {1}-args3-kwargs3-1 + 2 = 3]

test_formatting.py::test_log_formatting[True-{0} + {two} = {1}-args3-kwargs3-1 + 2 = 3]
writer = .w at 0x7fac07d05630>
message = '{0} + {two} = {1}', args = [1, 3], kwargs = {'nope': 4, 'two': 2}
expected = '1 + 2 = 3', use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1 + 2 = 3\n'
E         
E         - 1 + 2 = 3

args       = [1, 3]
expected   = '1 + 2 = 3'
kwargs     = {'nope': 4, 'two': 2}
message    = '{0} + {two} = {1}'
use_log_function = True
writer     = .w at 0x7fac07d05630>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{self} or {message} or {level}-args4-kwargs4-a or b or c]

test_formatting.py::test_log_formatting[True-{self} or {message} or {level}-args4-kwargs4-a or b or c]
writer = .w at 0x7fac07d05c60>
message = '{self} or {message} or {level}', args = []
kwargs = {'level': 'c', 'message': 'b', 'self': 'a'}, expected = 'a or b or c'
use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == 'a or b or c\n'
E         
E         - a or b or c

args       = []
expected   = 'a or b or c'
kwargs     = {'level': 'c', 'message': 'b', 'self': 'a'}
message    = '{self} or {message} or {level}'
use_log_function = True
writer     = .w at 0x7fac07d05c60>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{:.2f}-args5-kwargs5-1.00]

test_formatting.py::test_log_formatting[True-{:.2f}-args5-kwargs5-1.00]
writer = .w at 0x7fac07d065f0>, message = '{:.2f}'
args = [1], kwargs = {}, expected = '1.00', use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '1.00\n'
E         
E         - 1.00

args       = [1]
expected   = '1.00'
kwargs     = {}
message    = '{:.2f}'
use_log_function = True
writer     = .w at 0x7fac07d065f0>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{0:0{three}d}-args6-kwargs6-005]

test_formatting.py::test_log_formatting[True-{0:0{three}d}-args6-kwargs6-005]
writer = .w at 0x7fac07d05090>
message = '{0:0{three}d}', args = [5], kwargs = {'three': 3}, expected = '005'
use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       AssertionError: assert '' == '005\n'
E         
E         - 005

args       = [5]
expected   = '005'
kwargs     = {'three': 3}
message    = '{0:0{three}d}'
use_log_function = True
writer     = .w at 0x7fac07d05090>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_log_formatting[True-{{nope}} {my_dict} {}-args7-kwargs7-{nope} {'a': 1} {{!}}]

test_formatting.py::test_log_formatting[True-{{nope}} {my_dict} {}-args7-kwargs7-{nope} {'a': 1} {{!}}]
writer = .w at 0x7fac07d05c60>
message = '{{nope}} {my_dict} {}', args = ['{{!}}']
kwargs = {'my_dict': {'a': 1}}, expected = "{nope} {'a': 1} {{!}}"
use_log_function = True

    @pytest.mark.parametrize(
        "message, args, kwargs, expected",
        [
            ("{1, 2, 3} - {0} - {", [], {}, "{1, 2, 3} - {0} - {"),
            ("{} + {} = {}", [1, 2, 3], {}, "1 + 2 = 3"),
            ("{a} + {b} = {c}", [], dict(a=1, b=2, c=3), "1 + 2 = 3"),
            ("{0} + {two} = {1}", [1, 3], dict(two=2, nope=4), "1 + 2 = 3"),
            (
                "{self} or {message} or {level}",
                [],
                dict(self="a", message="b", level="c"),
                "a or b or c",
            ),
            ("{:.2f}", [1], {}, "1.00"),
            ("{0:0{three}d}", [5], dict(three=3), "005"),
            ("{{nope}} {my_dict} {}", ["{{!}}"], dict(my_dict={"a": 1}), "{nope} {'a': 1} {{!}}"),
        ],
    )
    @pytest.mark.parametrize("use_log_function", [False, True])
    def test_log_formatting(writer, message, args, kwargs, expected, use_log_function):
        logger.add(writer, format="{message}", colorize=False)

        if use_log_function:
            logger.log(10, message, *args, **kwargs)
        else:
            logger.debug(message, *args, **kwargs)

>       assert writer.read() == expected + "\n"
E       assert '' == "{nope} {'a': 1} {{!}}\n"
E         
E         - {nope} {'a': 1} {{!}}

args       = ['{{!}}']
expected   = "{nope} {'a': 1} {{!}}"
kwargs     = {'my_dict': {'a': 1}}
message    = '{{nope}} {my_dict} {}'
use_log_function = True
writer     = .w at 0x7fac07d05c60>

tests/test_formatting.py:113: AssertionError

test_formatting.py::test_f_globals_name_absent

test_formatting.py::test_f_globals_name_absent
writer = .w at 0x7fac07d043a0>
f_globals_name_absent = None

    def test_f_globals_name_absent(writer, f_globals_name_absent):
        logger.add(writer, format="{name} {message}", colorize=False)
        logger.info("Foobar")
>       assert writer.read() == "None Foobar\n"
E       AssertionError: assert '' == 'None Foobar\n'
E         
E         - None Foobar

f_globals_name_absent = None
writer     = .w at 0x7fac07d043a0>

tests/test_formatting.py:119: AssertionError

test_formatting.py::test_extra_formatting

test_formatting.py::test_extra_formatting
writer = .w at 0x7fac07d06950>

    def test_extra_formatting(writer):
        logger.configure(extra={"test": "my_test", "dict": {"a": 10}})
        logger.add(writer, format="{extra[test]} -> {extra[dict]} -> {message}")
        logger.debug("level: {name}", name="DEBUG")
>       assert writer.read() == "my_test -> {'a': 10} -> level: DEBUG\n"
E       assert '' == "my_test -> {...evel: DEBUG\n"
E         
E         - my_test -> {'a': 10} -> level: DEBUG

writer     = .w at 0x7fac07d06950>

tests/test_formatting.py:126: AssertionError

test_formatting.py::test_kwargs_in_extra_dict

test_formatting.py::test_kwargs_in_extra_dict
def test_kwargs_in_extra_dict():
        extra_dicts = []
        messages = []

        def sink(message):
            extra_dicts.append(message.record["extra"])
            messages.append(str(message))

        logger.add(sink, format="{message}")
        logger.info("A")
        logger.info("B", foo=123)
>       logger.bind(merge=True).info("C", other=False)
E       AttributeError: 'NoneType' object has no attribute 'info'

extra_dicts = []
messages   = []
sink       = .sink at 0x7fac07d07880>

tests/test_formatting.py:140: AttributeError

test_formatting.py::test_non_string_message

test_formatting.py::test_non_string_message
writer = .w at 0x7fac07d07760>

    def test_non_string_message(writer):
        logger.add(writer, format="{message}")

        logger.info(1)
        logger.info({})
        logger.info(b"test")

>       assert writer.read() == "1\n{}\nb'test'\n"
E       assert '' == "1\n{}\nb'test'\n"
E         
E         - 1
E         - {}
E         - b'test'

writer     = .w at 0x7fac07d07760>

tests/test_formatting.py:177: AssertionError

test_formatting.py::test_non_string_message_is_str_in_record[True]

test_formatting.py::test_non_string_message_is_str_in_record[True]
writer = .w at 0x7fac07d076d0>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_non_string_message_is_str_in_record(writer, colors):
        output = ""

        def sink(message):
            nonlocal output
            assert isinstance(message.record["message"], str)
            output += message

        def format(record):
            assert isinstance(record["message"], str)
            return "[{message}]\n"

        logger.add(sink, format=format, catch=False)
>       logger.opt(colors=colors).info(123)
E       AttributeError: 'NoneType' object has no attribute 'info'

colors     = True
format     = .format at 0x7fac07d07b50>
output     = ''
sink       = .sink at 0x7fac07d07910>
writer     = .w at 0x7fac07d076d0>

tests/test_formatting.py:194: AttributeError

test_formatting.py::test_non_string_message_is_str_in_record[False]

test_formatting.py::test_non_string_message_is_str_in_record[False]
writer = .w at 0x7fac07d07520>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_non_string_message_is_str_in_record(writer, colors):
        output = ""

        def sink(message):
            nonlocal output
            assert isinstance(message.record["message"], str)
            output += message

        def format(record):
            assert isinstance(record["message"], str)
            return "[{message}]\n"

        logger.add(sink, format=format, catch=False)
>       logger.opt(colors=colors).info(123)
E       AttributeError: 'NoneType' object has no attribute 'info'

colors     = False
format     = .format at 0x7fac07d07eb0>
output     = ''
sink       = .sink at 0x7fac07d07be0>
writer     = .w at 0x7fac07d07520>

tests/test_formatting.py:194: AttributeError

test_formatting.py::test_missing_positional_field_during_formatting[True]

test_formatting.py::test_missing_positional_field_during_formatting[True]
writer = .w at 0x7fac07d05090>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_missing_positional_field_during_formatting(writer, colors):
        logger.add(writer)

        with pytest.raises(IndexError):
>           logger.opt(colors=colors).info("Foo {} {}", 123)
E           AttributeError: 'NoneType' object has no attribute 'info'

colors     = True
writer     = .w at 0x7fac07d05090>

tests/test_formatting.py:203: AttributeError

test_formatting.py::test_missing_positional_field_during_formatting[False]

test_formatting.py::test_missing_positional_field_during_formatting[False]
writer = .w at 0x7fac07d07ac0>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_missing_positional_field_during_formatting(writer, colors):
        logger.add(writer)

        with pytest.raises(IndexError):
>           logger.opt(colors=colors).info("Foo {} {}", 123)
E           AttributeError: 'NoneType' object has no attribute 'info'

colors     = False
writer     = .w at 0x7fac07d07ac0>

tests/test_formatting.py:203: AttributeError

test_formatting.py::test_missing_named_field_during_formatting[True]

test_formatting.py::test_missing_named_field_during_formatting[True]
writer = .w at 0x7fac0812e9e0>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_missing_named_field_during_formatting(writer, colors):
        logger.add(writer)

        with pytest.raises(KeyError):
>           logger.opt(colors=colors).info("Foo {bar}", baz=123)
E           AttributeError: 'NoneType' object has no attribute 'info'

colors     = True
writer     = .w at 0x7fac0812e9e0>

tests/test_formatting.py:211: AttributeError

test_formatting.py::test_missing_named_field_during_formatting[False]

test_formatting.py::test_missing_named_field_during_formatting[False]
writer = .w at 0x7fac07d079a0>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_missing_named_field_during_formatting(writer, colors):
        logger.add(writer)

        with pytest.raises(KeyError):
>           logger.opt(colors=colors).info("Foo {bar}", baz=123)
E           AttributeError: 'NoneType' object has no attribute 'info'

colors     = False
writer     = .w at 0x7fac07d079a0>

tests/test_formatting.py:211: AttributeError

test_formatting.py::test_not_formattable_message

test_formatting.py::test_not_formattable_message
writer = .w at 0x7fac07d07490>

    def test_not_formattable_message(writer):
        logger.add(writer)

>       with pytest.raises(AttributeError):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac07d07490>

tests/test_formatting.py:217: Failed

test_formatting.py::test_not_formattable_message_with_colors

test_formatting.py::test_not_formattable_message_with_colors
writer = .w at 0x7fac07d05ea0>

    def test_not_formattable_message_with_colors(writer):
        logger.add(writer)

        with pytest.raises(TypeError):
>           logger.opt(colors=True).info(123, baz=456)
E           AttributeError: 'NoneType' object has no attribute 'info'

writer     = .w at 0x7fac07d05ea0>

tests/test_formatting.py:225: AttributeError

test_formatting.py::test_invalid_color_markup

test_formatting.py::test_invalid_color_markup
writer = .w at 0x7fac07d05090>

    def test_invalid_color_markup(writer):
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac07d05090>

tests/test_formatting.py:229: Failed

test_get_frame.py::test_with_sys_getframe

test_get_frame.py::test_with_sys_getframe
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0885c040>

    def test_with_sys_getframe(monkeypatch):
        def patched():
            return

        monkeypatch.setattr(sys, "_getframe", patched())
>       assert load_get_frame_function() == patched()
E       assert .get_frame at 0x7fac07d07d00> == None
E        +  where .get_frame at 0x7fac07d07d00> = load_get_frame_function()
E        +  and   None = .patched at 0x7fac07d05ea0>()

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac0885c040>
patched    = .patched at 0x7fac07d05ea0>

tests/test_get_frame.py:12: AssertionError

test_get_frame.py::test_without_sys_getframe

test_get_frame.py::test_without_sys_getframe
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac088e85e0>

    def test_without_sys_getframe(monkeypatch):
        monkeypatch.delattr(sys, "_getframe")
>       assert load_get_frame_function() == loguru._get_frame.get_frame_fallback
E       AttributeError: module 'loguru._get_frame' has no attribute 'get_frame_fallback'

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac088e85e0>

tests/test_get_frame.py:17: AttributeError

test_get_frame.py::test_get_frame_fallback

test_get_frame.py::test_get_frame_fallback
def test_get_frame_fallback():
        frame_root = frame_a = frame_b = None

        def a():
            nonlocal frame_a
            frame_a = loguru._get_frame.get_frame_fallback(1)
            b()

        def b():
            nonlocal frame_b
            frame_b = loguru._get_frame.get_frame_fallback(2)

>       frame_root = loguru._get_frame.get_frame_fallback(0)
E       AttributeError: module 'loguru._get_frame' has no attribute 'get_frame_fallback'

a          = .a at 0x7fac07d07c70>
b          = .b at 0x7fac07d9c1f0>
frame_a    = None
frame_b    = None
frame_root = None

tests/test_get_frame.py:32: AttributeError

test_interception.py::test_formatting

test_interception.py::test_formatting
writer = .w at 0x7fac07d07520>

    def test_formatting(writer):
        fmt = (
            "{name} - {file.name} - {function} - {level.name} - "
            "{level.no} - {line} - {module} - {message}"
        )

        expected = (
            "tests.test_interception - test_interception.py - test_formatting - DEBUG - "
            "10 - 39 - test_interception - This is the message\n"
        )

        with make_logging_logger("tests", InterceptHandler()) as logging_logger:
            logger.add(writer, format=fmt)
>           logging_logger.debug("This is the %s", "message")

expected   = 'tests.test_interception - test_interception.py - test_formatting - DEBUG - 10 - 39 - test_interception - This is the message\n'
fmt        = '{name} - {file.name} - {function} - {level.name} - {level.no} - {line} - {module} - {message}'
logging_logger = 
writer     = .w at 0x7fac07d07520>

tests/test_interception.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1465: in debug
    self._log(DEBUG, msg, args, **kwargs)
        args       = ('message',)
        kwargs     = {}
        msg        = 'This is the %s'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ('message',)
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_formatting'
        level      = 10
        lno        = 39
        msg        = 'This is the %s'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_intercept

test_interception.py::test_intercept
writer = .w at 0x7fac07d9edd0>

    def test_intercept(writer):
        with make_logging_logger(None, InterceptHandler()) as logging_logger:
>           logging_logger.info("Nope")

logging_logger = 
writer     = .w at 0x7fac07d9edd0>

tests/test_interception.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1477: in info
    self._log(INFO, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = 'Nope'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_intercept'
        level      = 20
        lno        = 47
        msg        = 'Nope'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 6
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_add_before_intercept

test_interception.py::test_add_before_intercept
writer = .w at 0x7fac07d9c310>

    def test_add_before_intercept(writer):
        logger.add(writer, format="{message}")

        with make_logging_logger(None, InterceptHandler()) as logging_logger:
>           logging_logger.info("Test")

logging_logger = 
writer     = .w at 0x7fac07d9c310>

tests/test_interception.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1477: in info
    self._log(INFO, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = 'Test'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_add_before_intercept'
        level      = 20
        lno        = 59
        msg        = 'Test'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 6
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_remove_interception

test_interception.py::test_remove_interception
writer = .w at 0x7fac0812d3f0>

    def test_remove_interception(writer):
        h = InterceptHandler()

        with make_logging_logger("foobar", h) as logging_logger:
            logger.add(writer, format="{message}")
>           logging_logger.debug("1")

h          = 
logging_logger = 
writer     = .w at 0x7fac0812d3f0>

tests/test_interception.py:70: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1465: in debug
    self._log(DEBUG, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = '1'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_remove_interception'
        level      = 10
        lno        = 70
        msg        = '1'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_multiple_intercept

test_interception.py::test_multiple_intercept
writer = .w at 0x7fac07d06c20>

    def test_multiple_intercept(writer):
        with make_logging_logger("test_1", InterceptHandler()) as logging_logger_1:
            with make_logging_logger("test_2", InterceptHandler()) as logging_logger_2:
                logger.add(writer, format="{message}")
>               logging_logger_1.info("1")

logging_logger_1 = 
logging_logger_2 = 
writer     = .w at 0x7fac07d06c20>

tests/test_interception.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1477: in info
    self._log(INFO, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = '1'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_multiple_intercept'
        level      = 20
        lno        = 92
        msg        = '1'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_exception

test_interception.py::test_exception
writer = .w at 0x7fac07d06b00>

    def test_exception(writer):
        with make_logging_logger("tests.test_interception", InterceptHandler()) as logging_logger:
            logger.add(writer, format="{message}")

            try:
>               1 / 0  # noqa: B018
E               ZeroDivisionError: division by zero

logging_logger = 
writer     = .w at 0x7fac07d06b00>

tests/test_interception.py:104: ZeroDivisionError

During handling of the above exception, another exception occurred:

writer = .w at 0x7fac07d06b00>

    def test_exception(writer):
        with make_logging_logger("tests.test_interception", InterceptHandler()) as logging_logger:
            logger.add(writer, format="{message}")

            try:
                1 / 0  # noqa: B018
            except Exception:
>               logging_logger.exception("Oops...")

logging_logger = 
writer     = .w at 0x7fac07d06b00>

tests/test_interception.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1512: in exception
    self.error(msg, *args, exc_info=exc_info, **kwargs)
        args       = ()
        exc_info   = True
        kwargs     = {}
        msg        = 'Oops...'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1506: in error
    self._log(ERROR, msg, args, **kwargs)
        args       = ()
        kwargs     = {'exc_info': True}
        msg        = 'Oops...'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = (, ZeroDivisionError('division by zero'), )
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_exception'
        level      = 40
        lno        = 106
        msg        = 'Oops...'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_level_is_no

test_interception.py::test_level_is_no
writer = .w at 0x7fac07d07d00>

    def test_level_is_no(writer):
        with make_logging_logger("tests", InterceptHandler()) as logging_logger:
            logger.add(writer, format="{level.no} - {level.name} - {message}", colorize=True)
>           logging_logger.log(12, "Hop")

logging_logger = 
writer     = .w at 0x7fac07d07d00>

tests/test_interception.py:117: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1547: in log
    self._log(level, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        level      = 12
        msg        = 'Hop'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_level_is_no'
        level      = 12
        lno        = 117
        msg        = 'Hop'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_level_does_not_exist

test_interception.py::test_level_does_not_exist
writer = .w at 0x7fac0812e9e0>

    def test_level_does_not_exist(writer):
        logging.addLevelName(152, "FANCY_LEVEL")

        with make_logging_logger("tests", InterceptHandler()) as logging_logger:
            logger.add(writer, format="{level.no} - {level.name} - {message}", colorize=True)
>           logging_logger.log(152, "Nop")

logging_logger = 
writer     = .w at 0x7fac0812e9e0>

tests/test_interception.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1547: in log
    self._log(level, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        level      = 152
        msg        = 'Nop'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_level_does_not_exist'
        level      = 152
        lno        = 128
        msg        = 'Nop'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_level_exist_builtin

test_interception.py::test_level_exist_builtin
writer = .w at 0x7fac07d9e950>

    def test_level_exist_builtin(writer):
        with make_logging_logger("tests", InterceptHandler()) as logging_logger:
            logger.add(writer, format="{level.no} - {level.name} - {message}", colorize=True)
>           logging_logger.error("Error...")

logging_logger = 
writer     = .w at 0x7fac07d9e950>

tests/test_interception.py:137: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1506: in error
    self._log(ERROR, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = 'Error...'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_level_exist_builtin'
        level      = 40
        lno        = 137
        msg        = 'Error...'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_level_exists_custom

test_interception.py::test_level_exists_custom
writer = .w at 0x7fac07d9e4d0>

    def test_level_exists_custom(writer):
        logging.addLevelName(99, "ANOTHER_FANCY_LEVEL")
        logger.level("ANOTHER_FANCY_LEVEL", no=99, color="", icon="")

        with make_logging_logger("tests", InterceptHandler()) as logging_logger:
            logger.add(writer, format="{level.no} - {level.name} - {message}", colorize=True)
>           logging_logger.log(99, "Yep!")

logging_logger = 
writer     = .w at 0x7fac07d9e4d0>

tests/test_interception.py:149: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:1547: in log
    self._log(level, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        level      = 99
        msg        = 'Yep!'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_level_exists_custom'
        level      = 99
        lno        = 149
        msg        = 'Yep!'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 1
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_interception.py::test_using_logging_function

test_interception.py::test_using_logging_function
writer = .w at 0x7fac07d9e560>

    def test_using_logging_function(writer):
        with make_logging_logger(None, InterceptHandler()):
            logger.add(writer, format="{function} {line} {module} {file.name} {message}")
>           logging.warning("ABC")

writer     = .w at 0x7fac07d9e560>

tests/test_interception.py:158: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/logging/__init__.py:2123: in warning
    root.warning(msg, *args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = 'ABC'
/usr/lib/python3.10/logging/__init__.py:1489: in warning
    self._log(WARNING, msg, args, **kwargs)
        args       = ()
        kwargs     = {}
        msg        = 'ABC'
        self       = 
/usr/lib/python3.10/logging/__init__.py:1624: in _log
    self.handle(record)
        args       = ()
        exc_info   = None
        extra      = None
        fn         = '/testbed/tests/test_interception.py'
        func       = 'test_using_logging_function'
        level      = 30
        lno        = 158
        msg        = 'ABC'
        record     = 
        self       = 
        sinfo      = None
        stack_info = False
        stacklevel = 1
/usr/lib/python3.10/logging/__init__.py:1634: in handle
    self.callHandlers(record)
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:1696: in callHandlers
    hdlr.handle(record)
        c          = 
        found      = 6
        hdlr       = 
        record     = 
        self       = 
/usr/lib/python3.10/logging/__init__.py:968: in handle
    self.emit(record)
        record     = 
        rv         = True
        self       = 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
record = 

    def emit(self, record):
        # Get corresponding Loguru level if it exists.
        try:
>           level = logger.level(record.levelname).name
E           AttributeError: 'NoneType' object has no attribute 'name'

record     = 
self       = 

tests/test_interception.py:13: AttributeError

test_locks.py::test_no_deadlock_if_logger_used_inside_sink_with_catch

test_locks.py::test_no_deadlock_if_logger_used_inside_sink_with_catch
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0876f3a0>

    def test_no_deadlock_if_logger_used_inside_sink_with_catch(capsys):
        def sink(message):
            logger.info(message)

        logger.add(sink, colorize=False, catch=True)

        logger.info("Test")

        out, err = capsys.readouterr()
        assert out == ""
>       assert "deadlock avoided" in err
E       AssertionError: assert 'deadlock avoided' in ''

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0876f3a0>
err        = ''
out        = ''
sink       = .sink at 0x7fac0812dc60>

tests/test_locks.py:81: AssertionError

test_locks.py::test_no_deadlock_if_logger_used_inside_sink_without_catch

test_locks.py::test_no_deadlock_if_logger_used_inside_sink_without_catch
def test_no_deadlock_if_logger_used_inside_sink_without_catch():
        def sink(message):
            logger.info(message)

        logger.add(sink, colorize=False, catch=False)

>       with pytest.raises(RuntimeError, match=r".*deadlock avoided.*"):
E       Failed: DID NOT RAISE 

sink       = .sink at 0x7fac0812e9e0>

tests/test_locks.py:90: Failed

test_locks.py::test_no_error_if_multithreading

test_locks.py::test_no_error_if_multithreading
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0876c730>

    def test_no_error_if_multithreading(capsys):
        barrier = threading.Barrier(2)

        def sink(message):
            barrier.wait()
            sys.stderr.write(message)
            time.sleep(0.5)  # Give time to the other thread to try to acquire the lock.

        def worker():
            logger.info("Thread message")
            barrier.wait()  # Release main thread.

        logger.add(sink, colorize=False, catch=False, format="{message}")
        thread = threading.Thread(target=worker)
        thread.start()

        barrier.wait()
        logger.info("Main message")

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == "Thread message\nMain message\n"
E       AssertionError: assert '' == 'Thread messa...ain message\n'
E         
E         - Thread message
E         - Main message

barrier    = 
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0876c730>
err        = ''
out        = ''
sink       = .sink at 0x7fac07df5870>
thread     = 
worker     = .worker at 0x7fac07df5900>

tests/test_locks.py:115: AssertionError

test_locks.py::test_pickled_logger_does_not_inherit_acquired_local

test_locks.py::test_pickled_logger_does_not_inherit_acquired_local
capsys = <_pytest.capture.CaptureFixture object at 0x7fac083c8970>

    def test_pickled_logger_does_not_inherit_acquired_local(capsys):
        logger.add(_pickle_sink, colorize=False, catch=False, format="{message}")

>       logger.bind(clone=True).info("From main")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac083c8970>

tests/test_locks.py:129: AttributeError

test_multiprocessing.py::test_apply_spawn

test_multiprocessing.py::test_apply_spawn
spawn_context = 

    def test_apply_spawn(spawn_context):
        writer = Writer()

        logger.add(writer, context=spawn_context, format="{message}", enqueue=True, catch=False)

        with spawn_context.Pool(1, set_logger, [logger]) as pool:
            for i in range(3):
                pool.apply(do_something, (i,))
            pool.close()
            pool.join()

        logger.info("Done!")
        logger.remove()

>       assert writer.read() == "#0\n#1\n#2\nDone!\n"
E       AssertionError: assert '' == '#0\n#1\n#2\nDone!\n'
E         
E         - #0
E         - #1
E         - #2
E         - Done!

i          = 2
pool       = 
spawn_context = 
writer     = 

tests/test_multiprocessing.py:111: AssertionError

test_multiprocessing.py::test_apply_fork

test_multiprocessing.py::test_apply_fork
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_apply_fork(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        with fork_context.Pool(1, set_logger, [logger]) as pool:
            for i in range(3):
                pool.apply(do_something, (i,))
            pool.close()
            pool.join()

        logger.info("Done!")
        logger.remove()

>       assert writer.read() == "#0\n#1\n#2\nDone!\n"
E       AssertionError: assert '' == '#0\n#1\n#2\nDone!\n'
E         
E         - #0
E         - #1
E         - #2
E         - Done!

fork_context = 
i          = 2
pool       = 
writer     = 

tests/test_multiprocessing.py:129: AssertionError

test_multiprocessing.py::test_apply_inheritance

test_multiprocessing.py::test_apply_inheritance
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_apply_inheritance(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        with fork_context.Pool(1) as pool:
            for i in range(3):
                pool.apply(do_something, (i,))
            pool.close()
            pool.join()

        logger.info("Done!")
        logger.remove()

>       assert writer.read() == "#0\n#1\n#2\nDone!\n"
E       AssertionError: assert '' == '#0\n#1\n#2\nDone!\n'
E         
E         - #0
E         - #1
E         - #2
E         - Done!

fork_context = 
i          = 2
pool       = 
writer     = 

tests/test_multiprocessing.py:147: AssertionError

test_multiprocessing.py::test_apply_async_spawn

test_multiprocessing.py::test_apply_async_spawn
spawn_context = 

    def test_apply_async_spawn(spawn_context):
        writer = Writer()

        logger.add(writer, context=spawn_context, format="{message}", enqueue=True, catch=False)

        with spawn_context.Pool(1, set_logger, [logger]) as pool:
            for i in range(3):
                result = pool.apply_async(do_something, (i,))
                result.get()
            pool.close()
            pool.join()

        logger.info("Done!")
        logger.remove()

>       assert writer.read() == "#0\n#1\n#2\nDone!\n"
E       AssertionError: assert '' == '#0\n#1\n#2\nDone!\n'
E         
E         - #0
E         - #1
E         - #2
E         - Done!

i          = 2
pool       = 
result     = 
spawn_context = 
writer     = 

tests/test_multiprocessing.py:165: AssertionError

test_multiprocessing.py::test_apply_async_fork

test_multiprocessing.py::test_apply_async_fork
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_apply_async_fork(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        with fork_context.Pool(1, set_logger, [logger]) as pool:
            for i in range(3):
                result = pool.apply_async(do_something, (i,))
                result.get()
            pool.close()
            pool.join()

        logger.info("Done!")
        logger.remove()

>       assert writer.read() == "#0\n#1\n#2\nDone!\n"
E       AssertionError: assert '' == '#0\n#1\n#2\nDone!\n'
E         
E         - #0
E         - #1
E         - #2
E         - Done!

fork_context = 
i          = 2
pool       = 
result     = 
writer     = 

tests/test_multiprocessing.py:184: AssertionError

test_multiprocessing.py::test_apply_async_inheritance

test_multiprocessing.py::test_apply_async_inheritance
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_apply_async_inheritance(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        with fork_context.Pool(1) as pool:
            for i in range(3):
                result = pool.apply_async(do_something, (i,))
                result.get()
            pool.close()
            pool.join()

        logger.info("Done!")
        logger.remove()

>       assert writer.read() == "#0\n#1\n#2\nDone!\n"
E       AssertionError: assert '' == '#0\n#1\n#2\nDone!\n'
E         
E         - #0
E         - #1
E         - #2
E         - Done!

fork_context = 
i          = 2
pool       = 
result     = 
writer     = 

tests/test_multiprocessing.py:203: AssertionError

test_multiprocessing.py::test_process_spawn

test_multiprocessing.py::test_process_spawn
spawn_context = 

    def test_process_spawn(spawn_context):
        writer = Writer()

        logger.add(writer, context=spawn_context, format="{message}", enqueue=True, catch=False)

        process = spawn_context.Process(target=subworker, args=(logger,))
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

process    = 
spawn_context = 
writer     = 

tests/test_multiprocessing.py:220: AssertionError

test_multiprocessing.py::test_process_fork

test_multiprocessing.py::test_process_fork
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_process_fork(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        process = fork_context.Process(target=subworker, args=(logger,))
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

fork_context = 
process    = 
writer     = 

tests/test_multiprocessing.py:238: AssertionError

test_multiprocessing.py::test_process_inheritance

test_multiprocessing.py::test_process_inheritance
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_process_inheritance(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        process = fork_context.Process(target=subworker_inheritance)
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

fork_context = 
process    = 
writer     = 

tests/test_multiprocessing.py:256: AssertionError

test_multiprocessing.py::test_remove_in_child_process_spawn

test_multiprocessing.py::test_remove_in_child_process_spawn
spawn_context = 

    def test_remove_in_child_process_spawn(spawn_context):
        writer = Writer()

        logger.add(writer, context=spawn_context, format="{message}", enqueue=True, catch=False)

        process = spawn_context.Process(target=subworker_remove, args=(logger,))
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

process    = 
spawn_context = 
writer     = 

tests/test_multiprocessing.py:273: AssertionError

test_multiprocessing.py::test_remove_in_child_process_fork

test_multiprocessing.py::test_remove_in_child_process_fork
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_remove_in_child_process_fork(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        process = fork_context.Process(target=subworker_remove, args=(logger,))
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

fork_context = 
process    = 
writer     = 

tests/test_multiprocessing.py:291: AssertionError

test_multiprocessing.py::test_remove_in_child_process_inheritance

test_multiprocessing.py::test_remove_in_child_process_inheritance
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_remove_in_child_process_inheritance(fork_context):
        writer = Writer()

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        process = fork_context.Process(target=subworker_remove_inheritance)
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

fork_context = 
process    = 
writer     = 

tests/test_multiprocessing.py:309: AssertionError

test_multiprocessing.py::test_remove_in_main_process_spawn

test_multiprocessing.py::test_remove_in_main_process_spawn
spawn_context = 

    def test_remove_in_main_process_spawn(spawn_context):
        # Actually, this test may fail if sleep time in main process is too small (and no barrier used)
        # In such situation, it seems the child process has not enough time to initialize itself
        # It may fail with an "EOFError" during unpickling of the (garbage collected / closed) Queue
        writer = Writer()
        barrier = spawn_context.Barrier(2)

        logger.add(writer, context=spawn_context, format="{message}", enqueue=True, catch=False)

        process = spawn_context.Process(target=subworker_barrier, args=(logger, barrier))
        process.start()
        barrier.wait()
        logger.info("Main")
        logger.remove()
        process.join()

        assert process.exitcode == 0

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

barrier    = 
process    = 
spawn_context = 
writer     = 

tests/test_multiprocessing.py:330: AssertionError

test_multiprocessing.py::test_remove_in_main_process_fork

test_multiprocessing.py::test_remove_in_main_process_fork
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_remove_in_main_process_fork(fork_context):
        writer = Writer()
        barrier = fork_context.Barrier(2)

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        process = fork_context.Process(target=subworker_barrier, args=(logger, barrier))
        process.start()
        barrier.wait()
        logger.info("Main")
        logger.remove()
        process.join()

        assert process.exitcode == 0

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

barrier    = 
fork_context = 
process    = 
writer     = 

tests/test_multiprocessing.py:349: AssertionError

test_multiprocessing.py::test_remove_in_main_process_inheritance

test_multiprocessing.py::test_remove_in_main_process_inheritance
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_remove_in_main_process_inheritance(fork_context):
        writer = Writer()
        barrier = fork_context.Barrier(2)

        logger.add(writer, context=fork_context, format="{message}", enqueue=True, catch=False)

        process = fork_context.Process(target=subworker_barrier_inheritance, args=(barrier,))
        process.start()
        barrier.wait()
        logger.info("Main")
        logger.remove()
        process.join()

        assert process.exitcode == 0

>       assert writer.read() == "Child\nMain\n"
E       AssertionError: assert '' == 'Child\nMain\n'
E         
E         - Child
E         - Main

barrier    = 
fork_context = 
process    = 
writer     = 

tests/test_multiprocessing.py:368: AssertionError

test_multiprocessing.py::test_await_complete_spawn

test_multiprocessing.py::test_await_complete_spawn
capsys = <_pytest.capture.CaptureFixture object at 0x7fac081df610>
spawn_context = 

    def test_await_complete_spawn(capsys, spawn_context):
        async def writer(msg):
            print(msg, end="")

        loop = asyncio.new_event_loop()

        logger.add(
            writer, context=spawn_context, format="{message}", loop=loop, enqueue=True, catch=False
        )

        process = spawn_context.Process(target=subworker_complete, args=(logger,))
        process.start()
        process.join()

>       assert process.exitcode == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = .exitcode

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac081df610>
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
process    = 
spawn_context = 
writer     = .writer at 0x7fac07debc70>

tests/test_multiprocessing.py:385: AssertionError

test_multiprocessing.py::test_await_complete_fork

test_multiprocessing.py::test_await_complete_fork
capsys = <_pytest.capture.CaptureFixture object at 0x7fac083c5ba0>
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_await_complete_fork(capsys, fork_context):
        async def writer(msg):
            print(msg, end="")

        loop = asyncio.new_event_loop()

        logger.add(
            writer, context=fork_context, format="{message}", loop=loop, enqueue=True, catch=False
        )

        process = fork_context.Process(target=subworker_complete, args=(logger,))
        process.start()
        process.join()

>       assert process.exitcode == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = .exitcode

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac083c5ba0>
fork_context = 
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
process    = 
writer     = .writer at 0x7fac07deb6d0>

tests/test_multiprocessing.py:412: AssertionError

test_multiprocessing.py::test_await_complete_inheritance

test_multiprocessing.py::test_await_complete_inheritance
capsys = <_pytest.capture.CaptureFixture object at 0x7fac081dff40>
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_await_complete_inheritance(capsys, fork_context):
        async def writer(msg):
            print(msg, end="")

        loop = asyncio.new_event_loop()

        logger.add(
            writer, context=fork_context, format="{message}", loop=loop, enqueue=True, catch=False
        )

        process = fork_context.Process(target=subworker_complete_inheritance)
        process.start()
        process.join()

>       assert process.exitcode == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = .exitcode

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac081dff40>
fork_context = 
loop       = <_UnixSelectorEventLoop running=False closed=False debug=False>
process    = 
writer     = .writer at 0x7fac07de8f70>

tests/test_multiprocessing.py:439: AssertionError

test_multiprocessing.py::test_not_picklable_sinks_spawn

test_multiprocessing.py::test_not_picklable_sinks_spawn
spawn_context = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0')
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0823a980>

    def test_not_picklable_sinks_spawn(spawn_context, tmp_path, capsys):
        filepath = tmp_path / "test.log"
        stream = sys.stderr
        output = []

        logger.add(filepath, context=spawn_context, format="{message}", enqueue=True, catch=False)
        logger.add(stream, context=spawn_context, format="{message}", enqueue=True)
        logger.add(lambda m: output.append(m), context=spawn_context, format="{message}", enqueue=True)

        process = spawn_context.Process(target=subworker, args=[logger])
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

        out, err = capsys.readouterr()

>       assert filepath.read_text() == "Child\nMain\n"

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0823a980>
err        = ''
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0/test.log')
out        = ''
output     = []
process    = 
spawn_context = 
stream     = <_io.TextIOWrapper encoding='UTF-8'>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0')

tests/test_multiprocessing.py:471: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_spawn0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_multiprocessing.py::test_not_picklable_sinks_fork

test_multiprocessing.py::test_not_picklable_sinks_fork
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0810bfa0>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0')
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_not_picklable_sinks_fork(capsys, tmp_path, fork_context):
        filepath = tmp_path / "test.log"
        stream = sys.stderr
        output = []

        logger.add(filepath, context=fork_context, format="{message}", enqueue=True, catch=False)
        logger.add(stream, context=fork_context, format="{message}", enqueue=True, catch=False)
        logger.add(
            lambda m: output.append(m),
            context=fork_context,
            format="{message}",
            enqueue=True,
            catch=False,
        )

        process = fork_context.Process(target=subworker, args=[logger])
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

        out, err = capsys.readouterr()

>       assert filepath.read_text() == "Child\nMain\n"

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0810bfa0>
err        = ''
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0/test.log')
fork_context = 
out        = ''
output     = []
process    = 
stream     = <_io.TextIOWrapper encoding='UTF-8'>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0')

tests/test_multiprocessing.py:504: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_fork0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_multiprocessing.py::test_not_picklable_sinks_inheritance

test_multiprocessing.py::test_not_picklable_sinks_inheritance
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0830b130>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0')
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    def test_not_picklable_sinks_inheritance(capsys, tmp_path, fork_context):
        filepath = tmp_path / "test.log"
        stream = sys.stderr
        output = []

        logger.add(filepath, context=fork_context, format="{message}", enqueue=True, catch=False)
        logger.add(stream, context=fork_context, format="{message}", enqueue=True, catch=False)
        logger.add(
            lambda m: output.append(m),
            context=fork_context,
            format="{message}",
            enqueue=True,
            catch=False,
        )

        process = fork_context.Process(target=subworker_inheritance)
        process.start()
        process.join()

        assert process.exitcode == 0

        logger.info("Main")
        logger.remove()

        out, err = capsys.readouterr()

>       assert filepath.read_text() == "Child\nMain\n"

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0830b130>
err        = ''
filepath   = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0/test.log')
fork_context = 
out        = ''
output     = []
process    = 
stream     = <_io.TextIOWrapper encoding='UTF-8'>
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0')

tests/test_multiprocessing.py:537: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_not_picklable_sinks_inher0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[True-True]

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[True-True]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l0')
enqueue = True, deepcopied = True
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="No 'os.register_at_fork()' function")
    @pytest.mark.parametrize("enqueue", [True, False])
    @pytest.mark.parametrize("deepcopied", [True, False])
    def test_no_deadlock_if_internal_lock_in_use(tmp_path, enqueue, deepcopied, fork_context):
        if deepcopied:
            logger_ = copy.deepcopy(logger)
        else:
            logger_ = logger

        output = tmp_path / "stdout.txt"
        stdout = output.open("w")

        def slow_sink(msg):
            time.sleep(0.5)
            stdout.write(msg)
            stdout.flush()

        def main():
            logger_.info("Main")

        def worker():
            logger_.info("Child")

        logger_.add(slow_sink, context=fork_context, format="{message}", enqueue=enqueue, catch=False)

        thread = threading.Thread(target=main)
        thread.start()

        process = fork_context.Process(target=worker)
        process.start()

        thread.join()
        process.join(2)

        assert process.exitcode == 0

        logger_.remove()

>       assert output.read_text() in ("Main\nChild\n", "Child\nMain\n")
E       AssertionError: assert '' in ('Main\nChild\n', 'Child\nMain\n')
E        +  where '' = read_text()
E        +    where read_text = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l0/stdout.txt').read_text

deepcopied = True
enqueue    = True
fork_context = 
logger_    = 
main       = .main at 0x7fac07dfec20>
output     = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l0/stdout.txt')
process    = 
slow_sink  = .slow_sink at 0x7fac07df5ab0>
stdout     = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l0/stdout.txt' mode='w' encoding='UTF-8'>
thread     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l0')
worker     = .worker at 0x7fac07de8e50>

tests/test_multiprocessing.py:582: AssertionError

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[True-False]

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[True-False]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l1')
enqueue = False, deepcopied = True
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="No 'os.register_at_fork()' function")
    @pytest.mark.parametrize("enqueue", [True, False])
    @pytest.mark.parametrize("deepcopied", [True, False])
    def test_no_deadlock_if_internal_lock_in_use(tmp_path, enqueue, deepcopied, fork_context):
        if deepcopied:
            logger_ = copy.deepcopy(logger)
        else:
            logger_ = logger

        output = tmp_path / "stdout.txt"
        stdout = output.open("w")

        def slow_sink(msg):
            time.sleep(0.5)
            stdout.write(msg)
            stdout.flush()

        def main():
            logger_.info("Main")

        def worker():
            logger_.info("Child")

        logger_.add(slow_sink, context=fork_context, format="{message}", enqueue=enqueue, catch=False)

        thread = threading.Thread(target=main)
        thread.start()

        process = fork_context.Process(target=worker)
        process.start()

        thread.join()
        process.join(2)

        assert process.exitcode == 0

        logger_.remove()

>       assert output.read_text() in ("Main\nChild\n", "Child\nMain\n")
E       AssertionError: assert '' in ('Main\nChild\n', 'Child\nMain\n')
E        +  where '' = read_text()
E        +    where read_text = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l1/stdout.txt').read_text

deepcopied = True
enqueue    = False
fork_context = 
logger_    = 
main       = .main at 0x7fac07debd00>
output     = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l1/stdout.txt')
process    = 
slow_sink  = .slow_sink at 0x7fac07deadd0>
stdout     = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l1/stdout.txt' mode='w' encoding='UTF-8'>
thread     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l1')
worker     = .worker at 0x7fac07de9e10>

tests/test_multiprocessing.py:582: AssertionError

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[False-True]

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[False-True]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l2')
enqueue = True, deepcopied = False
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="No 'os.register_at_fork()' function")
    @pytest.mark.parametrize("enqueue", [True, False])
    @pytest.mark.parametrize("deepcopied", [True, False])
    def test_no_deadlock_if_internal_lock_in_use(tmp_path, enqueue, deepcopied, fork_context):
        if deepcopied:
            logger_ = copy.deepcopy(logger)
        else:
            logger_ = logger

        output = tmp_path / "stdout.txt"
        stdout = output.open("w")

        def slow_sink(msg):
            time.sleep(0.5)
            stdout.write(msg)
            stdout.flush()

        def main():
            logger_.info("Main")

        def worker():
            logger_.info("Child")

        logger_.add(slow_sink, context=fork_context, format="{message}", enqueue=enqueue, catch=False)

        thread = threading.Thread(target=main)
        thread.start()

        process = fork_context.Process(target=worker)
        process.start()

        thread.join()
        process.join(2)

        assert process.exitcode == 0

        logger_.remove()

>       assert output.read_text() in ("Main\nChild\n", "Child\nMain\n")
E       AssertionError: assert '' in ('Main\nChild\n', 'Child\nMain\n')
E        +  where '' = read_text()
E        +    where read_text = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l2/stdout.txt').read_text

deepcopied = False
enqueue    = True
fork_context = 
logger_    = 
main       = .main at 0x7fac07cb8160>
output     = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l2/stdout.txt')
process    = 
slow_sink  = .slow_sink at 0x7fac07debf40>
stdout     = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l2/stdout.txt' mode='w' encoding='UTF-8'>
thread     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l2')
worker     = .worker at 0x7fac07cb81f0>

tests/test_multiprocessing.py:582: AssertionError

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[False-False]

test_multiprocessing.py::test_no_deadlock_if_internal_lock_in_use[False-False]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l3')
enqueue = False, deepcopied = False
fork_context = 

    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.skipif(sys.version_info < (3, 7), reason="No 'os.register_at_fork()' function")
    @pytest.mark.parametrize("enqueue", [True, False])
    @pytest.mark.parametrize("deepcopied", [True, False])
    def test_no_deadlock_if_internal_lock_in_use(tmp_path, enqueue, deepcopied, fork_context):
        if deepcopied:
            logger_ = copy.deepcopy(logger)
        else:
            logger_ = logger

        output = tmp_path / "stdout.txt"
        stdout = output.open("w")

        def slow_sink(msg):
            time.sleep(0.5)
            stdout.write(msg)
            stdout.flush()

        def main():
            logger_.info("Main")

        def worker():
            logger_.info("Child")

        logger_.add(slow_sink, context=fork_context, format="{message}", enqueue=enqueue, catch=False)

        thread = threading.Thread(target=main)
        thread.start()

        process = fork_context.Process(target=worker)
        process.start()

        thread.join()
        process.join(2)

        assert process.exitcode == 0

        logger_.remove()

>       assert output.read_text() in ("Main\nChild\n", "Child\nMain\n")
E       AssertionError: assert '' in ('Main\nChild\n', 'Child\nMain\n')
E        +  where '' = read_text()
E        +    where read_text = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l3/stdout.txt').read_text

deepcopied = False
enqueue    = False
fork_context = 
logger_    = 
main       = .main at 0x7fac07de9e10>
output     = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l3/stdout.txt')
process    = 
slow_sink  = .slow_sink at 0x7fac07de9f30>
stdout     = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l3/stdout.txt' mode='w' encoding='UTF-8'>
thread     = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_no_deadlock_if_internal_l3')
worker     = .worker at 0x7fac07debd00>

tests/test_multiprocessing.py:582: AssertionError

test_multiprocessing.py::test_no_deadlock_if_external_lock_in_use[True]

test_multiprocessing.py::test_no_deadlock_if_external_lock_in_use[True]
enqueue = True
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08395e40>
fork_context = 

    @pytest.mark.skipif(sys.version_info < (3, 7), reason="No 'os.register_at_fork()' function")
    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.parametrize("enqueue", [True, False])
    def test_no_deadlock_if_external_lock_in_use(enqueue, capsys, fork_context):
        # Can't reproduce the bug on pytest (even if stderr is not wrapped), but let it anyway
        logger.add(sys.stderr, context=fork_context, enqueue=enqueue, catch=True, format="{message}")
        num = 100

        for i in range(num):
            logger.info("This is a message: {}", i)
            process = fork_context.Process(target=lambda: None)
            process.start()
            process.join(1)
            assert process.exitcode == 0

        logger.remove()

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == "".join("This is a message: %d\n" % i for i in range(num))
E       AssertionError: assert '' == 'This is a me...message: 99\n'
E         
E         - This is a message: 0
E         - This is a message: 1
E         - This is a message: 2
E         - This is a message: 3
E         - This is a message: 4
E         - This is a message: 5...
E         
E         ...Full output truncated (94 lines hidden), use '-vv' to show

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08395e40>
enqueue    = True
err        = ''
fork_context = 
i          = 99
num        = 100
out        = ''
process    = 

tests/test_multiprocessing.py:604: AssertionError

test_multiprocessing.py::test_no_deadlock_if_external_lock_in_use[False]

test_multiprocessing.py::test_no_deadlock_if_external_lock_in_use[False]
enqueue = False
capsys = <_pytest.capture.CaptureFixture object at 0x7fac082e48e0>
fork_context = 

    @pytest.mark.skipif(sys.version_info < (3, 7), reason="No 'os.register_at_fork()' function")
    @pytest.mark.skipif(os.name == "nt", reason="Windows does not support forking")
    @pytest.mark.parametrize("enqueue", [True, False])
    def test_no_deadlock_if_external_lock_in_use(enqueue, capsys, fork_context):
        # Can't reproduce the bug on pytest (even if stderr is not wrapped), but let it anyway
        logger.add(sys.stderr, context=fork_context, enqueue=enqueue, catch=True, format="{message}")
        num = 100

        for i in range(num):
            logger.info("This is a message: {}", i)
            process = fork_context.Process(target=lambda: None)
            process.start()
            process.join(1)
            assert process.exitcode == 0

        logger.remove()

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == "".join("This is a message: %d\n" % i for i in range(num))
E       AssertionError: assert '' == 'This is a me...message: 99\n'
E         
E         - This is a message: 0
E         - This is a message: 1
E         - This is a message: 2
E         - This is a message: 3
E         - This is a message: 4
E         - This is a message: 5...
E         
E         ...Full output truncated (94 lines hidden), use '-vv' to show

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac082e48e0>
enqueue    = False
err        = ''
fork_context = 
i          = 99
num        = 100
out        = ''
process    = 

tests/test_multiprocessing.py:604: AssertionError

test_opt.py::test_record

test_opt.py::test_record
writer = .w at 0x7fac07de9a20>

    def test_record(writer):
        logger.add(writer, format="{message}")

>       logger.opt(record=True).debug("1")
E       AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07de9a20>

tests/test_opt.py:14: AttributeError

test_opt.py::test_record_in_kwargs_too

test_opt.py::test_record_in_kwargs_too
writer = .w at 0x7fac07dfd3f0>

    def test_record_in_kwargs_too(writer):
        logger.add(writer, catch=False)

        with pytest.raises(TypeError, match=r"The message can't be formatted"):
>           logger.opt(record=True).info("Foo {record}", record=123)
E           AttributeError: 'NoneType' object has no attribute 'info'

writer     = .w at 0x7fac07dfd3f0>

tests/test_opt.py:25: AttributeError

test_opt.py::test_record_not_in_extra

test_opt.py::test_record_not_in_extra
def test_record_not_in_extra():
        extra = None

        def sink(message):
            nonlocal extra
            extra = message.record["extra"]

        logger.add(sink, catch=False)

>       logger.opt(record=True).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

extra      = None
sink       = .sink at 0x7fac07de9f30>

tests/test_opt.py:37: AttributeError

test_opt.py::test_kwargs_in_extra_of_record

test_opt.py::test_kwargs_in_extra_of_record
def test_kwargs_in_extra_of_record():
        message = None

        def sink(message_):
            nonlocal message
            message = message_

        logger.add(sink, format="{message}", catch=False)

>       logger.opt(record=True).info("Test {record[extra][foo]}", foo=123)
E       AttributeError: 'NoneType' object has no attribute 'info'

message    = None
sink       = .sink at 0x7fac07cb9240>

tests/test_opt.py:51: AttributeError

test_opt.py::test_exception_boolean

test_opt.py::test_exception_boolean
writer = .w at 0x7fac07cb9510>

    def test_exception_boolean(writer):
        logger.add(writer, format="{level.name}: {message}")

        try:
>           1 / 0  # noqa: B018
E           ZeroDivisionError: division by zero

writer     = .w at 0x7fac07cb9510>

tests/test_opt.py:61: ZeroDivisionError

During handling of the above exception, another exception occurred:

writer = .w at 0x7fac07cb9510>

    def test_exception_boolean(writer):
        logger.add(writer, format="{level.name}: {message}")

        try:
            1 / 0  # noqa: B018
        except Exception:
>           logger.opt(exception=True).debug("Error {0} {record}", 1, record="test")
E           AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07cb9510>

tests/test_opt.py:63: AttributeError

test_opt.py::test_exception_exc_info

test_opt.py::test_exception_exc_info
writer = .w at 0x7fac07cb91b0>

    def test_exception_exc_info(writer):
        logger.add(writer, format="{message}")

        try:
            1 / 0  # noqa: B018
        except Exception:
            exc_info = sys.exc_info()

>       logger.opt(exception=exc_info).debug("test")
E       AttributeError: 'NoneType' object has no attribute 'debug'

exc_info   = (, ZeroDivisionError('division by zero'), )
writer     = .w at 0x7fac07cb91b0>

tests/test_opt.py:79: AttributeError

test_opt.py::test_exception_class

test_opt.py::test_exception_class
writer = .w at 0x7fac07cb9120>

    def test_exception_class(writer):
        logger.add(writer, format="{message}")

        try:
            1 / 0  # noqa: B018
        except Exception:
            _, exc_class, _ = sys.exc_info()

>       logger.opt(exception=exc_class).debug("test")
E       AttributeError: 'NoneType' object has no attribute 'debug'

_          = 
exc_class  = ZeroDivisionError('division by zero')
writer     = .w at 0x7fac07cb9120>

tests/test_opt.py:95: AttributeError

test_opt.py::test_exception_log_funcion

test_opt.py::test_exception_log_funcion
writer = .w at 0x7fac07cb9ab0>

    def test_exception_log_funcion(writer):
        logger.add(writer, format="{level.no} {message}")

        try:
>           1 / 0  # noqa: B018
E           ZeroDivisionError: division by zero

writer     = .w at 0x7fac07cb9ab0>

tests/test_opt.py:107: ZeroDivisionError

During handling of the above exception, another exception occurred:

writer = .w at 0x7fac07cb9ab0>

    def test_exception_log_funcion(writer):
        logger.add(writer, format="{level.no} {message}")

        try:
            1 / 0  # noqa: B018
        except Exception:
>           logger.opt(exception=True).log(50, "Error")
E           AttributeError: 'NoneType' object has no attribute 'log'

writer     = .w at 0x7fac07cb9ab0>

tests/test_opt.py:109: AttributeError

test_opt.py::test_lazy

test_opt.py::test_lazy
writer = .w at 0x7fac07cb9f30>

    def test_lazy(writer):
        counter = 0

        def laziness():
            nonlocal counter
            counter += 1
            return counter

        logger.add(writer, level=10, format="{level.no} => {message}")

>       logger.opt(lazy=True).log(10, "1: {lazy}", lazy=laziness)
E       AttributeError: 'NoneType' object has no attribute 'log'

counter    = 0
laziness   = .laziness at 0x7fac07cb8160>
writer     = .w at 0x7fac07cb9f30>

tests/test_opt.py:127: AttributeError

test_opt.py::test_logging_within_lazy_function

test_opt.py::test_logging_within_lazy_function
writer = .w at 0x7fac07cba170>

    def test_logging_within_lazy_function(writer):
        logger.add(writer, level=20, format="{message}")

        def laziness():
            logger.trace("Nope")
            logger.warning("Yes Warn")

>       logger.opt(lazy=True).trace("No", laziness)
E       AttributeError: 'NoneType' object has no attribute 'trace'

laziness   = .laziness at 0x7fac07cba710>
writer     = .w at 0x7fac07cba170>

tests/test_opt.py:157: AttributeError

test_opt.py::test_depth

test_opt.py::test_depth
writer = .w at 0x7fac07cba3b0>

    def test_depth(writer):
        logger.add(writer, format="{function} : {message}")

        def a():
            logger.opt(depth=1).debug("Test 1")
            logger.opt(depth=0).debug("Test 2")
            logger.opt(depth=1).log(10, "Test 3")

>       a()

a          = .a at 0x7fac07cba9e0>
writer     = .w at 0x7fac07cba3b0>

tests/test_opt.py:174: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def a():
>       logger.opt(depth=1).debug("Test 1")
E       AttributeError: 'NoneType' object has no attribute 'debug'


tests/test_opt.py:170: AttributeError

test_opt.py::test_capture

test_opt.py::test_capture
writer = .w at 0x7fac07cba680>

    def test_capture(writer):
        logger.add(writer, format="{message} {extra}")
>       logger.opt(capture=False).info("No {}", 123, no=False)
E       AttributeError: 'NoneType' object has no attribute 'info'

writer     = .w at 0x7fac07cba680>

tests/test_opt.py:183: AttributeError

test_opt.py::test_colors

test_opt.py::test_colors
writer = .w at 0x7fac07cba950>

    def test_colors(writer):
        logger.add(writer, format="a {message}", colorize=True)
>       logger.opt(colors=True).debug("b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07cba950>

tests/test_opt.py:191: AttributeError

test_opt.py::test_colors_not_colorize

test_opt.py::test_colors_not_colorize
writer = .w at 0x7fac07cbacb0>

    def test_colors_not_colorize(writer):
        logger.add(writer, format="a {message}", colorize=False)
>       logger.opt(colors=True).debug("b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07cbacb0>

tests/test_opt.py:201: AttributeError

test_opt.py::test_colors_doesnt_color_unrelated

test_opt.py::test_colors_doesnt_color_unrelated
writer = .w at 0x7fac07cbb010>

    def test_colors_doesnt_color_unrelated(writer):
        logger.add(writer, format="{message} {extra[trap]}", colorize=True)
>       logger.bind(trap="B").opt(colors=True).debug("A")
E       AttributeError: 'NoneType' object has no attribute 'opt'

writer     = .w at 0x7fac07cbb010>

tests/test_opt.py:207: AttributeError

test_opt.py::test_colors_doesnt_strip_unrelated

test_opt.py::test_colors_doesnt_strip_unrelated
writer = .w at 0x7fac07cbb130>

    def test_colors_doesnt_strip_unrelated(writer):
        logger.add(writer, format="{message} {extra[trap]}", colorize=False)
>       logger.bind(trap="B").opt(colors=True).debug("A")
E       AttributeError: 'NoneType' object has no attribute 'opt'

writer     = .w at 0x7fac07cbb130>

tests/test_opt.py:213: AttributeError

test_opt.py::test_colors_doesnt_raise_unrelated_colorize

test_opt.py::test_colors_doesnt_raise_unrelated_colorize
writer = .w at 0x7fac07cbb370>

    def test_colors_doesnt_raise_unrelated_colorize(writer):
        logger.add(writer, format="{message} {extra[trap]}", colorize=True, catch=False)
>       logger.bind(trap="").opt(colors=True).debug("A")
E       AttributeError: 'NoneType' object has no attribute 'opt'

writer     = .w at 0x7fac07cbb370>

tests/test_opt.py:219: AttributeError

test_opt.py::test_colors_doesnt_raise_unrelated_not_colorize

test_opt.py::test_colors_doesnt_raise_unrelated_not_colorize
writer = .w at 0x7fac07cbb5b0>

    def test_colors_doesnt_raise_unrelated_not_colorize(writer):
        logger.add(writer, format="{message} {extra[trap]}", colorize=False, catch=False)
>       logger.bind(trap="").opt(colors=True).debug("A")
E       AttributeError: 'NoneType' object has no attribute 'opt'

writer     = .w at 0x7fac07cbb5b0>

tests/test_opt.py:225: AttributeError

test_opt.py::test_colors_doesnt_raise_unrelated_colorize_dynamic

test_opt.py::test_colors_doesnt_raise_unrelated_colorize_dynamic
writer = .w at 0x7fac07cbb760>

    def test_colors_doesnt_raise_unrelated_colorize_dynamic(writer):
        logger.add(writer, format=lambda x: "{message} {extra[trap]}", colorize=True, catch=False)
>       logger.bind(trap="").opt(colors=True).debug("A")
E       AttributeError: 'NoneType' object has no attribute 'opt'

writer     = .w at 0x7fac07cbb760>

tests/test_opt.py:231: AttributeError

test_opt.py::test_colors_doesnt_raise_unrelated_not_colorize_dynamic

test_opt.py::test_colors_doesnt_raise_unrelated_not_colorize_dynamic
writer = .w at 0x7fac07cb9ab0>

    def test_colors_doesnt_raise_unrelated_not_colorize_dynamic(writer):
        logger.add(writer, format=lambda x: "{message} {extra[trap]}", colorize=False, catch=False)
>       logger.bind(trap="").opt(colors=True).debug("A")
E       AttributeError: 'NoneType' object has no attribute 'opt'

writer     = .w at 0x7fac07cb9ab0>

tests/test_opt.py:237: AttributeError

test_opt.py::test_colors_within_record[True]

test_opt.py::test_colors_within_record[True]
writer = .w at 0x7fac07cbb9a0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_within_record(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
        logger_ = logger.bind(start="", end="")
>       logger_.opt(colors=True, record=True).debug("{record[extra][start]}B{record[extra][end]}")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colorize   = True
logger_    = None
writer     = .w at 0x7fac07cbb9a0>

tests/test_opt.py:245: AttributeError

test_opt.py::test_colors_within_record[False]

test_opt.py::test_colors_within_record[False]
writer = .w at 0x7fac07cbbc70>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_within_record(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
        logger_ = logger.bind(start="", end="")
>       logger_.opt(colors=True, record=True).debug("{record[extra][start]}B{record[extra][end]}")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colorize   = False
logger_    = None
writer     = .w at 0x7fac07cbbc70>

tests/test_opt.py:245: AttributeError

test_opt.py::test_colors_nested[True]

test_opt.py::test_colors_nested[True]
writer = .w at 0x7fac07cbae60>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_nested(writer, colorize):
        logger.add(writer, format="([{message}])", colorize=colorize)
>       logger.opt(colors=True).debug("ABCDE")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cbae60>

tests/test_opt.py:252: AttributeError

test_opt.py::test_colors_nested[False]

test_opt.py::test_colors_nested[False]
writer = .w at 0x7fac07cba680>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_nested(writer, colorize):
        logger.add(writer, format="([{message}])", colorize=colorize)
>       logger.opt(colors=True).debug("ABCDE")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cba680>

tests/test_opt.py:252: AttributeError

test_opt.py::test_colors_stripped_in_message_record[True]

test_opt.py::test_colors_stripped_in_message_record[True]
colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_stripped_in_message_record(colorize):
        message = None

        def sink(msg):
            nonlocal message
            message = msg.record["message"]

        logger.add(sink, colorize=colorize)
>       logger.opt(colors=True).debug("Test")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
message    = None
sink       = .sink at 0x7fac07cbbbe0>

tests/test_opt.py:267: AttributeError

test_opt.py::test_colors_stripped_in_message_record[False]

test_opt.py::test_colors_stripped_in_message_record[False]
colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_stripped_in_message_record(colorize):
        message = None

        def sink(msg):
            nonlocal message
            message = msg.record["message"]

        logger.add(sink, colorize=colorize)
>       logger.opt(colors=True).debug("Test")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
message    = None
sink       = .sink at 0x7fac07de9990>

tests/test_opt.py:267: AttributeError

test_opt.py::test_invalid_markup_in_message[True-]

test_opt.py::test_invalid_markup_in_message[True-]
writer = .w at 0x7fac07cbb1c0>, message = ''
colorize = True

    @pytest.mark.parametrize("message", ["", "", "X   Y"])
    @pytest.mark.parametrize("colorize", [True, False])
    def test_invalid_markup_in_message(writer, message, colorize):
        logger.add(writer, format="{message}", colorize=colorize, catch=False)
        with pytest.raises(ValueError):
>           logger.opt(colors=True).debug(message)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
message    = ''
writer     = .w at 0x7fac07cbb1c0>

tests/test_opt.py:276: AttributeError

red>]

red>]
writer = .w at 0x7fac07cba4d0>, message = ''
colorize = True

    @pytest.mark.parametrize("message", ["", "", "X   Y"])
    @pytest.mark.parametrize("colorize", [True, False])
    def test_invalid_markup_in_message(writer, message, colorize):
        logger.add(writer, format="{message}", colorize=colorize, catch=False)
        with pytest.raises(ValueError):
>           logger.opt(colors=True).debug(message)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
message    = ''
writer     = .w at 0x7fac07cba4d0>

tests/test_opt.py:276: AttributeError

red> Y]

red>  Y]
writer = .w at 0x7fac07cbb130>
message = 'X   Y', colorize = True

    @pytest.mark.parametrize("message", ["", "", "X   Y"])
    @pytest.mark.parametrize("colorize", [True, False])
    def test_invalid_markup_in_message(writer, message, colorize):
        logger.add(writer, format="{message}", colorize=colorize, catch=False)
        with pytest.raises(ValueError):
>           logger.opt(colors=True).debug(message)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
message    = 'X   Y'
writer     = .w at 0x7fac07cbb130>

tests/test_opt.py:276: AttributeError

test_opt.py::test_invalid_markup_in_message[False-]

test_opt.py::test_invalid_markup_in_message[False-]
writer = .w at 0x7fac07cb9f30>, message = ''
colorize = False

    @pytest.mark.parametrize("message", ["", "", "X   Y"])
    @pytest.mark.parametrize("colorize", [True, False])
    def test_invalid_markup_in_message(writer, message, colorize):
        logger.add(writer, format="{message}", colorize=colorize, catch=False)
        with pytest.raises(ValueError):
>           logger.opt(colors=True).debug(message)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
message    = ''
writer     = .w at 0x7fac07cb9f30>

tests/test_opt.py:276: AttributeError

red>]

red>]
writer = .w at 0x7fac07cba5f0>, message = ''
colorize = False

    @pytest.mark.parametrize("message", ["", "", "X   Y"])
    @pytest.mark.parametrize("colorize", [True, False])
    def test_invalid_markup_in_message(writer, message, colorize):
        logger.add(writer, format="{message}", colorize=colorize, catch=False)
        with pytest.raises(ValueError):
>           logger.opt(colors=True).debug(message)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
message    = ''
writer     = .w at 0x7fac07cba5f0>

tests/test_opt.py:276: AttributeError

red> Y]

red>  Y]
writer = .w at 0x7fac07cb81f0>
message = 'X   Y', colorize = False

    @pytest.mark.parametrize("message", ["", "", "X   Y"])
    @pytest.mark.parametrize("colorize", [True, False])
    def test_invalid_markup_in_message(writer, message, colorize):
        logger.add(writer, format="{message}", colorize=colorize, catch=False)
        with pytest.raises(ValueError):
>           logger.opt(colors=True).debug(message)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
message    = 'X   Y'
writer     = .w at 0x7fac07cb81f0>

tests/test_opt.py:276: AttributeError

test_opt.py::test_colors_with_args[True]

test_opt.py::test_colors_with_args[True]
writer = .w at 0x7fac07cba0e0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_args(writer, colorize):
        logger.add(writer, format="=> {message} <=", colorize=colorize)
>       logger.opt(colors=True).debug("the {0}test{end}", "", end="")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cba0e0>

tests/test_opt.py:282: AttributeError

test_opt.py::test_colors_with_args[False]

test_opt.py::test_colors_with_args[False]
writer = .w at 0x7fac07cb9fc0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_args(writer, colorize):
        logger.add(writer, format="=> {message} <=", colorize=colorize)
>       logger.opt(colors=True).debug("the {0}test{end}", "", end="")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cb9fc0>

tests/test_opt.py:282: AttributeError

test_opt.py::test_colors_with_level[True]

test_opt.py::test_colors_with_level[True]
writer = .w at 0x7fac07cb9990>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_level(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
        logger.level("DEBUG", color="")
>       logger.opt(colors=True).debug("a level b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cb9990>

tests/test_opt.py:290: AttributeError

test_opt.py::test_colors_with_level[False]

test_opt.py::test_colors_with_level[False]
writer = .w at 0x7fac07cbbd90>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_level(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
        logger.level("DEBUG", color="")
>       logger.opt(colors=True).debug("a level b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cbbd90>

tests/test_opt.py:290: AttributeError

test_opt.py::test_colors_double_message[True]

test_opt.py::test_colors_double_message[True]
writer = .w at 0x7fac07cbb0a0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_double_message(writer, colorize):
        logger.add(
            writer, format="{message}... - ...{message}", colorize=colorize
        )
>       logger.opt(colors=True).debug("foo bar baz")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cbb0a0>

tests/test_opt.py:299: AttributeError

test_opt.py::test_colors_double_message[False]

test_opt.py::test_colors_double_message[False]
writer = .w at 0x7fac07cba7a0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_double_message(writer, colorize):
        logger.add(
            writer, format="{message}... - ...{message}", colorize=colorize
        )
>       logger.opt(colors=True).debug("foo bar baz")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cba7a0>

tests/test_opt.py:299: AttributeError

test_opt.py::test_colors_multiple_calls[True]

test_opt.py::test_colors_multiple_calls[True]
writer = .w at 0x7fac07cbacb0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_multiple_calls(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
>       logger.opt(colors=True).debug("a foo b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cbacb0>

tests/test_opt.py:310: AttributeError

test_opt.py::test_colors_multiple_calls[False]

test_opt.py::test_colors_multiple_calls[False]
writer = .w at 0x7fac07cba170>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_multiple_calls(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
>       logger.opt(colors=True).debug("a foo b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cba170>

tests/test_opt.py:310: AttributeError

test_opt.py::test_colors_multiple_calls_level_color_changed[True]

test_opt.py::test_colors_multiple_calls_level_color_changed[True]
writer = .w at 0x7fac07cbac20>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_multiple_calls_level_color_changed(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
        logger.level("INFO", color="")
>       logger.opt(colors=True).info("a foo b")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cbac20>

tests/test_opt.py:319: AttributeError

test_opt.py::test_colors_multiple_calls_level_color_changed[False]

test_opt.py::test_colors_multiple_calls_level_color_changed[False]
writer = .w at 0x7fac07cba950>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_multiple_calls_level_color_changed(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
        logger.level("INFO", color="")
>       logger.opt(colors=True).info("a foo b")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cba950>

tests/test_opt.py:319: AttributeError

test_opt.py::test_colors_with_dynamic_formatter[True]

test_opt.py::test_colors_with_dynamic_formatter[True]
writer = .w at 0x7fac07cbbac0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_dynamic_formatter(writer, colorize):
        logger.add(writer, format=lambda r: "{message}", colorize=colorize)
>       logger.opt(colors=True).debug("a b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cbbac0>

tests/test_opt.py:328: AttributeError

test_opt.py::test_colors_with_dynamic_formatter[False]

test_opt.py::test_colors_with_dynamic_formatter[False]
writer = .w at 0x7fac07cba290>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_dynamic_formatter(writer, colorize):
        logger.add(writer, format=lambda r: "{message}", colorize=colorize)
>       logger.opt(colors=True).debug("a b")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cba290>

tests/test_opt.py:328: AttributeError

test_opt.py::test_colors_with_format_specs[True]

test_opt.py::test_colors_with_format_specs[True]
writer = .w at 0x7fac07cbb910>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_format_specs(writer, colorize):
        fmt = "{level.no:03d} {message:} {message!s:} {{nope}} {extra[a][b]!r}"
        logger.add(writer, colorize=colorize, format=fmt)
>       logger.bind(a={"b": "c"}).opt(colors=True).debug("{X}")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colorize   = True
fmt        = '{level.no:03d} {message:} {message!s:} {{nope}} {extra[a][b]!r}'
writer     = .w at 0x7fac07cbb910>

tests/test_opt.py:336: AttributeError

test_opt.py::test_colors_with_format_specs[False]

test_opt.py::test_colors_with_format_specs[False]
writer = .w at 0x7fac07cba0e0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_format_specs(writer, colorize):
        fmt = "{level.no:03d} {message:} {message!s:} {{nope}} {extra[a][b]!r}"
        logger.add(writer, colorize=colorize, format=fmt)
>       logger.bind(a={"b": "c"}).opt(colors=True).debug("{X}")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colorize   = False
fmt        = '{level.no:03d} {message:} {message!s:} {{nope}} {extra[a][b]!r}'
writer     = .w at 0x7fac07cba0e0>

tests/test_opt.py:336: AttributeError

test_opt.py::test_colors_with_message_specs[True]

test_opt.py::test_colors_with_message_specs[True]
writer = .w at 0x7fac07cbb400>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_message_specs(writer, colorize):
        logger.add(writer, colorize=colorize, format="{message}")
>       logger.opt(colors=True).debug("{} A {{nope}} {key:03d} {let!r}", 1, key=10, let="c")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
writer     = .w at 0x7fac07cbb400>

tests/test_opt.py:343: AttributeError

test_opt.py::test_colors_with_message_specs[False]

test_opt.py::test_colors_with_message_specs[False]
writer = .w at 0x7fac07cbac20>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_message_specs(writer, colorize):
        logger.add(writer, colorize=colorize, format="{message}")
>       logger.opt(colors=True).debug("{} A {{nope}} {key:03d} {let!r}", 1, key=10, let="c")
E       AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
writer     = .w at 0x7fac07cbac20>

tests/test_opt.py:343: AttributeError

test_opt.py::test_colored_string_used_as_spec[True]

test_opt.py::test_colored_string_used_as_spec[True]
writer = .w at 0x7fac07cbaa70>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colored_string_used_as_spec(writer, colorize):
        logger.add(writer, colorize=colorize, format="{level.no:{message}} {message}")
>       logger.opt(colors=True).log(30, "03d")
E       AttributeError: 'NoneType' object has no attribute 'log'

colorize   = True
writer     = .w at 0x7fac07cbaa70>

tests/test_opt.py:353: AttributeError

test_opt.py::test_colored_string_used_as_spec[False]

test_opt.py::test_colored_string_used_as_spec[False]
writer = .w at 0x7fac07cbb0a0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colored_string_used_as_spec(writer, colorize):
        logger.add(writer, colorize=colorize, format="{level.no:{message}} {message}")
>       logger.opt(colors=True).log(30, "03d")
E       AttributeError: 'NoneType' object has no attribute 'log'

colorize   = False
writer     = .w at 0x7fac07cbb0a0>

tests/test_opt.py:353: AttributeError

test_opt.py::test_colored_string_getitem[True]

test_opt.py::test_colored_string_getitem[True]
writer = .w at 0x7fac07cb9510>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colored_string_getitem(writer, colorize):
        logger.add(writer, colorize=colorize, format="{message[0]}")
>       logger.opt(colors=True).info("ABC")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cb9510>

tests/test_opt.py:360: AttributeError

test_opt.py::test_colored_string_getitem[False]

test_opt.py::test_colored_string_getitem[False]
writer = .w at 0x7fac07cbb010>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colored_string_getitem(writer, colorize):
        logger.add(writer, colorize=colorize, format="{message[0]}")
>       logger.opt(colors=True).info("ABC")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cbb010>

tests/test_opt.py:360: AttributeError

test_opt.py::test_colors_without_formatting_args[True]

test_opt.py::test_colors_without_formatting_args[True]
writer = .w at 0x7fac07cba950>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_without_formatting_args(writer, colorize):
        string = "{} This { should } not } raise {"
        logger.add(writer, colorize=colorize, format="{message}")
>       logger.opt(colors=True).info(string)
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
string     = '{} This { should } not } raise {'
writer     = .w at 0x7fac07cba950>

tests/test_opt.py:368: AttributeError

test_opt.py::test_colors_without_formatting_args[False]

test_opt.py::test_colors_without_formatting_args[False]
writer = .w at 0x7fac07cbad40>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_without_formatting_args(writer, colorize):
        string = "{} This { should } not } raise {"
        logger.add(writer, colorize=colorize, format="{message}")
>       logger.opt(colors=True).info(string)
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
string     = '{} This { should } not } raise {'
writer     = .w at 0x7fac07cbad40>

tests/test_opt.py:368: AttributeError

test_opt.py::test_colors_with_recursion_depth_exceeded_in_format[True]

test_opt.py::test_colors_with_recursion_depth_exceeded_in_format[True]
writer = .w at 0x7fac07cbbeb0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_recursion_depth_exceeded_in_format(writer, colorize):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

colorize   = True
writer     = .w at 0x7fac07cbbeb0>

tests/test_opt.py:374: Failed

test_opt.py::test_colors_with_recursion_depth_exceeded_in_format[False]

test_opt.py::test_colors_with_recursion_depth_exceeded_in_format[False]
writer = .w at 0x7fac07cbaef0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_recursion_depth_exceeded_in_format(writer, colorize):
>       with pytest.raises(ValueError, match=r"Invalid format"):
E       Failed: DID NOT RAISE 

colorize   = False
writer     = .w at 0x7fac07cbaef0>

tests/test_opt.py:374: Failed

test_opt.py::test_colors_with_recursion_depth_exceeded_in_message[True]

test_opt.py::test_colors_with_recursion_depth_exceeded_in_message[True]
writer = .w at 0x7fac07cbbd90>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_recursion_depth_exceeded_in_message(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)

        with pytest.raises(ValueError, match=r"Max string recursion exceeded"):
>           logger.opt(colors=True).info("{foo:{foo:{foo:}}}", foo=123)
E           AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cbbd90>

tests/test_opt.py:383: AttributeError

test_opt.py::test_colors_with_recursion_depth_exceeded_in_message[False]

test_opt.py::test_colors_with_recursion_depth_exceeded_in_message[False]
writer = .w at 0x7fac07cbb130>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_recursion_depth_exceeded_in_message(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)

        with pytest.raises(ValueError, match=r"Max string recursion exceeded"):
>           logger.opt(colors=True).info("{foo:{foo:{foo:}}}", foo=123)
E           AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cbb130>

tests/test_opt.py:383: AttributeError

test_opt.py::test_colors_with_auto_indexing[True]

test_opt.py::test_colors_with_auto_indexing[True]
writer = .w at 0x7fac07cba3b0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_auto_indexing(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
>       logger.opt(colors=True).info("{} {}", "foo", "bar")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cba3b0>

tests/test_opt.py:389: AttributeError

test_opt.py::test_colors_with_auto_indexing[False]

test_opt.py::test_colors_with_auto_indexing[False]
writer = .w at 0x7fac07cba5f0>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_auto_indexing(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
>       logger.opt(colors=True).info("{} {}", "foo", "bar")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cba5f0>

tests/test_opt.py:389: AttributeError

test_opt.py::test_colors_with_manual_indexing[True]

test_opt.py::test_colors_with_manual_indexing[True]
writer = .w at 0x7fac07cb97e0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_manual_indexing(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
>       logger.opt(colors=True).info("{1} {0}", "foo", "bar")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cb97e0>

tests/test_opt.py:396: AttributeError

test_opt.py::test_colors_with_manual_indexing[False]

test_opt.py::test_colors_with_manual_indexing[False]
writer = .w at 0x7fac07cbb880>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_colors_with_manual_indexing(writer, colorize):
        logger.add(writer, format="{message}", colorize=colorize)
>       logger.opt(colors=True).info("{1} {0}", "foo", "bar")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cbb880>

tests/test_opt.py:396: AttributeError

test_opt.py::test_colors_with_invalid_indexing[{} {0}-True]

test_opt.py::test_colors_with_invalid_indexing[{} {0}-True]
writer = .w at 0x7fac07cba7a0>, colorize = True
message = '{} {0}'

    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("message", ["{} {0}", "{1} {}"])
    def test_colors_with_invalid_indexing(writer, colorize, message):
        logger.add(writer, format="{message}", colorize=colorize)

        with pytest.raises(ValueError, match=r"cannot switch"):
>           logger.opt(colors=True).debug(message, 1, 2, 3)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
message    = '{} {0}'
writer     = .w at 0x7fac07cba7a0>

tests/test_opt.py:406: AttributeError

test_opt.py::test_colors_with_invalid_indexing[{} {0}-False]

test_opt.py::test_colors_with_invalid_indexing[{} {0}-False]
writer = .w at 0x7fac07cbb6d0>, colorize = False
message = '{} {0}'

    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("message", ["{} {0}", "{1} {}"])
    def test_colors_with_invalid_indexing(writer, colorize, message):
        logger.add(writer, format="{message}", colorize=colorize)

        with pytest.raises(ValueError, match=r"cannot switch"):
>           logger.opt(colors=True).debug(message, 1, 2, 3)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
message    = '{} {0}'
writer     = .w at 0x7fac07cbb6d0>

tests/test_opt.py:406: AttributeError

test_opt.py::test_colors_with_invalid_indexing[{1} {}-True]

test_opt.py::test_colors_with_invalid_indexing[{1} {}-True]
writer = .w at 0x7fac07cbb0a0>, colorize = True
message = '{1} {}'

    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("message", ["{} {0}", "{1} {}"])
    def test_colors_with_invalid_indexing(writer, colorize, message):
        logger.add(writer, format="{message}", colorize=colorize)

        with pytest.raises(ValueError, match=r"cannot switch"):
>           logger.opt(colors=True).debug(message, 1, 2, 3)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = True
message    = '{1} {}'
writer     = .w at 0x7fac07cbb0a0>

tests/test_opt.py:406: AttributeError

test_opt.py::test_colors_with_invalid_indexing[{1} {}-False]

test_opt.py::test_colors_with_invalid_indexing[{1} {}-False]
writer = .w at 0x7fac07cb8ee0>, colorize = False
message = '{1} {}'

    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("message", ["{} {0}", "{1} {}"])
    def test_colors_with_invalid_indexing(writer, colorize, message):
        logger.add(writer, format="{message}", colorize=colorize)

        with pytest.raises(ValueError, match=r"cannot switch"):
>           logger.opt(colors=True).debug(message, 1, 2, 3)
E           AttributeError: 'NoneType' object has no attribute 'debug'

colorize   = False
message    = '{1} {}'
writer     = .w at 0x7fac07cb8ee0>

tests/test_opt.py:406: AttributeError

test_opt.py::test_raw

test_opt.py::test_raw
writer = .w at 0x7fac07cba4d0>

    def test_raw(writer):
        logger.add(writer, format="", colorize=True)
>       logger.opt(raw=True).info("Raw {}", "message")
E       AttributeError: 'NoneType' object has no attribute 'info'

writer     = .w at 0x7fac07cba4d0>

tests/test_opt.py:411: AttributeError

test_opt.py::test_raw_with_format_function

test_opt.py::test_raw_with_format_function
writer = .w at 0x7fac07cbb1c0>

    def test_raw_with_format_function(writer):
        logger.add(writer, format=lambda _: "{time} \n")
>       logger.opt(raw=True).debug("Raw {message} bis", message="message")
E       AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07cbb1c0>

tests/test_opt.py:418: AttributeError

test_opt.py::test_raw_with_colors[True]

test_opt.py::test_raw_with_colors[True]
writer = .w at 0x7fac07cbacb0>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_raw_with_colors(writer, colorize):
        logger.add(writer, format="XYZ", colorize=colorize)
>       logger.opt(raw=True, colors=True).info("Raw colors and level")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cbacb0>

tests/test_opt.py:425: AttributeError

test_opt.py::test_raw_with_colors[False]

test_opt.py::test_raw_with_colors[False]
writer = .w at 0x7fac07cbae60>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_raw_with_colors(writer, colorize):
        logger.add(writer, format="XYZ", colorize=colorize)
>       logger.opt(raw=True, colors=True).info("Raw colors and level")
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cbae60>

tests/test_opt.py:425: AttributeError

test_opt.py::test_args_with_colors_not_formatted_twice

test_opt.py::test_args_with_colors_not_formatted_twice
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0876dc30>

    def test_args_with_colors_not_formatted_twice(capsys):
        logger.add(sys.stdout, format="{message}", colorize=True)
        logger.add(sys.stderr, format="{message}", colorize=False)
        a = MagicMock(__format__=MagicMock(return_value="a"))
        b = MagicMock(__format__=MagicMock(return_value="b"))

>       logger.opt(colors=True).info("{} {foo}", a, foo=b)
E       AttributeError: 'NoneType' object has no attribute 'info'

a          = 
b          = 
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0876dc30>

tests/test_opt.py:435: AttributeError

test_opt.py::test_level_tag_wrapping_with_colors[True]

test_opt.py::test_level_tag_wrapping_with_colors[True]
writer = .w at 0x7fac07cbaf80>, colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_level_tag_wrapping_with_colors(writer, colorize):
        logger.add(writer, format="FOO {message} BAR", colorize=colorize)
>       logger.opt(colors=True).info("> foo {} bar {} baz {} <", 1, 2, 3)
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = True
writer     = .w at 0x7fac07cbaf80>

tests/test_opt.py:446: AttributeError

test_opt.py::test_level_tag_wrapping_with_colors[False]

test_opt.py::test_level_tag_wrapping_with_colors[False]
writer = .w at 0x7fac07cbb910>, colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_level_tag_wrapping_with_colors(writer, colorize):
        logger.add(writer, format="FOO {message} BAR", colorize=colorize)
>       logger.opt(colors=True).info("> foo {} bar {} baz {} <", 1, 2, 3)
E       AttributeError: 'NoneType' object has no attribute 'info'

colorize   = False
writer     = .w at 0x7fac07cbb910>

tests/test_opt.py:446: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-True-True-True]

test_opt.py::test_all_colors_combinations[True-True-True-True-True-True]
writer = .w at 0x7fac07cbaa70>, dynamic_format = True
colorize = True, colors = True, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb490>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cbaa70>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-True-True-False]

test_opt.py::test_all_colors_combinations[True-True-True-True-True-False]
writer = .w at 0x7fac07cb9f30>, dynamic_format = False
colorize = True, colors = True, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cba0e0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cb9f30>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-True-False-True]

test_opt.py::test_all_colors_combinations[True-True-True-True-False-True]
writer = .w at 0x7fac07cbbf40>, dynamic_format = True
colorize = False, colors = True, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cb9ab0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cbbf40>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-True-False-False]

test_opt.py::test_all_colors_combinations[True-True-True-True-False-False]
writer = .w at 0x7fac07cbb880>, dynamic_format = False
colorize = False, colors = True, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb9a0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cbb880>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-False-True-True]

test_opt.py::test_all_colors_combinations[True-True-True-False-True-True]
writer = .w at 0x7fac07cba290>, dynamic_format = True
colorize = True, colors = False, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb6d0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cba290>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-False-True-False]

test_opt.py::test_all_colors_combinations[True-True-True-False-True-False]
writer = .w at 0x7fac07cbbac0>, dynamic_format = False
colorize = True, colors = False, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cba440>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cbbac0>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-False-False-True]

test_opt.py::test_all_colors_combinations[True-True-True-False-False-True]
writer = .w at 0x7fac07cba950>, dynamic_format = True
colorize = False, colors = False, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb880>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cba950>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-True-False-False-False]

test_opt.py::test_all_colors_combinations[True-True-True-False-False-False]
writer = .w at 0x7fac07cb9240>, dynamic_format = False
colorize = False, colors = False, raw = True, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb1c0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cb9240>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-True-True-True]

test_opt.py::test_all_colors_combinations[True-True-False-True-True-True]
writer = .w at 0x7fac07c7ce50>, dynamic_format = True
colorize = True, colors = True, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d360>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07c7ce50>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-True-True-False]

test_opt.py::test_all_colors_combinations[True-True-False-True-True-False]
writer = .w at 0x7fac07c7c430>, dynamic_format = False
colorize = True, colors = True, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c280>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07c7c430>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-True-False-True]

test_opt.py::test_all_colors_combinations[True-True-False-True-False-True]
writer = .w at 0x7fac07c7c160>, dynamic_format = True
colorize = False, colors = True, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c700>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07c7c160>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-True-False-False]

test_opt.py::test_all_colors_combinations[True-True-False-True-False-False]
writer = .w at 0x7fac07c7c550>, dynamic_format = False
colorize = False, colors = True, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7cd30>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07c7c550>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-False-True-True]

test_opt.py::test_all_colors_combinations[True-True-False-False-True-True]
writer = .w at 0x7fac07c7c310>, dynamic_format = True
colorize = True, colors = False, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d240>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07c7c310>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-False-True-False]

test_opt.py::test_all_colors_combinations[True-True-False-False-True-False]
writer = .w at 0x7fac07c7c790>, dynamic_format = False
colorize = True, colors = False, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d630>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07c7c790>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-False-False-True]

test_opt.py::test_all_colors_combinations[True-True-False-False-False-True]
writer = .w at 0x7fac07cbb1c0>, dynamic_format = True
colorize = False, colors = False, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb370>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cbb1c0>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-True-False-False-False-False]

test_opt.py::test_all_colors_combinations[True-True-False-False-False-False]
writer = .w at 0x7fac07cbb9a0>, dynamic_format = False
colorize = False, colors = False, raw = False, use_log = True, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
>               logger_.log(20, message, arg)
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cb81f0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = True
writer     = .w at 0x7fac07cbb9a0>

tests/test_opt.py:476: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-True-True-True]

test_opt.py::test_all_colors_combinations[True-False-True-True-True-True]
writer = .w at 0x7fac07cb9240>, dynamic_format = True
colorize = True, colors = True, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb6d0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cb9240>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-True-True-False]

test_opt.py::test_all_colors_combinations[True-False-True-True-True-False]
writer = .w at 0x7fac07cbbc70>, dynamic_format = False
colorize = True, colors = True, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbae60>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cbbc70>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-True-False-True]

test_opt.py::test_all_colors_combinations[True-False-True-True-False-True]
writer = .w at 0x7fac07cba440>, dynamic_format = True
colorize = False, colors = True, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb490>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cba440>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-True-False-False]

test_opt.py::test_all_colors_combinations[True-False-True-True-False-False]
writer = .w at 0x7fac07cbbf40>, dynamic_format = False
colorize = False, colors = True, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cba5f0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cbbf40>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-False-True-True]

test_opt.py::test_all_colors_combinations[True-False-True-False-True-True]
writer = .w at 0x7fac07c7c0d0>, dynamic_format = True
colorize = True, colors = False, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d7e0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7c0d0>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-False-True-False]

test_opt.py::test_all_colors_combinations[True-False-True-False-True-False]
writer = .w at 0x7fac07c7dd80>, dynamic_format = False
colorize = True, colors = False, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7db40>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7dd80>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-False-False-True]

test_opt.py::test_all_colors_combinations[True-False-True-False-False-True]
writer = .w at 0x7fac07c7d990>, dynamic_format = True
colorize = False, colors = False, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7dfc0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7d990>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-True-False-False-False]

test_opt.py::test_all_colors_combinations[True-False-True-False-False-False]
writer = .w at 0x7fac07c7d750>, dynamic_format = False
colorize = False, colors = False, raw = True, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c280>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7d750>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-True-True-True]

test_opt.py::test_all_colors_combinations[True-False-False-True-True-True]
writer = .w at 0x7fac07c7dbd0>, dynamic_format = True
colorize = True, colors = True, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7e710>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7dbd0>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-True-True-False]

test_opt.py::test_all_colors_combinations[True-False-False-True-True-False]
writer = .w at 0x7fac07c7e050>, dynamic_format = False
colorize = True, colors = True, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7eb90>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7e050>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-True-False-True]

test_opt.py::test_all_colors_combinations[True-False-False-True-False-True]
writer = .w at 0x7fac07c7e320>, dynamic_format = True
colorize = False, colors = True, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c8b0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7e320>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-True-False-False]

test_opt.py::test_all_colors_combinations[True-False-False-True-False-False]
writer = .w at 0x7fac07c7e7a0>, dynamic_format = False
colorize = False, colors = True, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c700>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7e7a0>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-False-True-True]

test_opt.py::test_all_colors_combinations[True-False-False-False-True-True]
writer = .w at 0x7fac07c7c310>, dynamic_format = True
colorize = True, colors = False, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7ca60>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07c7c310>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-False-True-False]

test_opt.py::test_all_colors_combinations[True-False-False-False-True-False]
writer = .w at 0x7fac07cba5f0>, dynamic_format = False
colorize = True, colors = False, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cba950>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cba5f0>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-False-False-True]

test_opt.py::test_all_colors_combinations[True-False-False-False-False-True]
writer = .w at 0x7fac07cbb370>, dynamic_format = True
colorize = False, colors = False, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cb9d80>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cbb370>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[True-False-False-False-False-False]

test_opt.py::test_all_colors_combinations[True-False-False-False-False-False]
writer = .w at 0x7fac07cbbf40>, dynamic_format = False
colorize = False, colors = False, raw = False, use_log = False, use_arg = True

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
>               logger_.info(message, arg)
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbbac0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = True
use_log    = False
writer     = .w at 0x7fac07cbbf40>

tests/test_opt.py:481: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-True-True-True]

test_opt.py::test_all_colors_combinations[False-True-True-True-True-True]
writer = .w at 0x7fac07cba0e0>, dynamic_format = True
colorize = True, colors = True, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb880>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07cba0e0>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-True-True-False]

test_opt.py::test_all_colors_combinations[False-True-True-True-True-False]
writer = .w at 0x7fac07c7ec20>, dynamic_format = False
colorize = True, colors = True, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7ed40>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7ec20>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-True-False-True]

test_opt.py::test_all_colors_combinations[False-True-True-True-False-True]
writer = .w at 0x7fac07c7c9d0>, dynamic_format = True
colorize = False, colors = True, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7e050>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7c9d0>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-True-False-False]

test_opt.py::test_all_colors_combinations[False-True-True-True-False-False]
writer = .w at 0x7fac07c7edd0>, dynamic_format = False
colorize = False, colors = True, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7f2e0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7edd0>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-False-True-True]

test_opt.py::test_all_colors_combinations[False-True-True-False-True-True]
writer = .w at 0x7fac07c7f130>, dynamic_format = True
colorize = True, colors = False, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7f760>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7f130>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-False-True-False]

test_opt.py::test_all_colors_combinations[False-True-True-False-True-False]
writer = .w at 0x7fac07c7ef80>, dynamic_format = False
colorize = True, colors = False, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7fbe0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7ef80>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-False-False-True]

test_opt.py::test_all_colors_combinations[False-True-True-False-False-True]
writer = .w at 0x7fac07c7f400>, dynamic_format = True
colorize = False, colors = False, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c8b0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7f400>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-True-False-False-False]

test_opt.py::test_all_colors_combinations[False-True-True-False-False-False]
writer = .w at 0x7fac07c7f910>, dynamic_format = False
colorize = False, colors = False, raw = True, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7e950>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7f910>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-True-True-True]

test_opt.py::test_all_colors_combinations[False-True-False-True-True-True]
writer = .w at 0x7fac07c7fd90>, dynamic_format = True
colorize = True, colors = True, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7e3b0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7fd90>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-True-True-False]

test_opt.py::test_all_colors_combinations[False-True-False-True-True-False]
writer = .w at 0x7fac07c7ff40>, dynamic_format = False
colorize = True, colors = True, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d990>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7ff40>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-True-False-True]

test_opt.py::test_all_colors_combinations[False-True-False-True-False-True]
writer = .w at 0x7fac07cb9240>, dynamic_format = True
colorize = False, colors = True, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cb8160>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07cb9240>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-True-False-False]

test_opt.py::test_all_colors_combinations[False-True-False-True-False-False]
writer = .w at 0x7fac07cbbf40>, dynamic_format = False
colorize = False, colors = True, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbba30>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07cbbf40>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-False-True-True]

test_opt.py::test_all_colors_combinations[False-True-False-False-True-True]
writer = .w at 0x7fac07c7de10>, dynamic_format = True
colorize = True, colors = False, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbb130>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7de10>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-False-True-False]

test_opt.py::test_all_colors_combinations[False-True-False-False-True-False]
writer = .w at 0x7fac07cbb370>, dynamic_format = False
colorize = True, colors = False, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbaa70>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07cbb370>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-False-False-True]

test_opt.py::test_all_colors_combinations[False-True-False-False-False-True]
writer = .w at 0x7fac07c7e9e0>, dynamic_format = True
colorize = False, colors = False, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d480>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7e9e0>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-True-False-False-False-False]

test_opt.py::test_all_colors_combinations[False-True-False-False-False-False]
writer = .w at 0x7fac07c7dfc0>, dynamic_format = False
colorize = False, colors = False, raw = False, use_log = True, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
>               logger_.log(20, message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'log'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7fe20>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = True
writer     = .w at 0x7fac07c7dfc0>

tests/test_opt.py:478: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-True-True-True]

test_opt.py::test_all_colors_combinations[False-False-True-True-True-True]
writer = .w at 0x7fac07c7d630>, dynamic_format = True
colorize = True, colors = True, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7ce50>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7d630>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-True-True-False]

test_opt.py::test_all_colors_combinations[False-False-True-True-True-False]
writer = .w at 0x7fac07c7d2d0>, dynamic_format = False
colorize = True, colors = True, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7fac0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7d2d0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-True-False-True]

test_opt.py::test_all_colors_combinations[False-False-True-True-False-True]
writer = .w at 0x7fac07c7e320>, dynamic_format = True
colorize = False, colors = True, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7f760>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7e320>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-True-False-False]

test_opt.py::test_all_colors_combinations[False-False-True-True-False-False]
writer = .w at 0x7fac07c7e3b0>, dynamic_format = False
colorize = False, colors = True, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7ec20>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7e3b0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-False-True-True]

test_opt.py::test_all_colors_combinations[False-False-True-False-True-True]
writer = .w at 0x7fac07c7f9a0>, dynamic_format = True
colorize = True, colors = False, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7d2d0>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7f9a0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-False-True-False]

test_opt.py::test_all_colors_combinations[False-False-True-False-True-False]
writer = .w at 0x7fac07c7f1c0>, dynamic_format = False
colorize = True, colors = False, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7f910>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7f1c0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-False-False-True]

test_opt.py::test_all_colors_combinations[False-False-True-False-False-True]
writer = .w at 0x7fac07b88280>, dynamic_format = True
colorize = False, colors = False, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07b88430>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07b88280>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-True-False-False-False]

test_opt.py::test_all_colors_combinations[False-False-True-False-False-False]
writer = .w at 0x7fac07cbaa70>, dynamic_format = False
colorize = False, colors = False, raw = True, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbbf40>
logger_    = None
message    = 'The {}'
raw        = True
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07cbaa70>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-True-True-True]

test_opt.py::test_all_colors_combinations[False-False-False-True-True-True]
writer = .w at 0x7fac07cbb370>, dynamic_format = True
colorize = True, colors = True, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cbbac0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07cbb370>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-True-True-False]

test_opt.py::test_all_colors_combinations[False-False-False-True-True-False]
writer = .w at 0x7fac07cbba30>, dynamic_format = False
colorize = True, colors = True, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07cba440>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07cbba30>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-True-False-True]

test_opt.py::test_all_colors_combinations[False-False-False-True-False-True]
writer = .w at 0x7fac07c7f9a0>, dynamic_format = True
colorize = False, colors = True, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c310>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7f9a0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-True-False-False]

test_opt.py::test_all_colors_combinations[False-False-False-True-False-False]
writer = .w at 0x7fac07c7e7a0>, dynamic_format = False
colorize = False, colors = True, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = True
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7e320>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7e7a0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-False-True-True]

test_opt.py::test_all_colors_combinations[False-False-False-False-True-True]
writer = .w at 0x7fac07c7ee60>, dynamic_format = True
colorize = True, colors = False, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7c8b0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7ee60>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-False-True-False]

test_opt.py::test_all_colors_combinations[False-False-False-False-True-False]
writer = .w at 0x7fac07c7d2d0>, dynamic_format = False
colorize = True, colors = False, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = True
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7db40>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7d2d0>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-False-False-True]

test_opt.py::test_all_colors_combinations[False-False-False-False-False-True]
writer = .w at 0x7fac07c7f640>, dynamic_format = True
colorize = False, colors = False, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = True
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7e170>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7f640>

tests/test_opt.py:483: AttributeError

test_opt.py::test_all_colors_combinations[False-False-False-False-False-False]

test_opt.py::test_all_colors_combinations[False-False-False-False-False-False]
writer = .w at 0x7fac07c7fd90>, dynamic_format = False
colorize = False, colors = False, raw = False, use_log = False, use_arg = False

    @pytest.mark.parametrize("dynamic_format", [True, False])
    @pytest.mark.parametrize("colorize", [True, False])
    @pytest.mark.parametrize("colors", [True, False])
    @pytest.mark.parametrize("raw", [True, False])
    @pytest.mark.parametrize("use_log", [True, False])
    @pytest.mark.parametrize("use_arg", [True, False])
    def test_all_colors_combinations(writer, dynamic_format, colorize, colors, raw, use_log, use_arg):
        format_ = "{level.no:03} {message}"
        message = "The {}"
        arg = "message"

        def formatter(_):
            return format_ + "\n"

        logger.add(writer, format=formatter if dynamic_format else format_, colorize=colorize)

        logger_ = logger.opt(colors=colors, raw=raw)

        if use_log:
            if use_arg:
                logger_.log(20, message, arg)
            else:
                logger_.log(20, message.format(arg))
        else:
            if use_arg:
                logger_.info(message, arg)
            else:
>               logger_.info(message.format(arg))
E               AttributeError: 'NoneType' object has no attribute 'info'

arg        = 'message'
colorize   = False
colors     = False
dynamic_format = False
format_    = '{level.no:03} {message}'
formatter  = .formatter at 0x7fac07c7dfc0>
logger_    = None
message    = 'The {}'
raw        = False
use_arg    = False
use_log    = False
writer     = .w at 0x7fac07c7fd90>

tests/test_opt.py:483: AttributeError

test_opt.py::test_raw_with_record

test_opt.py::test_raw_with_record
writer = .w at 0x7fac07b89120>

    def test_raw_with_record(writer):
        logger.add(writer, format="Nope\n")
>       logger.opt(raw=True, record=True).debug("Raw in '{record[function]}'\n")
E       AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07b89120>

tests/test_opt.py:525: AttributeError

test_opt.py::test_keep_extra

test_opt.py::test_keep_extra
writer = .w at 0x7fac07b884c0>

    def test_keep_extra(writer):
        logger.configure(extra=dict(test=123))
        logger.add(writer, format="{extra[test]}")
>       logger.opt().debug("")
E       AttributeError: 'NoneType' object has no attribute 'debug'

writer     = .w at 0x7fac07b884c0>

tests/test_opt.py:532: AttributeError

test_opt.py::test_before_bind

test_opt.py::test_before_bind
writer = .w at 0x7fac07b88160>

    def test_before_bind(writer):
        logger.add(writer, format="{message}")
>       logger.opt(record=True).bind(key="value").info("{record[level]}")
E       AttributeError: 'NoneType' object has no attribute 'bind'

writer     = .w at 0x7fac07b88160>

tests/test_opt.py:540: AttributeError

test_opt.py::test_deprecated_ansi_argument

test_opt.py::test_deprecated_ansi_argument
writer = .w at 0x7fac07b88790>

    def test_deprecated_ansi_argument(writer):
        logger.add(writer, format="{message}", colorize=True)
        with pytest.warns(DeprecationWarning):
>           logger.opt(ansi=True).info("Foo bar baz")
E           AttributeError: 'NoneType' object has no attribute 'info'

writer     = .w at 0x7fac07b88790>

tests/test_opt.py:547: AttributeError

During handling of the above exception, another exception occurred:

writer = .w at 0x7fac07b88790>

    def test_deprecated_ansi_argument(writer):
        logger.add(writer, format="{message}", colorize=True)
>       with pytest.warns(DeprecationWarning):
E       Failed: DID NOT WARN. No warnings of type (,) were emitted.
E        Emitted warnings: [].

writer     = .w at 0x7fac07b88790>

tests/test_opt.py:546: Failed

test_opt.py::test_message_update_not_overridden_by_patch[True]

test_opt.py::test_message_update_not_overridden_by_patch[True]
writer = .w at 0x7fac07b88700>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_patch(writer, colors):
        def patcher(record):
            record["message"] += " [Patched]"

        logger.add(writer, format="{level} {message}", colorize=True)
>       logger.patch(patcher).opt(colors=colors).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colors     = True
patcher    = .patcher at 0x7fac07b88dc0>
writer     = .w at 0x7fac07b88700>

tests/test_opt.py:557: AttributeError

test_opt.py::test_message_update_not_overridden_by_patch[False]

test_opt.py::test_message_update_not_overridden_by_patch[False]
writer = .w at 0x7fac07cba440>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_patch(writer, colors):
        def patcher(record):
            record["message"] += " [Patched]"

        logger.add(writer, format="{level} {message}", colorize=True)
>       logger.patch(patcher).opt(colors=colors).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colors     = False
patcher    = .patcher at 0x7fac07cbbf40>
writer     = .w at 0x7fac07cba440>

tests/test_opt.py:557: AttributeError

test_opt.py::test_message_update_not_overridden_by_format[True]

test_opt.py::test_message_update_not_overridden_by_format[True]
writer = .w at 0x7fac07c7db40>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_format(writer, colors):
        def formatter(record):
            record["message"] += " [Formatted]"
            return "{level} {message}\n"

        logger.add(writer, format=formatter, colorize=True)
>       logger.opt(colors=colors).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'info'

colors     = True
formatter  = .formatter at 0x7fac07cbaa70>
writer     = .w at 0x7fac07c7db40>

tests/test_opt.py:569: AttributeError

test_opt.py::test_message_update_not_overridden_by_format[False]

test_opt.py::test_message_update_not_overridden_by_format[False]
writer = .w at 0x7fac07c7d990>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_format(writer, colors):
        def formatter(record):
            record["message"] += " [Formatted]"
            return "{level} {message}\n"

        logger.add(writer, format=formatter, colorize=True)
>       logger.opt(colors=colors).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'info'

colors     = False
formatter  = .formatter at 0x7fac07c7e290>
writer     = .w at 0x7fac07c7d990>

tests/test_opt.py:569: AttributeError

test_opt.py::test_message_update_not_overridden_by_filter[True]

test_opt.py::test_message_update_not_overridden_by_filter[True]
writer = .w at 0x7fac07c7e170>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_filter(writer, colors):
        def filter(record):
            record["message"] += " [Filtered]"
            return True

        logger.add(writer, format="{level} {message}", filter=filter, colorize=True)
>       logger.opt(colors=colors).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'info'

colors     = True
filter     = .filter at 0x7fac07c7d480>
writer     = .w at 0x7fac07c7e170>

tests/test_opt.py:581: AttributeError

test_opt.py::test_message_update_not_overridden_by_filter[False]

test_opt.py::test_message_update_not_overridden_by_filter[False]
writer = .w at 0x7fac07c7d2d0>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_filter(writer, colors):
        def filter(record):
            record["message"] += " [Filtered]"
            return True

        logger.add(writer, format="{level} {message}", filter=filter, colorize=True)
>       logger.opt(colors=colors).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'info'

colors     = False
filter     = .filter at 0x7fac07c7e3b0>
writer     = .w at 0x7fac07c7d2d0>

tests/test_opt.py:581: AttributeError

test_opt.py::test_message_update_not_overridden_by_raw[True]

test_opt.py::test_message_update_not_overridden_by_raw[True]
writer = .w at 0x7fac07c7dd80>, colors = True

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_raw(writer, colors):
        logger.add(writer, colorize=True)
>       logger.patch(lambda r: r.update(message="Updated!")).opt(raw=True, colors=colors).info("Raw!")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colors     = True
writer     = .w at 0x7fac07c7dd80>

tests/test_opt.py:589: AttributeError

test_opt.py::test_message_update_not_overridden_by_raw[False]

test_opt.py::test_message_update_not_overridden_by_raw[False]
writer = .w at 0x7fac07c7fbe0>, colors = False

    @pytest.mark.parametrize("colors", [True, False])
    def test_message_update_not_overridden_by_raw(writer, colors):
        logger.add(writer, colorize=True)
>       logger.patch(lambda r: r.update(message="Updated!")).opt(raw=True, colors=colors).info("Raw!")
E       AttributeError: 'NoneType' object has no attribute 'opt'

colors     = False
writer     = .w at 0x7fac07c7fbe0>

tests/test_opt.py:589: AttributeError

test_opt.py::test_overridden_message_ignore_colors

test_opt.py::test_overridden_message_ignore_colors
writer = .w at 0x7fac07c7e320>

    def test_overridden_message_ignore_colors(writer):
        def formatter(record):
            record["message"] += " [Ignored] "
            return "{message}\n"

        logger.add(writer, format=formatter, colorize=True)
>       logger.opt(colors=True).info("Message")
E       AttributeError: 'NoneType' object has no attribute 'info'

formatter  = .formatter at 0x7fac07c7f910>
writer     = .w at 0x7fac07c7e320>

tests/test_opt.py:599: AttributeError

test_parse.py::test_parse_file

test_parse.py::test_parse_file
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_file0')

    def test_parse_file(tmp_path):
        file = tmp_path / "test.log"
        file.write_text(TEXT)
>       result, *_ = list(logger.parse(file, r"(?P\d+)"))
E       TypeError: 'NoneType' object is not iterable

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_file0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_file0')

tests/test_parse.py:22: TypeError

test_parse.py::test_parse_fileobj

test_parse.py::test_parse_fileobj
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_fileobj0')

    def test_parse_fileobj(tmp_path):
        file = tmp_path / "test.log"
        file.write_text(TEXT)
>       result, *_ = list(logger.parse(open(str(file)), r"^(?P\w+)"))
E       TypeError: 'NoneType' object is not iterable

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_fileobj0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_fileobj0')

tests/test_parse.py:29: TypeError

test_parse.py::test_parse_pathlib

test_parse.py::test_parse_pathlib
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_pathlib0')

    def test_parse_pathlib(tmp_path):
        file = tmp_path / "test.log"
        file.write_text(TEXT)
>       result, *_ = list(logger.parse(pathlib.Path(str(file)), r"(?PRandom)"))
E       TypeError: 'NoneType' object is not iterable

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_pathlib0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_parse_pathlib0')

tests/test_parse.py:36: TypeError

test_parse.py::test_parse_string_pattern

test_parse.py::test_parse_string_pattern
fileobj = <_io.StringIO object at 0x7fac07b889d0>

    def test_parse_string_pattern(fileobj):
>       result, *_ = list(logger.parse(fileobj, r"(?P\d+)"))
E       TypeError: 'NoneType' object is not iterable

fileobj    = <_io.StringIO object at 0x7fac07b889d0>

tests/test_parse.py:41: TypeError

test_parse.py::test_parse_regex_pattern

test_parse.py::test_parse_regex_pattern
fileobj = <_io.StringIO object at 0x7fac07b89e10>

    def test_parse_regex_pattern(fileobj):
        regex = re.compile(r"(?P[a-z]*![a-z]*)", flags=re.I)
>       result, *_ = list(logger.parse(fileobj, regex))
E       TypeError: 'NoneType' object is not iterable

fileobj    = <_io.StringIO object at 0x7fac07b89e10>
regex      = re.compile('(?P[a-z]*![a-z]*)', re.IGNORECASE)

tests/test_parse.py:47: TypeError

test_parse.py::test_parse_multiline_pattern

test_parse.py::test_parse_multiline_pattern
fileobj = <_io.StringIO object at 0x7fac07b892d0>

    def test_parse_multiline_pattern(fileobj):
>       result, *_ = list(logger.parse(fileobj, r"(?PThis[\s\S]*Text\n)"))
E       TypeError: 'NoneType' object is not iterable

fileobj    = <_io.StringIO object at 0x7fac07b892d0>

tests/test_parse.py:52: TypeError

test_parse.py::test_parse_without_group

test_parse.py::test_parse_without_group
fileobj = <_io.StringIO object at 0x7fac07b89240>

    def test_parse_without_group(fileobj):
>       result, *_ = list(logger.parse(fileobj, r"\d+"))
E       TypeError: 'NoneType' object is not iterable

fileobj    = <_io.StringIO object at 0x7fac07b89240>

tests/test_parse.py:57: TypeError

test_parse.py::test_parse_bytes

test_parse.py::test_parse_bytes
def test_parse_bytes():
        with io.BytesIO(b"Testing bytes!") as fileobj:
>           result, *_ = list(logger.parse(fileobj, rb"(?P[?!:])"))
E           TypeError: 'NoneType' object is not iterable

fileobj    = <_io.BytesIO object at 0x7fac07b958a0>

tests/test_parse.py:63: TypeError

test_parse.py::test_chunk[-1]

test_parse.py::test_chunk[-1]
fileobj = <_io.StringIO object at 0x7fac07b89750>, chunk = -1

    @pytest.mark.parametrize("chunk", [-1, 1, 2**16])
    def test_chunk(fileobj, chunk):
>       result, *_ = list(logger.parse(fileobj, r"(?P[ABC]+)", chunk=chunk))
E       TypeError: 'NoneType' object is not iterable

chunk      = -1
fileobj    = <_io.StringIO object at 0x7fac07b89750>

tests/test_parse.py:69: TypeError

test_parse.py::test_chunk[1]

test_parse.py::test_chunk[1]
fileobj = <_io.StringIO object at 0x7fac07b89990>, chunk = 1

    @pytest.mark.parametrize("chunk", [-1, 1, 2**16])
    def test_chunk(fileobj, chunk):
>       result, *_ = list(logger.parse(fileobj, r"(?P[ABC]+)", chunk=chunk))
E       TypeError: 'NoneType' object is not iterable

chunk      = 1
fileobj    = <_io.StringIO object at 0x7fac07b89990>

tests/test_parse.py:69: TypeError

test_parse.py::test_chunk[65536]

test_parse.py::test_chunk[65536]
fileobj = <_io.StringIO object at 0x7fac07b89510>, chunk = 65536

    @pytest.mark.parametrize("chunk", [-1, 1, 2**16])
    def test_chunk(fileobj, chunk):
>       result, *_ = list(logger.parse(fileobj, r"(?P[ABC]+)", chunk=chunk))
E       TypeError: 'NoneType' object is not iterable

chunk      = 65536
fileobj    = <_io.StringIO object at 0x7fac07b89510>

tests/test_parse.py:69: TypeError

test_parse.py::test_positive_lookbehind_pattern

test_parse.py::test_positive_lookbehind_pattern
def test_positive_lookbehind_pattern():
        text = "ab" * 100
        pattern = r"(?<=a)(?Pb)"
        with io.StringIO(text) as file:
>           result = list(logger.parse(file, pattern, chunk=9))
E           TypeError: 'NoneType' object is not iterable

file       = <_io.StringIO object at 0x7fac07b89c60>
pattern    = '(?<=a)(?Pb)'
text       = 'abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab'

tests/test_parse.py:77: TypeError

test_parse.py::test_greedy_pattern

test_parse.py::test_greedy_pattern
def test_greedy_pattern():
        text = ("\n" + "a" * 100) * 1000
        pattern = r"\n(?Pa+)"
        with io.StringIO(text) as file:
>           result = list(logger.parse(file, pattern, chunk=30))
E           TypeError: 'NoneType' object is not iterable

file       = <_io.StringIO object at 0x7fac07b89240>
pattern    = '\\n(?Pa+)'
text       = '\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaa...aaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

tests/test_parse.py:85: TypeError

test_parse.py::test_cast_dict

test_parse.py::test_cast_dict
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_dict0')

    def test_cast_dict(tmp_path):
        file = tmp_path / "test.log"
        file.write_text("[123] [1.1] [2017-03-29 11:11:11]\n")
        regex = r"\[(?P.*)\] \[(?P.*)\] \[(?P.*)\]"
        caster = dict(num=int, val=float, date=lambda d: datetime.strptime(d, "%Y-%m-%d %H:%M:%S"))
>       result = next(logger.parse(file, regex, cast=caster))
E       TypeError: 'NoneType' object is not an iterator

caster     = {'date': . at 0x7fac07b892d0>, 'num': , 'val': }
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_dict0/test.log')
regex      = '\\[(?P.*)\\] \\[(?P.*)\\] \\[(?P.*)\\]'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_dict0')

tests/test_parse.py:94: TypeError

test_parse.py::test_cast_function

test_parse.py::test_cast_function
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_function0')

    def test_cast_function(tmp_path):
        file = tmp_path / "test.log"
        file.write_text("[123] [1.1] [2017-03-29 11:11:11]\n")
        regex = r"\[(?P.*)\] \[(?P.*)\] \[(?P.*)\]"

        def caster(groups):
            groups["num"] = int(groups["num"])
            groups["val"] = float(groups["val"])
            groups["date"] = datetime.strptime(groups["date"], "%Y-%m-%d %H:%M:%S")

>       result = next(logger.parse(file, regex, cast=caster))
E       TypeError: 'NoneType' object is not an iterator

caster     = .caster at 0x7fac07c7db40>
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_function0/test.log')
regex      = '\\[(?P.*)\\] \\[(?P.*)\\] \\[(?P.*)\\]'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_function0')

tests/test_parse.py:108: TypeError

test_parse.py::test_cast_with_irrelevant_arg

test_parse.py::test_cast_with_irrelevant_arg
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_with_irrelevant_arg0')

    def test_cast_with_irrelevant_arg(tmp_path):
        file = tmp_path / "test.log"
        file.write_text("[123] Blabla")
        regex = r"\[(?P\d+)\] .*"
        caster = dict(a=int, b=float)
>       result = next(logger.parse(file, regex, cast=caster))
E       TypeError: 'NoneType' object is not an iterator

caster     = {'a': , 'b': }
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_with_irrelevant_arg0/test.log')
regex      = '\\[(?P\\d+)\\] .*'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_with_irrelevant_arg0')

tests/test_parse.py:117: TypeError

test_parse.py::test_cast_with_irrelevant_value

test_parse.py::test_cast_with_irrelevant_value
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_with_irrelevant_valu0')

    def test_cast_with_irrelevant_value(tmp_path):
        file = tmp_path / "test.log"
        file.write_text("[123] Blabla")
        regex = r"\[(?P\d+)\] (?P.*)"
        caster = dict(a=int)
>       result = next(logger.parse(file, regex, cast=caster))
E       TypeError: 'NoneType' object is not an iterator

caster     = {'a': }
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_with_irrelevant_valu0/test.log')
regex      = '\\[(?P\\d+)\\] (?P.*)'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_cast_with_irrelevant_valu0')

tests/test_parse.py:126: TypeError

test_patch.py::test_patch_after_add

test_patch.py::test_patch_after_add
writer = .w at 0x7fac07b89bd0>

    def test_patch_after_add(writer):
        logger.add(writer, format="{extra[a]} {message}")
        logger_patched = logger.patch(lambda r: r["extra"].update(a=0))
>       logger_patched.debug("A")
E       AttributeError: 'NoneType' object has no attribute 'debug'

logger_patched = None
writer     = .w at 0x7fac07b89bd0>

tests/test_patch.py:7: AttributeError

test_patch.py::test_patch_before_add

test_patch.py::test_patch_before_add
writer = .w at 0x7fac07b897e0>

    def test_patch_before_add(writer):
        logger_patched = logger.patch(lambda r: r["extra"].update(a=0))
        logger.add(writer, format="{extra[a]} {message}")
>       logger_patched.debug("A")
E       AttributeError: 'NoneType' object has no attribute 'debug'

logger_patched = None
writer     = .w at 0x7fac07b897e0>

tests/test_patch.py:15: AttributeError

test_patch.py::test_add_using_patched

test_patch.py::test_add_using_patched
writer = .w at 0x7fac07b89360>

    def test_add_using_patched(writer):
        logger.configure(patcher=lambda r: r["extra"].update(a=-1))
        logger_patched = logger.patch(lambda r: r["extra"].update(a=0))
>       logger_patched.add(writer, format="{extra[a]} {message}")
E       AttributeError: 'NoneType' object has no attribute 'add'

logger_patched = None
writer     = .w at 0x7fac07b89360>

tests/test_patch.py:23: AttributeError

test_patch.py::test_not_override_parent_logger

test_patch.py::test_not_override_parent_logger
writer = .w at 0x7fac07b89cf0>

    def test_not_override_parent_logger(writer):
        logger_1 = logger.patch(lambda r: r["extra"].update(a="a"))
>       logger_2 = logger_1.patch(lambda r: r["extra"].update(a="A"))
E       AttributeError: 'NoneType' object has no attribute 'patch'

logger_1   = None
writer     = .w at 0x7fac07b89cf0>

tests/test_patch.py:32: AttributeError

test_patch.py::test_override_previous_patched

test_patch.py::test_override_previous_patched
writer = .w at 0x7fac07b8a0e0>

    def test_override_previous_patched(writer):
        logger.add(writer, format="{extra[x]} {message}")
        logger2 = logger.patch(lambda r: r["extra"].update(x=3))
>       logger2.patch(lambda r: r["extra"].update(x=2)).debug("4")
E       AttributeError: 'NoneType' object has no attribute 'patch'

logger2    = None
writer     = .w at 0x7fac07b8a0e0>

tests/test_patch.py:44: AttributeError

test_patch.py::test_no_conflict

test_patch.py::test_no_conflict
writer = .w at 0x7fac07b8a320>

    def test_no_conflict(writer):
        logger_ = logger.patch(lambda r: None)
>       logger_2 = logger_.patch(lambda r: r["extra"].update(a=2))
E       AttributeError: 'NoneType' object has no attribute 'patch'

logger_    = None
writer     = .w at 0x7fac07b8a320>

tests/test_patch.py:50: AttributeError

test_patch.py::test_override_configured

test_patch.py::test_override_configured
writer = .w at 0x7fac07b88d30>

    def test_override_configured(writer):
        logger.configure(patcher=lambda r: r["extra"].update(a=123, b=678))
        logger2 = logger.patch(lambda r: r["extra"].update(a=456))

>       logger2.add(writer, format="{extra[a]} {extra[b]} {message}")
E       AttributeError: 'NoneType' object has no attribute 'add'

logger2    = None
writer     = .w at 0x7fac07b88d30>

tests/test_patch.py:65: AttributeError

test_patch.py::test_multiple_patches

test_patch.py::test_multiple_patches
writer = .w at 0x7fac07b89cf0>

    def test_multiple_patches(writer):
        def patch_1(record):
            record["extra"]["a"] = 5

        def patch_2(record):
            record["extra"]["a"] += 1

        def patch_3(record):
            record["extra"]["a"] *= 2

        logger.add(writer, format="{extra[a]} {message}")
>       logger.patch(patch_1).patch(patch_2).patch(patch_3).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'patch'

patch_1    = .patch_1 at 0x7fac07b8a290>
patch_2    = .patch_2 at 0x7fac07b8a050>
patch_3    = .patch_3 at 0x7fac07b89f30>
writer     = .w at 0x7fac07b89cf0>

tests/test_patch.py:83: AttributeError

test_pickling.py::test_pickling_function_handler

test_pickling.py::test_pickling_function_handler
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08176e00>

    def test_pickling_function_handler(capsys):
        logger.add(print_, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpikcled = pickle.loads(pickled)
        unpikcled.debug("A message")
        out, err = capsys.readouterr()
>       assert out == "DEBUG - test_pickling_function_handler - A message\n"
E       AssertionError: assert '' == 'DEBUG - test...- A message\n'
E         
E         - DEBUG - test_pickling_function_handler - A message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08176e00>
err        = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpikcled  = 

tests/test_pickling.py:88: AssertionError

test_pickling.py::test_pickling_coroutine_function_handler

test_pickling.py::test_pickling_coroutine_function_handler
capsys = <_pytest.capture.CaptureFixture object at 0x7fac081deb00>

    def test_pickling_coroutine_function_handler(capsys):
        logger.add(async_print, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpikcled = pickle.loads(pickled)

        async def async_debug():
            unpikcled.debug("A message")
            await unpikcled.complete()

>       asyncio.run(async_debug())

async_debug = .async_debug at 0x7fac07b88310>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac081deb00>
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpikcled  = 

tests/test_pickling.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/asyncio/runners.py:44: in run
    return loop.run_until_complete(main)
        debug      = None
        loop       = <_UnixSelectorEventLoop running=False closed=True debug=False>
        main       = .async_debug at 0x7fac077289e0>
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
    return future.result()
        future     = .async_debug() done, defined at /testbed/tests/test_pickling.py:97> exception=TypeError("object NoneType can't be used in 'await' expression")>
        new_task   = True
        self       = <_UnixSelectorEventLoop running=False closed=True debug=False>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    async def async_debug():
        unpikcled.debug("A message")
>       await unpikcled.complete()
E       TypeError: object NoneType can't be used in 'await' expression

unpikcled  = 

tests/test_pickling.py:99: TypeError

test_pickling.py::test_pickling_stream_handler[True-True]

test_pickling.py::test_pickling_stream_handler[True-True]
flushable = True, stoppable = True

    @pytest.mark.parametrize("flushable", [True, False])
    @pytest.mark.parametrize("stoppable", [True, False])
    def test_pickling_stream_handler(flushable, stoppable):
        stream = StreamHandler(flushable, stoppable)
        i = logger.add(stream, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       stream = next(iter(unpickled._core.handlers.values()))._sink._stream
E       StopIteration

flushable  = True
i          = None
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
stoppable  = True
stream     = 
unpickled  = 

tests/test_pickling.py:116: StopIteration

The above exception was the direct cause of the following exception:

cls = 
func = . at 0x7fac07cbaa70>
when = 'call'
reraise = (, )

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: TResult | None = func()

cls        = 
duration   = 0.00027429400000045234
excinfo    = 
func       = . at 0x7fac07cbaa70>
precise_start = 46.496134872
precise_stop = 46.496409166
reraise    = (, )
result     = None
start      = 1732854845.8621302
stop       = 1732854845.862405
when       = 'call'

.venv/lib/python3.10/site-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.10/site-packages/_pytest/runner.py:242: in 
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
        item       = 
        kwds       = {}
        runtest_hook = 
.venv/lib/python3.10/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
        firstresult = False
        kwargs     = {'item': }
        self       = 
.venv/lib/python3.10/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': }
        methods    = [>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x7fac0d1fcd00>
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
    yield
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x7fac0bbadf60>
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
    yield
        cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fac0bbae1d0>
.venv/lib/python3.10/site-packages/_pytest/logging.py:846: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
        item       = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
.venv/lib/python3.10/site-packages/_pytest/logging.py:829: in _runtest_for
    yield
        caplog_handler = 
        item       = 
        log        = ''
        report_handler = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
        when       = 'call'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = > _state='suspended' _in_suspended=False> _capture_fixture=None>
item = 

    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: Item) -> Generator[None]:
        with self.item_capture("call", item):
>           return (yield)
E           RuntimeError: generator raised StopIteration

item       = 
self       = > _state='suspended' _in_suspended=False> _capture_fixture=None>

.venv/lib/python3.10/site-packages/_pytest/capture.py:880: RuntimeError

test_pickling.py::test_pickling_stream_handler[True-False]

test_pickling.py::test_pickling_stream_handler[True-False]
flushable = False, stoppable = True

    @pytest.mark.parametrize("flushable", [True, False])
    @pytest.mark.parametrize("stoppable", [True, False])
    def test_pickling_stream_handler(flushable, stoppable):
        stream = StreamHandler(flushable, stoppable)
        i = logger.add(stream, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       stream = next(iter(unpickled._core.handlers.values()))._sink._stream
E       StopIteration

flushable  = False
i          = None
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
stoppable  = True
stream     = 
unpickled  = 

tests/test_pickling.py:116: StopIteration

The above exception was the direct cause of the following exception:

cls = 
func = . at 0x7fac0759b370>
when = 'call'
reraise = (, )

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: TResult | None = func()

cls        = 
duration   = 0.00025117199999868944
excinfo    = 
func       = . at 0x7fac0759b370>
precise_start = 46.548445134
precise_stop = 46.548696306
reraise    = (, )
result     = None
start      = 1732854845.9144404
stop       = 1732854845.9146922
when       = 'call'

.venv/lib/python3.10/site-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.10/site-packages/_pytest/runner.py:242: in 
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
        item       = 
        kwds       = {}
        runtest_hook = 
.venv/lib/python3.10/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
        firstresult = False
        kwargs     = {'item': }
        self       = 
.venv/lib/python3.10/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': }
        methods    = [>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x7fac0d1fcd00>
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
    yield
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x7fac0751fb20>
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
    yield
        cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fac0751fc10>
.venv/lib/python3.10/site-packages/_pytest/logging.py:846: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
        item       = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
.venv/lib/python3.10/site-packages/_pytest/logging.py:829: in _runtest_for
    yield
        caplog_handler = 
        item       = 
        log        = ''
        report_handler = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
        when       = 'call'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = > _state='suspended' _in_suspended=False> _capture_fixture=None>
item = 

    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: Item) -> Generator[None]:
        with self.item_capture("call", item):
>           return (yield)
E           RuntimeError: generator raised StopIteration

item       = 
self       = > _state='suspended' _in_suspended=False> _capture_fixture=None>

.venv/lib/python3.10/site-packages/_pytest/capture.py:880: RuntimeError

test_pickling.py::test_pickling_stream_handler[False-True]

test_pickling.py::test_pickling_stream_handler[False-True]
flushable = True, stoppable = False

    @pytest.mark.parametrize("flushable", [True, False])
    @pytest.mark.parametrize("stoppable", [True, False])
    def test_pickling_stream_handler(flushable, stoppable):
        stream = StreamHandler(flushable, stoppable)
        i = logger.add(stream, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       stream = next(iter(unpickled._core.handlers.values()))._sink._stream
E       StopIteration

flushable  = True
i          = None
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
stoppable  = False
stream     = 
unpickled  = 

tests/test_pickling.py:116: StopIteration

The above exception was the direct cause of the following exception:

cls = 
func = . at 0x7fac07b8af80>
when = 'call'
reraise = (, )

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: TResult | None = func()

cls        = 
duration   = 0.0002406549999989238
excinfo    = 
func       = . at 0x7fac07b8af80>
precise_start = 46.59530823
precise_stop = 46.595548885
reraise    = (, )
result     = None
start      = 1732854845.9613035
stop       = 1732854845.9615448
when       = 'call'

.venv/lib/python3.10/site-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.10/site-packages/_pytest/runner.py:242: in 
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
        item       = 
        kwds       = {}
        runtest_hook = 
.venv/lib/python3.10/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
        firstresult = False
        kwargs     = {'item': }
        self       = 
.venv/lib/python3.10/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': }
        methods    = [>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x7fac0d1fcd00>
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
    yield
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x7fac08715d50>
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
    yield
        cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fac08716b00>
.venv/lib/python3.10/site-packages/_pytest/logging.py:846: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
        item       = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
.venv/lib/python3.10/site-packages/_pytest/logging.py:829: in _runtest_for
    yield
        caplog_handler = 
        item       = 
        log        = ''
        report_handler = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
        when       = 'call'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = > _state='suspended' _in_suspended=False> _capture_fixture=None>
item = 

    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: Item) -> Generator[None]:
        with self.item_capture("call", item):
>           return (yield)
E           RuntimeError: generator raised StopIteration

item       = 
self       = > _state='suspended' _in_suspended=False> _capture_fixture=None>

.venv/lib/python3.10/site-packages/_pytest/capture.py:880: RuntimeError

test_pickling.py::test_pickling_stream_handler[False-False]

test_pickling.py::test_pickling_stream_handler[False-False]
flushable = False, stoppable = False

    @pytest.mark.parametrize("flushable", [True, False])
    @pytest.mark.parametrize("stoppable", [True, False])
    def test_pickling_stream_handler(flushable, stoppable):
        stream = StreamHandler(flushable, stoppable)
        i = logger.add(stream, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       stream = next(iter(unpickled._core.handlers.values()))._sink._stream
E       StopIteration

flushable  = False
i          = None
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
stoppable  = False
stream     = 
unpickled  = 

tests/test_pickling.py:116: StopIteration

The above exception was the direct cause of the following exception:

cls = 
func = . at 0x7fac07c7e7a0>
when = 'call'
reraise = (, )

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: TResult | None = func()

cls        = 
duration   = 0.00027053899999884834
excinfo    = 
func       = . at 0x7fac07c7e7a0>
precise_start = 46.677860004
precise_stop = 46.678130543
reraise    = (, )
result     = None
start      = 1732854846.0438552
stop       = 1732854846.0441265
when       = 'call'

.venv/lib/python3.10/site-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.10/site-packages/_pytest/runner.py:242: in 
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
        item       = 
        kwds       = {}
        runtest_hook = 
.venv/lib/python3.10/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
        firstresult = False
        kwargs     = {'item': }
        self       = 
.venv/lib/python3.10/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': }
        methods    = [>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x7fac0d1fcd00>
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
    yield
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x7fac077bcf10>
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
    yield
        cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fac077bc9a0>
.venv/lib/python3.10/site-packages/_pytest/logging.py:846: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
        item       = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
.venv/lib/python3.10/site-packages/_pytest/logging.py:829: in _runtest_for
    yield
        caplog_handler = 
        item       = 
        log        = ''
        report_handler = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
        when       = 'call'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = > _state='suspended' _in_suspended=False> _capture_fixture=None>
item = 

    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: Item) -> Generator[None]:
        with self.item_capture("call", item):
>           return (yield)
E           RuntimeError: generator raised StopIteration

item       = 
self       = > _state='suspended' _in_suspended=False> _capture_fixture=None>

.venv/lib/python3.10/site-packages/_pytest/capture.py:880: RuntimeError

test_pickling.py::test_pickling_standard_handler

test_pickling.py::test_pickling_standard_handler
def test_pickling_standard_handler():
        handler = StandardHandler(logging.NOTSET)
        logger.add(handler, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       handler = next(iter(unpickled._core.handlers.values()))._sink._handler
E       StopIteration

handler    = 
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:129: StopIteration

The above exception was the direct cause of the following exception:

cls = 
func = . at 0x7fac07b89ea0>
when = 'call'
reraise = (, )

    @classmethod
    def from_call(
        cls,
        func: Callable[[], TResult],
        when: Literal["collect", "setup", "call", "teardown"],
        reraise: type[BaseException] | tuple[type[BaseException], ...] | None = None,
    ) -> CallInfo[TResult]:
        """Call func, wrapping the result in a CallInfo.

        :param func:
            The function to call. Called without arguments.
        :type func: Callable[[], _pytest.runner.TResult]
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: TResult | None = func()

cls        = 
duration   = 0.00025703200000037896
excinfo    = 
func       = . at 0x7fac07b89ea0>
precise_start = 46.724548252
precise_stop = 46.724805284
reraise    = (, )
result     = None
start      = 1732854846.0905433
stop       = 1732854846.0908012
when       = 'call'

.venv/lib/python3.10/site-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.venv/lib/python3.10/site-packages/_pytest/runner.py:242: in 
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
        item       = 
        kwds       = {}
        runtest_hook = 
.venv/lib/python3.10/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
        firstresult = False
        kwargs     = {'item': }
        self       = 
.venv/lib/python3.10/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
        firstresult = False
        hook_name  = 'pytest_runtest_call'
        kwargs     = {'item': }
        methods    = [>, ...]
        self       = <_pytest.config.PytestPluginManager object at 0x7fac0d1fcd00>
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
    yield
        cm         = <_pytest.threadexception.catch_threading_exception object at 0x7fac083c44f0>
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
.venv/lib/python3.10/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
    yield
        cm         = <_pytest.unraisableexception.catch_unraisable_exception object at 0x7fac083c7760>
.venv/lib/python3.10/site-packages/_pytest/logging.py:846: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
        item       = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
.venv/lib/python3.10/site-packages/_pytest/logging.py:829: in _runtest_for
    yield
        caplog_handler = 
        item       = 
        log        = ''
        report_handler = 
        self       = <_pytest.logging.LoggingPlugin object at 0x7fac0cf0a710>
        when       = 'call'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = > _state='suspended' _in_suspended=False> _capture_fixture=None>
item = 

    @hookimpl(wrapper=True)
    def pytest_runtest_call(self, item: Item) -> Generator[None]:
        with self.item_capture("call", item):
>           return (yield)
E           RuntimeError: generator raised StopIteration

item       = 
self       = > _state='suspended' _in_suspended=False> _capture_fixture=None>

.venv/lib/python3.10/site-packages/_pytest/capture.py:880: RuntimeError

test_pickling.py::test_pickling_standard_handler_root_logger_not_picklable

test_pickling.py::test_pickling_standard_handler_root_logger_not_picklable
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac082fc1c0>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac082fdfc0>

    def test_pickling_standard_handler_root_logger_not_picklable(monkeypatch, capsys):
        def reduce_protocol():
            raise TypeError("Not picklable")

        monkeypatch.setattr(logging.getLogger(), "__reduce__", reduce_protocol, raising=False)

        handler = StandardHandler(logging.NOTSET)
        logger.add(handler, format="=> {message}", catch=False)

        pickled = pickle.dumps(logger)
        pickle.loads(pickled)

        logger.info("Ok")
        out, err = capsys.readouterr()
        assert out == ""
        assert err == ""
>       assert handler.written == "=> Ok"
E       AssertionError: assert '' == '=> Ok'
E         
E         - => Ok

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac082fdfc0>
err        = ''
handler    = 
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac082fc1c0>
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
reduce_protocol = .reduce_protocol at 0x7fac07b881f0>

tests/test_pickling.py:149: AssertionError

test_pickling.py::test_pickling_file_handler

test_pickling.py::test_pickling_file_handler
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0')

    def test_pickling_file_handler(tmp_path):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0')
unpickled  = 

tests/test_pickling.py:158: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[1000]

test_pickling.py::test_pickling_file_handler_rotation[1000]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0')
rotation = 1000

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = 1000
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[daily]

test_pickling.py::test_pickling_file_handler_rotation[daily]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1')
rotation = 'daily'

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = 'daily'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot1/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[rotation2]

test_pickling.py::test_pickling_file_handler_rotation[rotation2]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2')
rotation = datetime.timedelta(seconds=3600)

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = datetime.timedelta(seconds=3600)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot2/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[rotation3]

test_pickling.py::test_pickling_file_handler_rotation[rotation3]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3')
rotation = datetime.time(12, 0)

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = datetime.time(12, 0)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot3/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[200 MB]

test_pickling.py::test_pickling_file_handler_rotation[200 MB]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4')
rotation = '200 MB'

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = '200 MB'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot4/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[10:00]

test_pickling.py::test_pickling_file_handler_rotation[10:00]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5')
rotation = '10:00'

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = '10:00'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot5/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[5 hours]

test_pickling.py::test_pickling_file_handler_rotation[5 hours]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6')
rotation = '5 hours'

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = '5 hours'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot6/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_rotation[rotation_function]

test_pickling.py::test_pickling_file_handler_rotation[rotation_function]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7')
rotation = 

    @pytest.mark.parametrize(
        "rotation",
        [
            1000,
            "daily",
            datetime.timedelta(minutes=60),
            datetime.time(hour=12, minute=00, second=00),
            "200 MB",
            "10:00",
            "5 hours",
            rotation_function,
        ],
    )
    def test_pickling_file_handler_rotation(tmp_path, rotation):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, rotation=rotation)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_rotation - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
rotation   = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7')
unpickled  = 

tests/test_pickling.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_rot7/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_retention[1000]

test_pickling.py::test_pickling_file_handler_retention[1000]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0')
retention = 1000

    @pytest.mark.parametrize(
        "retention", [1000, datetime.timedelta(hours=13), "10 days", retention_function]
    )
    def test_pickling_file_handler_retention(tmp_path, retention):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, retention=retention)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_retention - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
retention  = 1000
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0')
unpickled  = 

tests/test_pickling.py:192: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_retention[retention1]

test_pickling.py::test_pickling_file_handler_retention[retention1]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1')
retention = datetime.timedelta(seconds=46800)

    @pytest.mark.parametrize(
        "retention", [1000, datetime.timedelta(hours=13), "10 days", retention_function]
    )
    def test_pickling_file_handler_retention(tmp_path, retention):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, retention=retention)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_retention - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
retention  = datetime.timedelta(seconds=46800)
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1')
unpickled  = 

tests/test_pickling.py:192: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret1/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_retention[10 days]

test_pickling.py::test_pickling_file_handler_retention[10 days]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2')
retention = '10 days'

    @pytest.mark.parametrize(
        "retention", [1000, datetime.timedelta(hours=13), "10 days", retention_function]
    )
    def test_pickling_file_handler_retention(tmp_path, retention):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, retention=retention)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_retention - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
retention  = '10 days'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2')
unpickled  = 

tests/test_pickling.py:192: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret2/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_retention[retention_function]

test_pickling.py::test_pickling_file_handler_retention[retention_function]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3')
retention = 

    @pytest.mark.parametrize(
        "retention", [1000, datetime.timedelta(hours=13), "10 days", retention_function]
    )
    def test_pickling_file_handler_retention(tmp_path, retention):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, retention=retention)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_retention - A message\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
retention  = 
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3')
unpickled  = 

tests/test_pickling.py:192: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_ret3/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_compression[zip]

test_pickling.py::test_pickling_file_handler_compression[zip]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0')
compression = 'zip'

    @pytest.mark.parametrize("compression", ["zip", "gz", "tar", compression_function])
    def test_pickling_file_handler_compression(tmp_path, compression):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, compression=compression)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_compression - A message\n"

compression = 'zip'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0')
unpickled  = 

tests/test_pickling.py:202: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_compression[gz]

test_pickling.py::test_pickling_file_handler_compression[gz]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1')
compression = 'gz'

    @pytest.mark.parametrize("compression", ["zip", "gz", "tar", compression_function])
    def test_pickling_file_handler_compression(tmp_path, compression):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, compression=compression)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_compression - A message\n"

compression = 'gz'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1')
unpickled  = 

tests/test_pickling.py:202: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com1/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_compression[tar]

test_pickling.py::test_pickling_file_handler_compression[tar]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2')
compression = 'tar'

    @pytest.mark.parametrize("compression", ["zip", "gz", "tar", compression_function])
    def test_pickling_file_handler_compression(tmp_path, compression):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, compression=compression)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_compression - A message\n"

compression = 'tar'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2')
unpickled  = 

tests/test_pickling.py:202: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com2/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_file_handler_compression[compression_function]

test_pickling.py::test_pickling_file_handler_compression[compression_function]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3')
compression = 

    @pytest.mark.parametrize("compression", ["zip", "gz", "tar", compression_function])
    def test_pickling_file_handler_compression(tmp_path, compression):
        file = tmp_path / "test.log"
        logger.add(file, format="{level} - {function} - {message}", delay=True, compression=compression)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.debug("A message")
>       assert file.read_text() == "DEBUG - test_pickling_file_handler_compression - A message\n"

compression = 
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3/test.log')
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3')
unpickled  = 

tests/test_pickling.py:202: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_pickling_file_handler_com3/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_pickling.py::test_pickling_no_handler

test_pickling.py::test_pickling_no_handler
writer = .w at 0x7fac077edbd0>

    def test_pickling_no_handler(writer):
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.add(writer, format="{level} - {function} - {message}")
        unpickled.debug("A message")
>       assert writer.read() == "DEBUG - test_pickling_no_handler - A message\n"
E       AssertionError: assert '' == 'DEBUG - test...- A message\n'
E         
E         - DEBUG - test_pickling_no_handler - A message

pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 
writer     = .w at 0x7fac077edbd0>

tests/test_pickling.py:210: AssertionError

test_pickling.py::test_pickling_handler_not_serializable

test_pickling.py::test_pickling_handler_not_serializable
def test_pickling_handler_not_serializable():
        logger.add(lambda m: None)
>       with pytest.raises((pickle.PicklingError, AttributeError), match="Can't (pickle|get local)"):
E       Failed: DID NOT RAISE (, )


tests/test_pickling.py:215: Failed

test_pickling.py::test_pickling_filter_function

test_pickling.py::test_pickling_filter_function
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07cface0>

    def test_pickling_filter_function(capsys):
        logger.add(print_, format="{message}", filter=filter_function)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("Nope")
        unpickled.info("[PASS] Yes")
        out, err = capsys.readouterr()
>       assert out == "[PASS] Yes\n"
E       AssertionError: assert '' == '[PASS] Yes\n'
E         
E         - [PASS] Yes

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07cface0>
err        = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:226: AssertionError

test_pickling.py::test_pickling_filter_name[]

test_pickling.py::test_pickling_filter_name[]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0ba867a0>, filter = ''

    @pytest.mark.parametrize("filter", ["", "tests"])
    def test_pickling_filter_name(capsys, filter):
        logger.add(print_, format="{message}", filter=filter)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("A message")
        out, err = capsys.readouterr()
>       assert out == "A message\n"
E       AssertionError: assert '' == 'A message\n'
E         
E         - A message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0ba867a0>
err        = ''
filter     = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:237: AssertionError

test_pickling.py::test_pickling_filter_name[tests]

test_pickling.py::test_pickling_filter_name[tests]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0751a860>
filter = 'tests'

    @pytest.mark.parametrize("filter", ["", "tests"])
    def test_pickling_filter_name(capsys, filter):
        logger.add(print_, format="{message}", filter=filter)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("A message")
        out, err = capsys.readouterr()
>       assert out == "A message\n"
E       AssertionError: assert '' == 'A message\n'
E         
E         - A message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0751a860>
err        = ''
filter     = 'tests'
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:237: AssertionError

test_pickling.py::test_pickling_format_string[True]

test_pickling.py::test_pickling_format_string[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07773d90>
colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_pickling_format_string(capsys, colorize):
        logger.add(print_, format="-> {message}", colorize=colorize)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("The message")
        out, err = capsys.readouterr()
>       assert out == parse("-> The message\n", strip=not colorize)

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07773d90>
colorize   = True
err        = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:248: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '-> The message\n'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

test_pickling.py::test_pickling_format_string[False]

test_pickling.py::test_pickling_format_string[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08290340>
colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_pickling_format_string(capsys, colorize):
        logger.add(print_, format="-> {message}", colorize=colorize)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("The message")
        out, err = capsys.readouterr()
>       assert out == parse("-> The message\n", strip=not colorize)

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08290340>
colorize   = False
err        = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:248: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '-> The message\n'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

test_pickling.py::test_pickling_format_function[True]

test_pickling.py::test_pickling_format_function[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0820d7b0>
colorize = True

    @pytest.mark.parametrize("colorize", [True, False])
    def test_pickling_format_function(capsys, colorize):
        logger.add(print_, format=format_function, colorize=colorize)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("The message")
        out, err = capsys.readouterr()
>       assert out == parse("-> The message", strip=not colorize)

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0820d7b0>
colorize   = True
err        = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:259: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = False
        text       = '-> The message'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

test_pickling.py::test_pickling_format_function[False]

test_pickling.py::test_pickling_format_function[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08308df0>
colorize = False

    @pytest.mark.parametrize("colorize", [True, False])
    def test_pickling_format_function(capsys, colorize):
        logger.add(print_, format=format_function, colorize=colorize)
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.info("The message")
        out, err = capsys.readouterr()
>       assert out == parse("-> The message", strip=not colorize)

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08308df0>
colorize   = False
err        = ''
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:259: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:53: in parse
    tokens = parser.done(strict=strict)
        parser     = 
        strict     = True
        strip      = True
        text       = '-> The message'
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , strict = True

    def done(self, strict=True):
        if strict and self._tags:
>           raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
E           ValueError: Unclosed tags: red, red

self       = 
strict     = True

loguru/_colorizer.py:161: ValueError

test_pickling.py::test_pickling_filter_function_not_serializable

test_pickling.py::test_pickling_filter_function_not_serializable
def test_pickling_filter_function_not_serializable():
        logger.add(print, filter=lambda r: True)
>       with pytest.raises((pickle.PicklingError, AttributeError), match="Can't (pickle|get local)"):
E       Failed: DID NOT RAISE (, )


tests/test_pickling.py:265: Failed

test_pickling.py::test_pickling_format_function_not_serializable

test_pickling.py::test_pickling_format_function_not_serializable
def test_pickling_format_function_not_serializable():
        logger.add(print, format=lambda r: "{message}")
>       with pytest.raises((pickle.PicklingError, AttributeError), match="Can't (pickle|get local)"):
E       Failed: DID NOT RAISE (, )


tests/test_pickling.py:271: Failed

test_pickling.py::test_pickling_bound_logger

test_pickling.py::test_pickling_bound_logger
writer = .w at 0x7fac077ef0a0>

    def test_pickling_bound_logger(writer):
        bound_logger = logger.bind(foo="bar")
        pickled = pickle.dumps(bound_logger)
        unpickled = pickle.loads(pickled)
>       unpickled.add(writer, format="{extra[foo]}")
E       AttributeError: 'NoneType' object has no attribute 'add'

bound_logger = None
pickled    = b'\x80\x04N.'
unpickled  = None
writer     = .w at 0x7fac077ef0a0>

tests/test_pickling.py:279: AttributeError

test_pickling.py::test_pickling_patched_logger

test_pickling.py::test_pickling_patched_logger
writer = .w at 0x7fac077ee5f0>

    def test_pickling_patched_logger(writer):
        patched_logger = logger.patch(patch_function)
        pickled = pickle.dumps(patched_logger)
        unpickled = pickle.loads(pickled)
>       unpickled.add(writer, format="{extra[foo]}")
E       AttributeError: 'NoneType' object has no attribute 'add'

patched_logger = None
pickled    = b'\x80\x04N.'
unpickled  = None
writer     = .w at 0x7fac077ee5f0>

tests/test_pickling.py:288: AttributeError

test_pickling.py::test_remove_after_pickling

test_pickling.py::test_remove_after_pickling
capsys = <_pytest.capture.CaptureFixture object at 0x7fac071f9210>

    def test_remove_after_pickling(capsys):
        i = logger.add(print_, format="{message}")
        logger.info("A")
        pickled = pickle.dumps(logger)
        unpickled = pickle.loads(pickled)
        unpickled.remove(i)
        unpickled.info("B")
        out, err = capsys.readouterr()
>       assert out == "A\n"
E       AssertionError: assert '' == 'A\n'
E         
E         - A

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac071f9210>
err        = ''
i          = None
out        = ''
pickled    = b'\x80\x04\x95\xc8\x02\x00\x00\x00\x00\x00\x00\x8c\x0eloguru._logger\x94\x8c\x06Logger\x94\x93\x94)\x81\x94}\x94(\x8c\...x94\x8c\x0factivation_none\x94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub.'
unpickled  = 

tests/test_pickling.py:301: AssertionError

test_pickling.py::test_pickling_logging_method

test_pickling.py::test_pickling_logging_method
capsys = <_pytest.capture.CaptureFixture object at 0x7fac077719f0>

    def test_pickling_logging_method(capsys):
        logger.add(print_, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger.critical)
        func = pickle.loads(pickled)
        func("A message")
        out, err = capsys.readouterr()
>       assert out == "CRITICAL - test_pickling_logging_method - A message\n"
E       AssertionError: assert '' == 'CRITICAL - t...- A message\n'
E         
E         - CRITICAL - test_pickling_logging_method - A message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac077719f0>
err        = ''
func       = >
out        = ''
pickled    = b'\x80\x04\x95\xee\x02\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\x07getattr\x94\x93\x94\x8c\x0eloguru._logger\x9...8\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub\x8c\x08critical\x94\x86\x94R\x94.'

tests/test_pickling.py:311: AssertionError

test_pickling.py::test_pickling_log_method

test_pickling.py::test_pickling_log_method
capsys = <_pytest.capture.CaptureFixture object at 0x7fac071f9990>

    def test_pickling_log_method(capsys):
        logger.add(print_, format="{level} - {function} - {message}")
        pickled = pickle.dumps(logger.log)
        func = pickle.loads(pickled)
        func(19, "A message")
        out, err = capsys.readouterr()
>       assert out == "Level 19 - test_pickling_log_method - A message\n"
E       AssertionError: assert '' == 'Level 19 - t...- A message\n'
E         
E         - Level 19 - test_pickling_log_method - A message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac071f9990>
err        = ''
func       = >
out        = ''
pickled    = b'\x80\x04\x95\xe9\x02\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\x07getattr\x94\x93\x94\x8c\x0eloguru._logger\x9...94\x88\x8c\x04lock\x94Nub\x8c\x08_options\x94(NK\x00\x89\x89\x89\x89\x88]\x94}\x94t\x94ub\x8c\x03log\x94\x86\x94R\x94.'

tests/test_pickling.py:321: AssertionError

test_propagation.py::test_formatting

test_propagation.py::test_formatting
capsys = <_pytest.capture.CaptureFixture object at 0x7fac083c93c0>

    def test_formatting(capsys):
        fmt = (
            "%(name)s - %(filename)s - %(funcName)s - %(levelname)s - "
            "%(levelno)s - %(lineno)d - %(module)s - %(message)s"
        )

        expected = (
            "tests.test_propagation - test_propagation.py - test_formatting - DEBUG - "
            "10 - 30 - test_propagation - This is my message\n"
        )

        with make_logging_logger("tests.test_propagation", StreamHandler(sys.stderr), fmt):
            logger.add(PropagateHandler(), format="{message}")
            logger.debug("This {verb} my {}", "message", verb="is")

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == expected
E       AssertionError: assert '' == 'tests.test_p... my message\n'
E         
E         - tests.test_propagation - test_propagation.py - test_formatting - DEBUG - 10 - 30 - test_propagation - This is my message

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac083c93c0>
err        = ''
expected   = 'tests.test_propagation - test_propagation.py - test_formatting - DEBUG - 10 - 30 - test_propagation - This is my message\n'
fmt        = '%(name)s - %(filename)s - %(funcName)s - %(levelname)s - %(levelno)s - %(lineno)d - %(module)s - %(message)s'
out        = ''

tests/test_propagation.py:34: AssertionError

test_propagation.py::test_propagate

test_propagation.py::test_propagate
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0757b0d0>

    def test_propagate(capsys):
        with make_logging_logger("tests", StreamHandler(sys.stderr)) as logging_logger:
            logging_logger.debug("1")
            logger.debug("2")

            logger.add(PropagateHandler(), format="{message}")

            logger.debug("3")
            logger.trace("4")

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == "1\n3\n"
E       AssertionError: assert '1\n' == '1\n3\n'
E         
E           1
E         - 3

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0757b0d0>
err        = '1\n'
logging_logger = 
out        = ''

tests/test_propagation.py:49: AssertionError

test_propagation.py::test_remove_propagation

test_propagation.py::test_remove_propagation
capsys = <_pytest.capture.CaptureFixture object at 0x7fac082553c0>

    def test_remove_propagation(capsys):
        with make_logging_logger("tests", StreamHandler(sys.stderr)) as logging_logger:
            i = logger.add(PropagateHandler(), format="{message}")

            logger.debug("1")
            logging_logger.debug("2")

            logger.remove(i)

            logger.debug("3")
            logging_logger.debug("4")

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == "1\n2\n4\n"
E       AssertionError: assert '2\n4\n' == '1\n2\n4\n'
E         
E         - 1
E           2
E           4

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac082553c0>
err        = '2\n4\n'
i          = None
logging_logger = 
out        = ''

tests/test_propagation.py:66: AssertionError

test_propagation.py::test_exception[False]

test_propagation.py::test_exception[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0757beb0>
use_opt = False

    @pytest.mark.parametrize("use_opt", [False, True])
    def test_exception(capsys, use_opt):
        with make_logging_logger("tests", StreamHandler(sys.stderr)):
            logger.add(PropagateHandler(), format="{message}")

            try:
                1 / 0  # noqa: B018
            except Exception:
                if use_opt:
                    logger.opt(exception=True).error("Oops...")
                else:
                    logger.exception("Oops...")

        out, err = capsys.readouterr()
        lines = err.strip().splitlines()

        error = "ZeroDivisionError: division by zero"

        assert out == ""
>       assert lines[0] == "Oops..."
E       IndexError: list index out of range

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0757beb0>
err        = ''
error      = 'ZeroDivisionError: division by zero'
lines      = []
out        = ''
use_opt    = False

tests/test_propagation.py:101: IndexError

test_propagation.py::test_exception[True]

test_propagation.py::test_exception[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac071ea6e0>
use_opt = True

    @pytest.mark.parametrize("use_opt", [False, True])
    def test_exception(capsys, use_opt):
        with make_logging_logger("tests", StreamHandler(sys.stderr)):
            logger.add(PropagateHandler(), format="{message}")

            try:
>               1 / 0  # noqa: B018
E               ZeroDivisionError: division by zero

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac071ea6e0>
use_opt    = True

tests/test_propagation.py:88: ZeroDivisionError

During handling of the above exception, another exception occurred:

capsys = <_pytest.capture.CaptureFixture object at 0x7fac071ea6e0>
use_opt = True

    @pytest.mark.parametrize("use_opt", [False, True])
    def test_exception(capsys, use_opt):
        with make_logging_logger("tests", StreamHandler(sys.stderr)):
            logger.add(PropagateHandler(), format="{message}")

            try:
                1 / 0  # noqa: B018
            except Exception:
                if use_opt:
>                   logger.opt(exception=True).error("Oops...")
E                   AttributeError: 'NoneType' object has no attribute 'error'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac071ea6e0>
use_opt    = True

tests/test_propagation.py:91: AttributeError

test_recattr.py::test_patch_record_file

test_recattr.py::test_patch_record_file
writer = .w at 0x7fac077ecdc0>

    def test_patch_record_file(writer):
        def patch(record):
            record["file"].name = "456"
            record["file"].path = "123/456"

        logger.add(writer, format="{file} {file.name} {file.path}")
>       logger.patch(patch).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

patch      = .patch at 0x7fac077ef400>
writer     = .w at 0x7fac077ecdc0>

tests/test_recattr.py:13: AttributeError

test_recattr.py::test_patch_record_thread

test_recattr.py::test_patch_record_thread
writer = .w at 0x7fac077ef010>

    def test_patch_record_thread(writer):
        def patch(record):
            record["thread"].id = 111
            record["thread"].name = "Thread-111"

        logger.add(writer, format="{thread} {thread.name} {thread.id}")
>       logger.patch(patch).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

patch      = .patch at 0x7fac077ef520>
writer     = .w at 0x7fac077ef010>

tests/test_recattr.py:24: AttributeError

test_recattr.py::test_patch_record_process

test_recattr.py::test_patch_record_process
writer = .w at 0x7fac077ee9e0>

    def test_patch_record_process(writer):
        def patch(record):
            record["process"].id = 123
            record["process"].name = "Process-123"

        logger.add(writer, format="{process} {process.name} {process.id}")
>       logger.patch(patch).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

patch      = .patch at 0x7fac077ef7f0>
writer     = .w at 0x7fac077ee9e0>

tests/test_recattr.py:35: AttributeError

test_recattr.py::test_patch_record_exception

test_recattr.py::test_patch_record_exception
writer = .w at 0x7fac077ecf70>

    def test_patch_record_exception(writer):
        def patch(record):
            type_, value, traceback = record["exception"]
            record["exception"] = (type_, value, None)

        logger.add(writer, format="")
        try:
>           1 / 0  # noqa: B018
E           ZeroDivisionError: division by zero

patch      = .patch at 0x7fac077efb50>
writer     = .w at 0x7fac077ecf70>

tests/test_recattr.py:47: ZeroDivisionError

During handling of the above exception, another exception occurred:

writer = .w at 0x7fac077ecf70>

    def test_patch_record_exception(writer):
        def patch(record):
            type_, value, traceback = record["exception"]
            record["exception"] = (type_, value, None)

        logger.add(writer, format="")
        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
>           logger.patch(patch).exception("Error")
E           AttributeError: 'NoneType' object has no attribute 'exception'

patch      = .patch at 0x7fac077efb50>
writer     = .w at 0x7fac077ecf70>

tests/test_recattr.py:49: AttributeError

test_remove.py::test_remove_all

test_remove.py::test_remove_all
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_all0')
writer = .w at 0x7fac077c4040>
capsys = <_pytest.capture.CaptureFixture object at 0x7fac075786a0>

    def test_remove_all(tmp_path, writer, capsys):
        file = tmp_path / "test.log"

        logger.debug("This shouldn't be printed.")

        logger.add(file, format="{message}")
        logger.add(sys.stdout, format="{message}")
        logger.add(sys.stderr, format="{message}")
        logger.add(writer, format="{message}")

        message = "some message"
        expected = message + "\n"

        logger.debug(message)

        logger.remove()

        logger.debug("This shouldn't be printed neither.")

        out, err = capsys.readouterr()

>       assert file.read_text() == expected

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac075786a0>
err        = ''
expected   = 'some message\n'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_all0/test.log')
message    = 'some message'
out        = ''
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_all0')
writer     = .w at 0x7fac077c4040>

tests/test_remove.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_all0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_all0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_remove_all0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_all0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_remove.py::test_remove_simple

test_remove.py::test_remove_simple
writer = .w at 0x7fac077efd90>

    def test_remove_simple(writer):
        i = logger.add(writer, format="{message}")
        logger.debug("1")
        logger.remove(i)
        logger.debug("2")
>       assert writer.read() == "1\n"
E       AssertionError: assert '' == '1\n'
E         
E         - 1

i          = None
writer     = .w at 0x7fac077efd90>

tests/test_remove.py:49: AssertionError

test_remove.py::test_remove_enqueue

test_remove.py::test_remove_enqueue
writer = .w at 0x7fac077efa30>

    def test_remove_enqueue(writer):
        i = logger.add(writer, format="{message}", enqueue=True)
        logger.debug("1")
        time.sleep(0.1)
        logger.remove(i)
        logger.debug("2")
>       assert writer.read() == "1\n"
E       AssertionError: assert '' == '1\n'
E         
E         - 1

i          = None
writer     = .w at 0x7fac077efa30>

tests/test_remove.py:58: AssertionError

test_remove.py::test_remove_enqueue_filesink

test_remove.py::test_remove_enqueue_filesink
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0')

    def test_remove_enqueue_filesink(tmp_path):
        file = tmp_path / "test.log"
        i = logger.add(file, format="{message}", enqueue=True)
        logger.debug("1")
        logger.remove(i)
>       assert file.read_text() == "1\n"

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0/test.log')
i          = None
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0')

tests/test_remove.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
        encoding   = 'locale'
        errors     = None
        self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0/test.log')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0/test.log')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0/test.log'

buffering  = -1
encoding   = 'locale'
errors     = None
mode       = 'r'
newline    = None
self       = PosixPath('/tmp/pytest-of-root/pytest-0/test_remove_enqueue_filesink0/test.log')

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError

test_remove.py::test_exception_in_stop_during_remove_one

test_remove.py::test_exception_in_stop_during_remove_one
capsys = <_pytest.capture.CaptureFixture object at 0x7fac082ea860>

    def test_exception_in_stop_during_remove_one(capsys):
        i = logger.add(StopSinkError(), catch=False, format="{message}")
        logger.info("A")
>       with pytest.raises(OSError, match=r"Stop error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac082ea860>
i          = None

tests/test_remove.py:72: Failed

test_remove.py::test_exception_in_stop_not_caught_during_remove_all

test_remove.py::test_exception_in_stop_not_caught_during_remove_all
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0bb68640>

    def test_exception_in_stop_not_caught_during_remove_all(capsys):
        logger.add(StopSinkError(), catch=False, format="{message}")
        logger.add(StopSinkError(), catch=False, format="{message}")

>       with pytest.raises(OSError, match=r"Stop error"):
E       Failed: DID NOT RAISE 

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0bb68640>

tests/test_remove.py:86: Failed

test_remove.py::test_invalid_handler_id_value

test_remove.py::test_invalid_handler_id_value
writer = .w at 0x7fac077efb50>

    def test_invalid_handler_id_value(writer):
        logger.add(writer)

>       with pytest.raises(ValueError, match=r"^There is no existing handler.*"):
E       Failed: DID NOT RAISE 

writer     = .w at 0x7fac077efb50>

tests/test_remove.py:105: Failed

test_remove.py::test_invalid_handler_id_type[handler_id0]

test_remove.py::test_invalid_handler_id_type[handler_id0]
handler_id = <_io.TextIOWrapper name="<_io.FileIO name=8 mode='rb+' closefd=True>" mode='r+' encoding='utf-8'>

    @pytest.mark.parametrize("handler_id", [sys.stderr, sys, object(), int])
    def test_invalid_handler_id_type(handler_id):
>       with pytest.raises(TypeError, match=r"^Invalid handler id.*"):
E       Failed: DID NOT RAISE 

handler_id = <_io.TextIOWrapper name="<_io.FileIO name=8 mode='rb+' closefd=True>" mode='r+' encoding='utf-8'>

tests/test_remove.py:111: Failed

test_remove.py::test_invalid_handler_id_type[sys]

test_remove.py::test_invalid_handler_id_type[sys]
handler_id = 

    @pytest.mark.parametrize("handler_id", [sys.stderr, sys, object(), int])
    def test_invalid_handler_id_type(handler_id):
>       with pytest.raises(TypeError, match=r"^Invalid handler id.*"):
E       Failed: DID NOT RAISE 

handler_id = 

tests/test_remove.py:111: Failed

test_remove.py::test_invalid_handler_id_type[handler_id2]

test_remove.py::test_invalid_handler_id_type[handler_id2]
handler_id = 

    @pytest.mark.parametrize("handler_id", [sys.stderr, sys, object(), int])
    def test_invalid_handler_id_type(handler_id):
>       with pytest.raises(TypeError, match=r"^Invalid handler id.*"):
E       Failed: DID NOT RAISE 

handler_id = 

tests/test_remove.py:111: Failed


test_remove.py::test_invalid_handler_id_type[int]

test_remove.py::test_invalid_handler_id_type[int]
handler_id = 

    @pytest.mark.parametrize("handler_id", [sys.stderr, sys, object(), int])
    def test_invalid_handler_id_type(handler_id):
>       with pytest.raises(TypeError, match=r"^Invalid handler id.*"):
E       Failed: DID NOT RAISE 

handler_id = 

tests/test_remove.py:111: Failed

test_repr.py::test_stderr

test_repr.py::test_stderr
def test_stderr():
        logger.add(sys.__stderr__)
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 


tests/test_repr.py:15: AssertionError

test_repr.py::test_stdout

test_repr.py::test_stdout
def test_stdout():
        logger.add(sys.__stdout__)
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 


tests/test_repr.py:20: AssertionError

test_repr.py::test_file_object

test_repr.py::test_file_object
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_object0')

    def test_file_object(tmp_path):
        path = str(tmp_path / "test.log")
        file = open(path, "w")
        logger.add(file)
>       assert repr(logger) == "" % path
E       AssertionError: assert '' == ''
E         
E         - 
E         + 

file       = <_io.TextIOWrapper name='/tmp/pytest-of-root/pytest-0/test_file_object0/test.log' mode='w' encoding='UTF-8'>
path       = '/tmp/pytest-of-root/pytest-0/test_file_object0/test.log'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_object0')

tests/test_repr.py:27: AssertionError

test_repr.py::test_file_str

test_repr.py::test_file_str
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_str0')

    def test_file_str(tmp_path):
        path = str(tmp_path / "test.log")
        logger.add(path)
>       assert repr(logger) == "" % path
E       assert '' == ""
E         
E         - 
E         + 

path       = '/tmp/pytest-of-root/pytest-0/test_file_str0/test.log'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_str0')

tests/test_repr.py:33: AssertionError

test_repr.py::test_file_pathlib

test_repr.py::test_file_pathlib
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_pathlib0')

    def test_file_pathlib(tmp_path):
        path = str(tmp_path / "test.log")
        logger.add(pathlib.Path(path))
>       assert repr(logger) == "" % path
E       assert '' == ""
E         
E         - 
E         + 

path       = '/tmp/pytest-of-root/pytest-0/test_file_pathlib0/test.log'
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_pathlib0')

tests/test_repr.py:39: AssertionError

test_repr.py::test_stream_object

test_repr.py::test_stream_object
def test_stream_object():
        class MyStream:
            def __init__(self, name):
                self.name = name

            def write(self, m):
                pass

            def __repr__(self):
                return "MyStream()"

        logger.add(MyStream(""))
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 

MyStream   = .MyStream'>

tests/test_repr.py:54: AssertionError

test_repr.py::test_stream_object_without_name_attr

test_repr.py::test_stream_object_without_name_attr
def test_stream_object_without_name_attr():
        class MyStream:
            def write(self, m):
                pass

            def __repr__(self):
                return "MyStream()"

        logger.add(MyStream())
>       assert repr(logger) == ""
E       AssertionError: assert '' == ''
E         
E         - 
E         + 

MyStream   = .MyStream'>

tests/test_repr.py:66: AssertionError

test_repr.py::test_stream_object_with_empty_name

test_repr.py::test_stream_object_with_empty_name
def test_stream_object_with_empty_name():
        class MyStream2:
            def __init__(self):
                self.name = ""

            def write(self, message):
                pass

            def __repr__(self):
                return "MyStream2()"

        logger.add(MyStream2())
>       assert repr(logger) == ""
E       AssertionError: assert '' == ''
E         
E         - 
E         + 

MyStream2  = .MyStream2'>

tests/test_repr.py:81: AssertionError

test_repr.py::test_function

test_repr.py::test_function
def test_function():
        def my_function(message):
            pass

        logger.add(my_function)
>       assert repr(logger) == ""
E       AssertionError: assert '' == ''
E         
E         - 
E         + 

my_function = .my_function at 0x7fac077c5870>

tests/test_repr.py:89: AssertionError

test_repr.py::test_callable_without_name

test_repr.py::test_callable_without_name
def test_callable_without_name():
        class Function:
            def __call__(self):
                pass

            def __repr__(self):
                return ""

        logger.add(Function())
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 

Function   = .Function'>

tests/test_repr.py:101: AssertionError

test_repr.py::test_callable_with_empty_name

test_repr.py::test_callable_with_empty_name
def test_callable_with_empty_name():
        class Function:
            __name__ = ""

            def __call__(self):
                pass

            def __repr__(self):
                return ""

        logger.add(Function())
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 

Function   = .Function'>

tests/test_repr.py:115: AssertionError

test_repr.py::test_coroutine_function

test_repr.py::test_coroutine_function
def test_coroutine_function():
        async def my_async_function(message):
            pass

        logger.add(my_async_function)
>       assert repr(logger) == ""
E       AssertionError: assert '' == ''
E         
E         - 
E         + 

my_async_function = .my_async_function at 0x7fac077ecb80>

tests/test_repr.py:123: AssertionError

test_repr.py::test_coroutine_callable_without_name

test_repr.py::test_coroutine_callable_without_name
def test_coroutine_callable_without_name():
        class CoroutineFunction:
            async def __call__(self):
                pass

            def __repr__(self):
                return ""

        logger.add(CoroutineFunction())
>       assert (
            repr(logger) == ")]>"
        )
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 

CoroutineFunction = .CoroutineFunction'>

tests/test_repr.py:135: AssertionError

test_repr.py::test_coroutine_function_with_empty_name

test_repr.py::test_coroutine_function_with_empty_name
def test_coroutine_function_with_empty_name():
        class CoroutineFunction:
            __name__ = ""

            def __call__(self):
                pass

            def __repr__(self):
                return ""

        logger.add(CoroutineFunction())
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 

CoroutineFunction = .CoroutineFunction'>

tests/test_repr.py:151: AssertionError

test_repr.py::test_standard_handler

test_repr.py::test_standard_handler
def test_standard_handler():
        handler = logging.StreamHandler(sys.__stderr__)
        logger.add(handler)
        if sys.version_info >= (3, 6):
            r = " (NOTSET)>)]>"
>           assert repr(logger) == r
E           AssertionError: assert '' == ')]>'
E             
E             -  (NOTSET)>)]>
E             + 

handler    =  (NOTSET)>
r          = ' (NOTSET)>)]>'

tests/test_repr.py:159: AssertionError

test_repr.py::test_multiple_handlers

test_repr.py::test_multiple_handlers
def test_multiple_handlers():
        logger.add(sys.__stdout__)
        logger.add(sys.__stderr__)
        r = (
            "), "
            "(id=1, level=10, sink=)"
            "]>"
        )
>       assert repr(logger) == r
E       AssertionError: assert '' == ')]>'
E         
E         - ), (id=1, level=10, sink=)]>
E         + 

r          = '), (id=1, level=10, sink=)]>'

tests/test_repr.py:174: AssertionError

test_repr.py::test_handler_removed

test_repr.py::test_handler_removed
def test_handler_removed():
        i = logger.add(sys.__stdout__)
        logger.add(sys.__stderr__)
        logger.remove(i)
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 

i          = None

tests/test_repr.py:181: AssertionError

test_repr.py::test_handler_level_name

test_repr.py::test_handler_level_name
def test_handler_level_name():
        logger.add(sys.__stderr__, level="TRACE")
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 


tests/test_repr.py:186: AssertionError

test_repr.py::test_handler_level_num

test_repr.py::test_handler_level_num
def test_handler_level_num():
        logger.add(sys.__stderr__, level=33)
>       assert repr(logger) == ")]>"
E       AssertionError: assert '' == ')]>'
E         
E         - )]>
E         + 


tests/test_repr.py:191: AssertionError

test_standard_handler.py::test_stream_handler

test_standard_handler.py::test_stream_handler
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07cf9930>

    def test_stream_handler(capsys):
        logger.add(StreamHandler(sys.stderr), format="{level} {message}")
        logger.info("test")
        logger.remove()
        logger.warning("nope")

        out, err = capsys.readouterr()
        assert out == ""
>       assert err == "INFO test\n"
E       AssertionError: assert '' == 'INFO test\n'
E         
E         - INFO test

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07cf9930>
err        = ''
out        = ''

tests/test_standard_handler.py:17: AssertionError

test_standard_handler.py::test_file_handler

test_standard_handler.py::test_file_handler
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_handler0')

    def test_file_handler(tmp_path):
        file = tmp_path / "test.log"
        logger.add(FileHandler(str(file)), format="{message} {level.name}")
        logger.info("test")
        logger.remove()
        logger.warning("nope")

>       assert file.read_text() == "test INFO\n"
E       AssertionError: assert '' == 'test INFO\n'
E         
E         - test INFO

file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_handler0/test.log')
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_file_handler0')

tests/test_standard_handler.py:27: AssertionError

test_standard_handler.py::test_extra_dict

test_standard_handler.py::test_extra_dict
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07cf96c0>

    def test_extra_dict(capsys):
        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(extra)s %(message)s")
        handler.setFormatter(formatter)
        logger.add(handler, format="<{extra[abc]}> {message}", catch=False)
>       logger.bind(abc=123).info("Extra!")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07cf96c0>
formatter  = 
handler    = 

tests/test_standard_handler.py:45: AttributeError

test_standard_handler.py::test_no_conflict_with_extra_dict

test_standard_handler.py::test_no_conflict_with_extra_dict
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0820cc40>

    def test_no_conflict_with_extra_dict(capsys):
        handler = StreamHandler(sys.stdout)
        logger.add(handler, format="{message}", catch=False)
>       logger.bind(args=True, name="foobar", message="Wut?").info("OK!")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0820cc40>
handler    = 

tests/test_standard_handler.py:54: AttributeError

test_standard_handler.py::test_no_exception

test_standard_handler.py::test_no_exception
def test_no_exception():
        result = None

        class NoExceptionHandler(Handler):
            def emit(self, record):
                nonlocal result
                result = bool(not record.exc_info)

        logger.add(NoExceptionHandler())

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error")

>       assert result is False
E       assert None is False

NoExceptionHandler = .NoExceptionHandler'>
result     = None

tests/test_standard_handler.py:75: AssertionError

test_standard_handler.py::test_exception

test_standard_handler.py::test_exception
capsys = <_pytest.capture.CaptureFixture object at 0x7fac08292200>

    def test_exception(capsys):
        result = None

        class ExceptionHandler(Handler):
            def emit(self, record):
                nonlocal result
                result = bool(record.exc_info)

        logger.add(ExceptionHandler())

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error")

>       assert result is True
E       assert None is True

ExceptionHandler = .ExceptionHandler'>
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac08292200>
result     = None

tests/test_standard_handler.py:93: AssertionError

test_standard_handler.py::test_exception_formatting

test_standard_handler.py::test_exception_formatting
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_formatting0')

    def test_exception_formatting(tmp_path):
        file = tmp_path / "test.log"
        logger.add(FileHandler(str(file)), format="{message}")

        try:
            1 / 0  # noqa: B018
        except ZeroDivisionError:
            logger.exception("Error")

        result = file.read_text()
        lines = result.strip().splitlines()

        error = "ZeroDivisionError: division by zero"

>       assert lines[1].startswith("Traceback")
E       IndexError: list index out of range

error      = 'ZeroDivisionError: division by zero'
file       = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_formatting0/test.log')
lines      = []
result     = ''
tmp_path   = PosixPath('/tmp/pytest-of-root/pytest-0/test_exception_formatting0')

tests/test_standard_handler.py:110: IndexError

test_standard_handler.py::test_standard_formatter[False]

test_standard_handler.py::test_standard_formatter[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac0751bbb0>
dynamic_format = False

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_standard_formatter(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message} [Not Chopped]"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
        logger.info("Test")
        out, err = capsys.readouterr()
>       assert out == "20 Test [Not Chopped] INFO\n"
E       AssertionError: assert '' == '20 Test [Not Chopped] INFO\n'
E         
E         - 20 Test [Not Chopped] INFO

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac0751bbb0>
dynamic_format = False
err        = ''
format_    = '{level.no} {message} [Not Chopped]'
formatter  = 
handler    = 
out        = ''

tests/test_standard_handler.py:129: AssertionError

test_standard_handler.py::test_standard_formatter[True]

test_standard_handler.py::test_standard_formatter[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac087150f0>
dynamic_format = True

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_standard_formatter(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message} [Not Chopped]"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
        logger.info("Test")
        out, err = capsys.readouterr()
>       assert out == "20 Test [Not Chopped] INFO\n"
E       AssertionError: assert '' == '20 Test [Not Chopped] INFO\n'
E         
E         - 20 Test [Not Chopped] INFO

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac087150f0>
dynamic_format = True
err        = ''
format_    = .format_ at 0x7fac077c5fc0>
formatter  = 
handler    = 
out        = ''

tests/test_standard_handler.py:129: AssertionError

test_standard_handler.py::test_standard_formatter_with_new_line[False]

test_standard_handler.py::test_standard_formatter_with_new_line[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07518ca0>
dynamic_format = False

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_standard_formatter_with_new_line(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message}\n"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
        logger.info("Test")
        out, err = capsys.readouterr()
>       assert out == "20 Test\n INFO\n"
E       AssertionError: assert '' == '20 Test\n INFO\n'
E         
E         - 20 Test
E         -  INFO

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07518ca0>
dynamic_format = False
err        = ''
format_    = '{level.no} {message}\n'
formatter  = 
handler    = 
out        = ''

tests/test_standard_handler.py:147: AssertionError

test_standard_handler.py::test_standard_formatter_with_new_line[True]

test_standard_handler.py::test_standard_formatter_with_new_line[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07cfaf20>
dynamic_format = True

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_standard_formatter_with_new_line(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message}\n"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
        logger.info("Test")
        out, err = capsys.readouterr()
>       assert out == "20 Test\n INFO\n"
E       AssertionError: assert '' == '20 Test\n INFO\n'
E         
E         - 20 Test
E         -  INFO

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07cfaf20>
dynamic_format = True
err        = ''
format_    = .format_ at 0x7fac077ef640>
formatter  = 
handler    = 
out        = ''

tests/test_standard_handler.py:147: AssertionError

test_standard_handler.py::test_raw_standard_formatter[False]

test_standard_handler.py::test_raw_standard_formatter[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac077b0400>
dynamic_format = False

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_raw_standard_formatter(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message} [Not Chopped]"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
>       logger.opt(raw=True).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac077b0400>
dynamic_format = False
format_    = '{level.no} {message} [Not Chopped]'
formatter  = 
handler    = 

tests/test_standard_handler.py:163: AttributeError

test_standard_handler.py::test_raw_standard_formatter[True]

test_standard_handler.py::test_raw_standard_formatter[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac087167d0>
dynamic_format = True

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_raw_standard_formatter(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message} [Not Chopped]"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
>       logger.opt(raw=True).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac087167d0>
dynamic_format = True
format_    = .format_ at 0x7fac077c5fc0>
formatter  = 
handler    = 

tests/test_standard_handler.py:163: AttributeError

test_standard_handler.py::test_raw_standard_formatter_with_new_line[False]

test_standard_handler.py::test_raw_standard_formatter_with_new_line[False]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac077b2530>
dynamic_format = False

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_raw_standard_formatter_with_new_line(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message}\n"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
>       logger.opt(raw=True).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac077b2530>
dynamic_format = False
format_    = '{level.no} {message}\n'
formatter  = 
handler    = 

tests/test_standard_handler.py:181: AttributeError

test_standard_handler.py::test_raw_standard_formatter_with_new_line[True]

test_standard_handler.py::test_raw_standard_formatter_with_new_line[True]
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07518b80>
dynamic_format = True

    @pytest.mark.parametrize("dynamic_format", [False, True])
    def test_raw_standard_formatter_with_new_line(capsys, dynamic_format):
        def format_(x):
            return "{level.no} {message}\n"

        if not dynamic_format:
            format_ = format_(None)

        handler = StreamHandler(sys.stdout)
        formatter = Formatter("%(message)s %(levelname)s")
        handler.setFormatter(formatter)
        logger.add(handler, format=format_)
>       logger.opt(raw=True).info("Test")
E       AttributeError: 'NoneType' object has no attribute 'info'

capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07518b80>
dynamic_format = True
format_    = .format_ at 0x7fac077c5870>
formatter  = 
handler    = 

tests/test_standard_handler.py:181: AttributeError

test_threading.py::test_safe_logging

test_threading.py::test_safe_logging
def test_safe_logging():
        barrier = Barrier(2)
        counter = itertools.count()

        sink = NonSafeSink(1)
        logger.add(sink, format="{message}", catch=False)

        def threaded():
            barrier.wait()
            logger.info("___{}___", next(counter))

        threads = [Thread(target=threaded) for _ in range(2)]

        for thread in threads:
            thread.start()

        for thread in threads:
            thread.join()

        logger.remove()

>       assert sink.written in ("___0___\n___1___\n", "___1___\n___0___\n")
E       AssertionError: assert '' in ('___0___\n___1___\n', '___1___\n___0___\n')
E        +  where '' = .written

barrier    = 
counter    = count(2)
sink       = 
thread     = 
threaded   = .threaded at 0x7fac077c64d0>
threads    = [, ]

tests/test_threading.py:48: AssertionError

test_threading.py::test_safe_adding_while_logging

test_threading.py::test_safe_adding_while_logging
writer = .w at 0x7fac077c5c60>

    def test_safe_adding_while_logging(writer):
        barrier = Barrier(2)
        counter = itertools.count()

        sink_1 = NonSafeSink(1)
        sink_2 = NonSafeSink(1)
        logger.add(sink_1, format="{message}", catch=False)

        def thread_1():
            barrier.wait()
            logger.info("aaa{}bbb", next(counter))

        def thread_2():
            barrier.wait()
            time.sleep(0.5)
            logger.add(sink_2, format="{message}", catch=False)
            logger.info("ccc{}ddd", next(counter))

        threads = [Thread(target=thread_1), Thread(target=thread_2)]

        for thread in threads:
            thread.start()

        for thread in threads:
            thread.join()

        logger.remove()

>       assert sink_1.written == "aaa0bbb\nccc1ddd\n"
E       AssertionError: assert '' == 'aaa0bbb\nccc1ddd\n'
E         
E         - aaa0bbb
E         - ccc1ddd

barrier    = 
counter    = count(2)
sink_1     = 
sink_2     = 
thread     = 
thread_1   = .thread_1 at 0x7fac077c6560>
thread_2   = .thread_2 at 0x7fac077c5fc0>
threads    = [, ]
writer     = .w at 0x7fac077c5c60>

tests/test_threading.py:79: AssertionError

test_threading.py::test_safe_removing_while_logging

test_threading.py::test_safe_removing_while_logging
capsys = <_pytest.capture.CaptureFixture object at 0x7fac07751f90>

    def test_safe_removing_while_logging(capsys):
        barrier = Barrier(2)
        counter = itertools.count()

        sink = NonSafeSink(1)
        i = logger.add(sink, format="{message}", catch=False)

        def thread_1():
            barrier.wait()
            logger.info("aaa{}bbb", next(counter))

        def thread_2():
            barrier.wait()
            time.sleep(0.5)
            logger.remove(i)
            logger.info("ccc{}ddd", next(counter))

        threads = [Thread(target=thread_1), Thread(target=thread_2)]

        for thread in threads:
            thread.start()

        for thread in threads:
            thread.join()

        out, err = capsys.readouterr()
        assert out == ""
        assert err == ""
>       assert sink.written == "aaa0bbb\n"
E       AssertionError: assert '' == 'aaa0bbb\n'
E         
E         - aaa0bbb

barrier    = 
capsys     = <_pytest.capture.CaptureFixture object at 0x7fac07751f90>
counter    = count(2)
err        = ''
i          = None
out        = ''
sink       = 
thread     = 
thread_1   = .thread_1 at 0x7fac077c6950>
thread_2   = .thread_2 at 0x7fac077c69e0>
threads    = [, ]

tests/test_threading.py:111: AssertionError

test_logger.yml::basic_logger_usage[method=trace]

test_logger.yml::basic_logger_usage[method=trace]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=debug]

test_logger.yml::basic_logger_usage[method=debug]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=info]

test_logger.yml::basic_logger_usage[method=info]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=success]

test_logger.yml::basic_logger_usage[method=success]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=warning]

test_logger.yml::basic_logger_usage[method=warning]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=error]

test_logger.yml::basic_logger_usage[method=error]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=exception]

test_logger.yml::basic_logger_usage[method=exception]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_logger_usage[method=critical]

test_logger.yml::basic_logger_usage[method=critical]
/testbed/tests/typesafety/test_logger.yml:14: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:3: note: Revealed type is "Any"          (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:3: note: Revealed type is "loguru.Logger" (diff)
E     main:4: note: Revealed type is "None"         (diff)
E   Alignment of first line difference:
E     E: main:3: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::using_log_function[level='INFO']

test_logger.yml::using_log_function[level='INFO']
/testbed/tests/typesafety/test_logger.yml:24: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::using_log_function[level=30]

test_logger.yml::using_log_function[level=30]
/testbed/tests/typesafety/test_logger.yml:24: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::using_logging_arguments

test_logger.yml::using_logging_arguments
/testbed/tests/typesafety/test_logger.yml:29: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::logging_non_string[message=123]

test_logger.yml::logging_non_string[message=123]
/testbed/tests/typesafety/test_logger.yml:38: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::logging_non_string[message=dict(foo=456)]

test_logger.yml::logging_non_string[message=dict(foo=456)]
/testbed/tests/typesafety/test_logger.yml:38: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::logging_non_string[message=object()]

test_logger.yml::logging_non_string[message=object()]
/testbed/tests/typesafety/test_logger.yml:38: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::add_sink[sink=sys.stderr]

test_logger.yml::add_sink[sink=sys.stderr]
/testbed/tests/typesafety/test_logger.yml:55: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:2: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "builtins.int"...
E     A: main:2: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::add_sink[sink='test.txt']

test_logger.yml::add_sink[sink='test.txt']
/testbed/tests/typesafety/test_logger.yml:55: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:2: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "builtins.int"...
E     A: main:2: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::add_sink[sink=Path('file.log')]

test_logger.yml::add_sink[sink=Path('file.log')]
/testbed/tests/typesafety/test_logger.yml:55: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:2: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "builtins.int"...
E     A: main:2: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::add_sink[sink=lambda m: None]

test_logger.yml::add_sink[sink=lambda m: None]
/testbed/tests/typesafety/test_logger.yml:55: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:2: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "builtins.int"...
E     A: main:2: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::add_sink[sink=StreamHandler()]

test_logger.yml::add_sink[sink=StreamHandler()]
/testbed/tests/typesafety/test_logger.yml:55: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:2: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "builtins.int"...
E     A: main:2: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::basic_sink_options[format='{message}',filter='module',context='fork']

test_logger.yml::basic_sink_options[format='{message}',filter='module',context='fork']
/testbed/tests/typesafety/test_logger.yml:67: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:3: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::basic_sink_options[format=lambda r: '{message}\n',filter=lambda r: True,context=get_context('fork')]

test_logger.yml::basic_sink_options[format=lambda r: '{message}\n',filter=lambda r: True,context=get_context('fork')]
/testbed/tests/typesafety/test_logger.yml:67: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:3: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::file_sink_options

test_logger.yml::file_sink_options
/testbed/tests/typesafety/test_logger.yml:85: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::async_sink_options

test_logger.yml::async_sink_options
/testbed/tests/typesafety/test_logger.yml:101: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::remove_sink

test_logger.yml::remove_sink
/testbed/tests/typesafety/test_logger.yml:113: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::await_completion

test_logger.yml::await_completion
/testbed/tests/typesafety/test_logger.yml:123: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:5: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:5: note: Revealed type is "typing.Awaitable[None]" (diff)
E   Alignment of first line difference:
E     E: main:5: note: Revealed type is "typing.Awaitable[None]"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::catch_as_decorator_with_parentheses

test_logger.yml::catch_as_decorator_with_parentheses
/testbed/tests/typesafety/test_logger.yml:134: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "def (a: builtins.int, b: builtins.int) -> builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "def (a: builtins.int, b: builtins.int) -...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::catch_as_decorator_without_parentheses

test_logger.yml::catch_as_decorator_without_parentheses
/testbed/tests/typesafety/test_logger.yml:145: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:6: note: Revealed type is "def (a: builtins.int, b: builtins.int) -> builtins.int" (diff)
E   Alignment of first line difference:
E     E: main:6: note: Revealed type is "def (a: builtins.int, b: builtins.int) -...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::catch_as_context_manager

test_logger.yml::catch_as_context_manager
/testbed/tests/typesafety/test_logger.yml:155: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:5: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:5: note: Revealed type is "loguru.Catcher" (diff)
E   Alignment of first line difference:
E     E: main:5: note: Revealed type is "loguru.Catcher"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::opt

test_logger.yml::opt
/testbed/tests/typesafety/test_logger.yml:164: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:4: note: Revealed type is "loguru.Logger" (diff)
E   Alignment of first line difference:
E     E: main:4: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::bind

test_logger.yml::bind
/testbed/tests/typesafety/test_logger.yml:173: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:4: note: Revealed type is "loguru.Logger" (diff)
E   Alignment of first line difference:
E     E: main:4: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::patch

test_logger.yml::patch
/testbed/tests/typesafety/test_logger.yml:182: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:4: note: Revealed type is "loguru.Logger" (diff)
E   Alignment of first line difference:
E     E: main:4: note: Revealed type is "loguru.Logger"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::contextualize

test_logger.yml::contextualize
/testbed/tests/typesafety/test_logger.yml:192: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:5: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:5: note: Revealed type is "loguru.Contextualizer" (diff)
E   Alignment of first line difference:
E     E: main:5: note: Revealed type is "loguru.Contextualizer"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::level_get

test_logger.yml::level_get
/testbed/tests/typesafety/test_logger.yml:202: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]" (diff)
E   Alignment of first line difference:
E     E: main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builti...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::level_set

test_logger.yml::level_set
/testbed/tests/typesafety/test_logger.yml:222: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]" (diff)
E   Alignment of first line difference:
E     E: main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builti...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::level_update

test_logger.yml::level_update
/testbed/tests/typesafety/test_logger.yml:242: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:4: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]" (diff)
E   Alignment of first line difference:
E     E: main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builti...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::enable_and_disable_logger

test_logger.yml::enable_and_disable_logger
/testbed/tests/typesafety/test_logger.yml:257: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Output is not expected: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     (empty)

test_logger.yml::configure

test_logger.yml::configure
/testbed/tests/typesafety/test_logger.yml:272: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:9: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:9: note: Revealed type is "builtins.list[builtins.int]" (diff)
E   Alignment of first line difference:
E     E: main:9: note: Revealed type is "builtins.list[builtins.int]"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::parse

test_logger.yml::parse
/testbed/tests/typesafety/test_logger.yml:282: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru"  [import] (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E     main:5: note: Revealed type is "Any"          (diff)
E     main:6: note: Revealed type is "Any"          (diff)
E   Expected:
E     main:5: note: Revealed type is "typing.Generator[builtins.dict[builtins.str, Any], None, None]" (diff)
E     main:6: note: Revealed type is "builtins.dict[builtins.str, Any]" (diff)
E   Alignment of first line difference:
E     E: main:5: note: Revealed type is "typing.Generator[builtins.dict[builtins....
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::invalid_add_argument

test_logger.yml::invalid_add_argument
/testbed/tests/typesafety/test_logger.yml:292: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru" (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     main:2: error: No overload variant of "add" of "Logger" matches argument types "Callable[[Any], None]", "int" (diff)
E     main:2: note: Possible overload variants:     (diff)
E     main:2: note:     def add(self, sink: TextIO | Writable | Callable[[Message], None] | Handler, *, level: str | int = ..., format: str | Callable[[Record], str] = ..., filter: str | Callable[[Record], bool] | dict[str | None, str | int | bool] | None = ..., colorize: bool | None = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: str | BaseContext | None = ..., catch: bool = ...) -> int (diff)
E     main:2: note:     def add(self, sink: Callable[[Message], Awaitable[None]], *, level: str | int = ..., format: str | Callable[[Record], str] = ..., filter: str | Callable[[Record], bool] | dict[str | None, str | int | bool] | None = ..., colorize: bool | None = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: str | BaseContext | None = ..., catch: bool = ..., loop: AbstractEventLoop | None = ...) -> int (diff)
E     main:2: note:     def add(self, sink: str | PathLike[str], *, level: str | int = ..., format: str | Callable[[Record], str] = ..., filter: str | Callable[[Record], bool] | dict[str | None, str | int | bool] | None = ..., colorize: bool | None = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: str | BaseContext | None = ..., catch: bool = ..., rotation: str | int | time | timedelta | Callable[[Message, TextIO], bool] | None = ..., retention: str | int | timedelta | Callable[[list[str]], None] | None = ..., compression: str | Callable[[str], None] | None = ..., delay: bool = ..., watch: bool = ..., mode: str = ..., buffering: int = ..., encoding: str = ..., **kwargs: Any) -> int (diff)
E   Alignment of first line difference:
E     E: main:2: error: No overload variant of "add" of "Logger" matches argument...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::invalid_logged_object_formatting

test_logger.yml::invalid_logged_object_formatting
/testbed/tests/typesafety/test_logger.yml:334: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru" (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     main:2: error: No overload variant of "info" of "Logger" matches argument types "int", "int" (diff)
E     main:2: note: Possible overload variants:     (diff)
E     main:2: note:     def info(__self, str, /, *args: Any, **kwargs: Any) -> None (diff)
E     main:2: note:     def info(__self, Any, /) -> None (diff)
E   Alignment of first line difference:
E     E: main:2: error: No overload variant of "info" of "Logger" matches argumen...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

test_logger.yml::invalid_configuration

test_logger.yml::invalid_configuration
/testbed/tests/typesafety/test_logger.yml:362: 
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: error: Cannot find implementation or library stub for module named "loguru" (diff)
E     main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports (diff)
E   Expected:
E     main:4: error: Extra key "baz" for TypedDict "LevelConfig" (diff)
E     main:5: error: Argument "patcher" to "configure" of "Logger" has incompatible type "int"; expected "Callable[[Record], None] | None" (diff)
E     main:6: error: List item 0 has incompatible type "dict[str, str]"; expected "tuple[str | None, bool]" (diff)
E     main:7: error: Argument "extra" to "configure" of "Logger" has incompatible type "list[]"; expected "dict[Any, Any] | None" (diff)
E   Alignment of first line difference:
E     E: main:4: error: Extra key "baz" for TypedDict "LevelConfig"...
E     A: main:1: error: Cannot find implementation or library stub for module nam...
E             ^

Patch diff

diff --git a/loguru/_asyncio_loop.py b/loguru/_asyncio_loop.py
index 0cf1f06..0631efa 100644
--- a/loguru/_asyncio_loop.py
+++ b/loguru/_asyncio_loop.py
@@ -1,3 +1,21 @@
 import asyncio
 import sys
+
+def load_loop_functions():
+    if sys.version_info >= (3, 7):
+        # Python 3.7+ has get_running_loop()
+        def get_task_loop(task):
+            return task.get_loop()
+        return get_task_loop, asyncio.get_running_loop
+    else:
+        # For Python < 3.7
+        def get_task_loop(task):
+            return task._loop
+        def get_running_loop():
+            loop = asyncio._get_running_loop()
+            if loop is None:
+                raise RuntimeError('no running event loop')
+            return loop
+        return get_task_loop, get_running_loop
+
 get_task_loop, get_running_loop = load_loop_functions()
\ No newline at end of file
diff --git a/loguru/_better_exceptions.py b/loguru/_better_exceptions.py
index 7a7234c..07217d5 100644
--- a/loguru/_better_exceptions.py
+++ b/loguru/_better_exceptions.py
@@ -10,10 +10,12 @@ import sysconfig
 import tokenize
 import traceback
 if sys.version_info >= (3, 11):
+    from builtins import ExceptionGroup
 else:
     try:
         from exceptiongroup import ExceptionGroup
     except ImportError:
+        ExceptionGroup = None

 class SyntaxHighlighter:
     _default_style = {'comment': '\x1b[30m\x1b[1m{}\x1b[0m', 'keyword': '\x1b[35m\x1b[1m{}\x1b[0m', 'builtin': '\x1b[1m{}\x1b[0m', 'string': '\x1b[36m{}\x1b[0m', 'number': '\x1b[34m\x1b[1m{}\x1b[0m', 'operator': '\x1b[35m\x1b[1m{}\x1b[0m', 'punctuation': '\x1b[1m{}\x1b[0m', 'constant': '\x1b[36m\x1b[1m{}\x1b[0m', 'identifier': '\x1b[1m{}\x1b[0m', 'other': '{}'}
diff --git a/loguru/_colorama.py b/loguru/_colorama.py
index ef7df8a..37d7715 100644
--- a/loguru/_colorama.py
+++ b/loguru/_colorama.py
@@ -1,2 +1,23 @@
 import os
-import sys
\ No newline at end of file
+import sys
+
+def should_colorize(stream):
+    try:
+        return stream.isatty()
+    except Exception:
+        return False
+
+def should_wrap(stream):
+    if not should_colorize(stream):
+        return False
+
+    if 'PYCHARM_HOSTED' in os.environ:
+        return False
+
+    if sys.platform == 'win32':
+        return True
+
+    if 'TERM' in os.environ and os.environ['TERM'] == 'dumb':
+        return False
+
+    return True
\ No newline at end of file
diff --git a/loguru/_colorizer.py b/loguru/_colorizer.py
index 1f06ad9..7b032f8 100644
--- a/loguru/_colorizer.py
+++ b/loguru/_colorizer.py
@@ -1,6 +1,10 @@
 import re
 from string import Formatter

+def ansi_escape(codes):
+    pattern = '|'.join(re.escape(k) for k in sorted(codes, key=len, reverse=True))
+    return re.compile(f'({pattern})')
+
 class Style:
     RESET_ALL = 0
     BOLD = 1
@@ -64,9 +68,214 @@ class AnsiParser:
     _regex_tag = re.compile('\\\\?</?((?:[fb]g\\s)?[^<>\\s]*)>')

     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self._tokens = []
         self._tags = []
         self._color_tokens = []
+        self._text = []
+
+    def feed(self, text):
+        pos = 0
+        for match in self._regex_tag.finditer(text):
+            start, end = match.span()
+            if start > pos:
+                self._tokens.append((TokenType.TEXT, text[pos:start]))
+            if match.group()[0] == '\\':
+                self._tokens.append((TokenType.TEXT, match.group()[1:]))
+            else:
+                tag = match.group(1)
+                if tag.startswith('/'):
+                    if not self._tags:
+                        raise ValueError("Closing tag '%s' found without corresponding opening tag" % tag)
+                    expected_tag = self._tags.pop()
+                    if tag[1:] != expected_tag:
+                        raise ValueError("Closing tag '%s' does not match opening tag '%s'" % (tag, expected_tag))
+                    if expected_tag in ('red', 'green', 'blue', 'yellow', 'magenta', 'cyan', 'white', 'black'):
+                        tag = '/fg'
+                    elif expected_tag.startswith('fg '):
+                        tag = '/fg'
+                    elif expected_tag.startswith('bg '):
+                        tag = '/bg'
+                    self._tokens.append((TokenType.CLOSING, tag))
+                else:
+                    if tag in ('red', 'green', 'blue', 'yellow', 'magenta', 'cyan', 'white', 'black'):
+                        self._tags.append(tag)
+                        tag = 'fg ' + tag
+                    else:
+                        self._tags.append(tag)
+                    self._tokens.append((TokenType.ANSI, tag))
+            pos = end
+        if pos < len(text):
+            self._tokens.append((TokenType.TEXT, text[pos:]))
+        return self._tokens
+
+    def done(self, strict=True):
+        if strict and self._tags:
+            raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
+        tokens = self._tokens
+        self.reset()
+        return tokens
+
+    def strip(self, tokens):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+        return ''.join(result)
+
+    def colorize(self, tokens, style):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+            elif token_type == TokenType.ANSI:
+                if text.startswith('fg '):
+                    color = getattr(Fore, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text.startswith('bg '):
+                    color = getattr(Back, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text in ('red', 'green', 'blue', 'yellow', 'magenta', 'cyan', 'white', 'black'):
+                    color = getattr(Fore, text.upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                else:
+                    style_code = getattr(Style, text.upper(), None)
+                    if style_code is not None:
+                        result.append('\033[%sm' % style_code)
+            elif token_type == TokenType.CLOSING:
+                if text == '/fg':
+                    result.append('\033[%sm' % Fore.RESET)
+                elif text == '/bg':
+                    result.append('\033[%sm' % Back.RESET)
+                else:
+                    result.append('\033[%sm' % Style.RESET_ALL)
+        return ''.join(result)
+
+    def done(self, strict=True):
+        if strict and self._tags:
+            raise ValueError("Unclosed tags: %s" % ', '.join(self._tags))
+        tokens = self._tokens
+        self.reset()
+        return tokens
+
+    def strip(self, tokens):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+        return ''.join(result)
+
+    def colorize(self, tokens, style):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+            elif token_type == TokenType.ANSI:
+                if text.startswith('fg '):
+                    color = getattr(Fore, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text.startswith('bg '):
+                    color = getattr(Back, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text in ('red', 'green', 'blue', 'yellow', 'magenta', 'cyan', 'white', 'black'):
+                    color = getattr(Fore, text.upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                else:
+                    style_code = getattr(Style, text.upper(), None)
+                    if style_code is not None:
+                        result.append('\033[%sm' % style_code)
+            elif token_type == TokenType.CLOSING:
+                if text == '/fg':
+                    result.append('\033[%sm' % Fore.RESET)
+                elif text == '/bg':
+                    result.append('\033[%sm' % Back.RESET)
+                else:
+                    result.append('\033[%sm' % Style.RESET_ALL)
+        return ''.join(result)
+
+    def strip(self, tokens):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+        return ''.join(result)
+
+    def colorize(self, tokens, style):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+            elif token_type == TokenType.ANSI:
+                if text.startswith('fg '):
+                    color = getattr(Fore, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text.startswith('bg '):
+                    color = getattr(Back, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text in ('red', 'green', 'blue', 'yellow', 'magenta', 'cyan', 'white', 'black'):
+                    color = getattr(Fore, text.upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                else:
+                    style_code = getattr(Style, text.upper(), None)
+                    if style_code is not None:
+                        result.append('\033[%sm' % style_code)
+            elif token_type == TokenType.CLOSING:
+                if text == '/fg':
+                    result.append('\033[%sm' % Fore.RESET)
+                elif text == '/bg':
+                    result.append('\033[%sm' % Back.RESET)
+                else:
+                    result.append('\033[%sm' % Style.RESET_ALL)
+        return ''.join(result)
+
+    def strip(self, tokens):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+        return ''.join(result)
+
+    def colorize(self, tokens, style):
+        result = []
+        for token_type, text in tokens:
+            if token_type == TokenType.TEXT:
+                result.append(text)
+            elif token_type == TokenType.ANSI:
+                if text.startswith('fg '):
+                    color = getattr(Fore, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text.startswith('bg '):
+                    color = getattr(Back, text[3:].upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                elif text in ('red', 'green', 'blue', 'yellow', 'magenta', 'cyan', 'white', 'black'):
+                    color = getattr(Fore, text.upper(), None)
+                    if color is not None:
+                        result.append('\033[%sm' % color)
+                else:
+                    style_code = getattr(Style, text.upper(), None)
+                    if style_code is not None:
+                        result.append('\033[%sm' % style_code)
+            elif token_type == TokenType.CLOSING:
+                if text == '/fg':
+                    result.append('\033[%sm' % Fore.RESET)
+                elif text == '/bg':
+                    result.append('\033[%sm' % Back.RESET)
+                else:
+                    result.append('\033[%sm' % Style.RESET_ALL)
+        return ''.join(result)

 class ColoringMessage(str):
     __fields__ = ('_messages',)
@@ -87,4 +296,33 @@ class ColoredFormat:
         self._messages_color_tokens = messages_color_tokens

 class Colorizer:
-    pass
\ No newline at end of file
+    @staticmethod
+    def ansify(code):
+        if not code:
+            return ''
+        codes = []
+        for part in code.split():
+            if part.startswith('<') and part.endswith('>'):
+                part = part[1:-1]
+                if part.startswith('/'):
+                    part = part[1:]
+                    if part == 'fg':
+                        codes.append(str(Fore.RESET))
+                    elif part == 'bg':
+                        codes.append(str(Back.RESET))
+                    else:
+                        codes.append(str(Style.RESET_ALL))
+                else:
+                    if part.startswith('fg '):
+                        color = getattr(Fore, part[3:].upper(), None)
+                        if color is not None:
+                            codes.append(str(color))
+                    elif part.startswith('bg '):
+                        color = getattr(Back, part[3:].upper(), None)
+                        if color is not None:
+                            codes.append(str(color))
+                    else:
+                        style = getattr(Style, part.upper(), None)
+                        if style is not None:
+                            codes.append(str(style))
+        return '\033[' + ';'.join(codes) + 'm' if codes else ''
\ No newline at end of file
diff --git a/loguru/_contextvars.py b/loguru/_contextvars.py
index d7c9ac5..9186647 100644
--- a/loguru/_contextvars.py
+++ b/loguru/_contextvars.py
@@ -1,2 +1,28 @@
 import sys
+
+def load_contextvar_class():
+    if sys.version_info >= (3, 7):
+        from contextvars import ContextVar
+        return ContextVar
+    else:
+        try:
+            from aiocontextvars import ContextVar
+            return ContextVar
+        except ImportError:
+            class ContextVar:
+                def __init__(self, name, *, default=None):
+                    self._name = name
+                    self._default = default
+                    self._value = default
+
+                def get(self, default=None):
+                    return self._value if self._value is not None else default
+
+                def set(self, value):
+                    old_value = self._value
+                    self._value = value
+                    return old_value
+
+            return ContextVar
+
 ContextVar = load_contextvar_class()
\ No newline at end of file
diff --git a/loguru/_ctime_functions.py b/loguru/_ctime_functions.py
index 3cf79c2..13f1e4b 100644
--- a/loguru/_ctime_functions.py
+++ b/loguru/_ctime_functions.py
@@ -1,2 +1,29 @@
 import os
+import sys
+import platform
+
+def load_ctime_functions():
+    if platform.system() == 'Windows':
+        try:
+            from win32_setctime import setctime
+            def get_ctime(filepath):
+                return os.path.getctime(filepath)
+            def set_ctime(filepath, timestamp):
+                setctime(filepath, timestamp)
+            return get_ctime, set_ctime
+        except ImportError:
+            pass
+
+    def get_ctime(filepath):
+        try:
+            stat = os.stat(filepath)
+            return stat.st_birthtime  # macOS
+        except AttributeError:
+            return stat.st_mtime  # Linux and others
+
+    def set_ctime(filepath, timestamp):
+        os.utime(filepath, (timestamp, os.path.getmtime(filepath)))
+
+    return get_ctime, set_ctime
+
 get_ctime, set_ctime = load_ctime_functions()
\ No newline at end of file
diff --git a/loguru/_datetime.py b/loguru/_datetime.py
index 63d729a..f55149d 100644
--- a/loguru/_datetime.py
+++ b/loguru/_datetime.py
@@ -3,6 +3,15 @@ from calendar import day_abbr, day_name, month_abbr, month_name
 from datetime import datetime as datetime_
 from datetime import timedelta, timezone
 from time import localtime, strftime
+
+def aware_now():
+    now = datetime_.now()
+    if now.tzinfo is None:
+        try:
+            now = now.astimezone()  # Use system timezone
+        except ValueError:  # If system timezone is not set
+            now = now.replace(tzinfo=timezone.utc)
+    return now
 tokens = 'H{1,2}|h{1,2}|m{1,2}|s{1,2}|S+|YYYY|YY|M{1,4}|D{1,4}|Z{1,2}|zz|A|X|x|E|Q|dddd|ddd|d'
 pattern = re.compile('(?:{0})|\\[(?:{0}|!UTC|)\\]'.format(tokens))

diff --git a/loguru/_defaults.py b/loguru/_defaults.py
index cd2e326..35f9517 100644
--- a/loguru/_defaults.py
+++ b/loguru/_defaults.py
@@ -1,4 +1,13 @@
 from os import environ
+
+def env(key, type_, default):
+    if key not in environ:
+        return default
+    value = environ[key]
+    if type_ == bool:
+        return value.lower() in ('true', '1', 'yes', 'on')
+    return type_(value)
+
 LOGURU_AUTOINIT = env('LOGURU_AUTOINIT', bool, True)
 LOGURU_FORMAT = env('LOGURU_FORMAT', str, '<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>')
 LOGURU_FILTER = env('LOGURU_FILTER', str, None)
diff --git a/loguru/_get_frame.py b/loguru/_get_frame.py
index c6e9c4b..062e2a8 100644
--- a/loguru/_get_frame.py
+++ b/loguru/_get_frame.py
@@ -1,3 +1,19 @@
 import sys
 from sys import exc_info
+
+def load_get_frame_function():
+    if hasattr(sys, '_getframe'):
+        def get_frame(depth):
+            return sys._getframe(depth)
+    else:
+        def get_frame(depth):
+            try:
+                raise Exception
+            except Exception:
+                frame = exc_info()[2].tb_frame
+                for _ in range(depth):
+                    frame = frame.f_back
+                return frame
+    return get_frame
+
 get_frame = load_get_frame_function()
\ No newline at end of file
diff --git a/loguru/_locks_machinery.py b/loguru/_locks_machinery.py
index 883c097..fd60595 100644
--- a/loguru/_locks_machinery.py
+++ b/loguru/_locks_machinery.py
@@ -1,8 +1,31 @@
 import os
 import threading
 import weakref
-if not hasattr(os, 'register_at_fork'):
-else:
-    logger_locks = weakref.WeakSet()
-    handler_locks = weakref.WeakSet()
+
+logger_locks = weakref.WeakSet()
+handler_locks = weakref.WeakSet()
+
+def acquire_locks():
+    for lock in logger_locks:
+        lock.acquire()
+    for lock in handler_locks:
+        lock.acquire()
+
+def release_locks():
+    for lock in reversed(list(handler_locks)):
+        lock.release()
+    for lock in reversed(list(logger_locks)):
+        lock.release()
+
+def create_logger_lock():
+    lock = threading.Lock()
+    logger_locks.add(lock)
+    return lock
+
+def create_handler_lock():
+    lock = threading.Lock()
+    handler_locks.add(lock)
+    return lock
+
+if hasattr(os, 'register_at_fork'):
     os.register_at_fork(before=acquire_locks, after_in_parent=release_locks, after_in_child=release_locks)
\ No newline at end of file