Skip to content

Logger issue when running test_sim by itself #328

@ebrahimebrahim

Description

@ebrahimebrahim

When running pytest -k test_sim rather than just pytest, we get a logging related error

def getMessage(self):
        """
        Return the message for this LogRecord.
    
        Return the message for this LogRecord after merging any user-supplied
        arguments with the message.
        """
        msg = str(self.msg)
        if self.args:
>           msg = msg % self.args
E           TypeError: not all arguments converted during string formatting

msg        = '  reference sound speed: '
self       = <LogRecord: root, 20, /home/ebrahim/openwater/.venv3.11/lib/python3.11/site-packages/kwave/kWaveSimulation_helper/set_sound_speed_ref.py, 89, "  reference sound speed: ">

/usr/local/lib/python3.11/logging/__init__.py:377: TypeError

This is a k-wave bug that was solved in waltsims/k-wave-python#458, however sicne k-wave dropped python3.9 support before they fixed this bug we cannot upgrade just yet (see #167).

We don't see the issue in the CI because when all tests are run at once the logging handlers are probably set to some kind of null handler.

We can wait until the constraint #167 is relaxed and this will be fixed. Or we can fix it right away by silencing logs in an appropriate way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions