Skip to content

Commit

Permalink
update log tests with fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
dipinknair committed Nov 13, 2024
1 parent 4804992 commit d795efd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
4 changes: 2 additions & 2 deletions tests/embedding/test_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def _run_background_app_test(


@pytest.mark.embedding_scripts
def test_background_app_multiple_instances(rootdir, run_subprocess, pytestconfig):
def test_background_app_multiple_instances(rootdir, run_subprocess, pytestconfig, pass_expected):
"""Multiple instances of background app can be used."""
stderr = _run_background_app_test(
run_subprocess, rootdir, pytestconfig, "multiple_instances", True
run_subprocess, rootdir, pytestconfig, "multiple_instances", pass_expected
)
assert "Project 1" in stderr
assert "Project 2" in stderr
Expand Down
81 changes: 41 additions & 40 deletions tests/embedding/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,23 @@ def _unset_var(env, var) -> None:
return env


def _run_embedding_log_test_process(
rootdir: str, run_subprocess, pytestconfig, testname: str, pass_expected: bool = None
def _run_embedding_log_test(
run_subprocess, rootdir: str, pytestconfig, testname: str, pass_expected: bool
) -> typing.Tuple[bytes, bytes]:
"""Runs the process and returns it after it finishes"""
version = pytestconfig.getoption("ansys_version")

embedded_py = os.path.join(rootdir, "tests", "scripts", "embedding_log_test.py")
process, stdout, stderr = run_subprocess(
[sys.executable, embedded_py, version, testname],
_get_env_without_logging_variables(),
pass_expected,
)
return stdout, stderr

stdout = stdout.decode()
stderr = stderr.decode()
_assert_success(stdout, pass_expected)
return stderr


def _assert_success(stdout: str, pass_expected: bool) -> int:
Expand All @@ -74,31 +79,6 @@ def _assert_success(stdout: str, pass_expected: bool) -> int:
assert "@@success@@" not in stdout

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.12

test_logger.test_logging_write_info_after_initialize_with_error_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f5d533194e0>
pytestconfig = <_pytest.config.Config object at 0x7f5d55677f20>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_write_info_after_initialize_with_error_level(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test that no output is written when an info is logged when configured at the error level."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            "log_info_after_initialize_with_error_level",
            pass_expected,
        )

tests/embedding/test_logger.py:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.12

test_logger.test_addin_configuration[Mechanical]

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f5d5331ad40>
pytestconfig = <_pytest.config.Config object at 0x7f5d55677f20>
addin_configuration = 'Mechanical', pass_expected = False

    @pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
    @pytest.mark.embedding_scripts
    @pytest.mark.minimum_version(241)
    def test_addin_configuration(
        rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
    ):
        """Test that mechanical can start with both the Mechanical and WorkBench configuration."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            f"log_configuration_{addin_configuration}",
            pass_expected,
        )

tests/embedding/test_logger.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.12

test_logger.test_addin_configuration[WorkBench]

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f5d5331b2e0>
pytestconfig = <_pytest.config.Config object at 0x7f5d55677f20>
addin_configuration = 'WorkBench', pass_expected = False

    @pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
    @pytest.mark.embedding_scripts
    @pytest.mark.minimum_version(241)
    def test_addin_configuration(
        rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
    ):
        """Test that mechanical can start with both the Mechanical and WorkBench configuration."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            f"log_configuration_{addin_configuration}",
            pass_expected,
        )

tests/embedding/test_logger.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.12

test_logger.test_logging_write_error_after_initialize_with_info_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f5d5331bb00>
pytestconfig = <_pytest.config.Config object at 0x7f5d55677f20>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_write_error_after_initialize_with_info_level(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test that output is written when an error is logged when configured at the info level."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            "log_error_after_initialize_with_info_level",
            pass_expected,
        )

tests/embedding/test_logger.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.12

test_logger.test_logging_level_before_and_after_initialization

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f5d53138040>
pytestconfig = <_pytest.config.Config object at 0x7f5d55677f20>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_level_before_and_after_initialization(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test logging level API  before and after initialization."""
>       stderr = _run_embedding_log_test(
            run_subprocess, rootdir, pytestconfig, "log_check_can_log_message", pass_expected
        )

tests/embedding/test_logger.py:143: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.12

test_logger.test_logging_all_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f5d53138680>
pytestconfig = <_pytest.config.Config object at 0x7f5d55677f20>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_all_level(rootdir, run_subprocess, pytestconfig, pass_expected):
        """Test all logging level after initialization."""
>       stderr = _run_embedding_log_test(
            run_subprocess, rootdir, pytestconfig, "log_check_all_log_level", pass_expected
        )

tests/embedding/test_logger.py:151: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.11

test_logger.test_logging_write_info_after_initialize_with_error_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7fa9f258c4a0>
pytestconfig = <_pytest.config.Config object at 0x7fa9f4926690>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_write_info_after_initialize_with_error_level(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test that no output is written when an info is logged when configured at the error level."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            "log_info_after_initialize_with_error_level",
            pass_expected,
        )

tests/embedding/test_logger.py:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.11

test_logger.test_addin_configuration[Mechanical]

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7fa9f258cc20>
pytestconfig = <_pytest.config.Config object at 0x7fa9f4926690>
addin_configuration = 'Mechanical', pass_expected = False

    @pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
    @pytest.mark.embedding_scripts
    @pytest.mark.minimum_version(241)
    def test_addin_configuration(
        rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
    ):
        """Test that mechanical can start with both the Mechanical and WorkBench configuration."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            f"log_configuration_{addin_configuration}",
            pass_expected,
        )

tests/embedding/test_logger.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.11

test_logger.test_addin_configuration[WorkBench]

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7fa9f258c180>
pytestconfig = <_pytest.config.Config object at 0x7fa9f4926690>
addin_configuration = 'WorkBench', pass_expected = False

    @pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
    @pytest.mark.embedding_scripts
    @pytest.mark.minimum_version(241)
    def test_addin_configuration(
        rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
    ):
        """Test that mechanical can start with both the Mechanical and WorkBench configuration."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            f"log_configuration_{addin_configuration}",
            pass_expected,
        )

tests/embedding/test_logger.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.11

test_logger.test_logging_write_error_after_initialize_with_info_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7fa9f258d440>
pytestconfig = <_pytest.config.Config object at 0x7fa9f4926690>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_write_error_after_initialize_with_info_level(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test that output is written when an error is logged when configured at the info level."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            "log_error_after_initialize_with_info_level",
            pass_expected,
        )

tests/embedding/test_logger.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.11

test_logger.test_logging_level_before_and_after_initialization

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7fa9f258db20>
pytestconfig = <_pytest.config.Config object at 0x7fa9f4926690>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_level_before_and_after_initialization(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test logging level API  before and after initialization."""
>       stderr = _run_embedding_log_test(
            run_subprocess, rootdir, pytestconfig, "log_check_can_log_message", pass_expected
        )

tests/embedding/test_logger.py:143: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.11

test_logger.test_logging_all_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7fa9f258e0c0>
pytestconfig = <_pytest.config.Config object at 0x7fa9f4926690>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_all_level(rootdir, run_subprocess, pytestconfig, pass_expected):
        """Test all logging level after initialization."""
>       stderr = _run_embedding_log_test(
            run_subprocess, rootdir, pytestconfig, "log_check_all_log_level", pass_expected
        )

tests/embedding/test_logger.py:151: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.10

test_logger.test_logging_write_info_after_initialize_with_error_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f08acf1d000>
pytestconfig = <_pytest.config.Config object at 0x7f08af2e70a0>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_write_info_after_initialize_with_error_level(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test that no output is written when an info is logged when configured at the error level."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            "log_info_after_initialize_with_error_level",
            pass_expected,
        )

tests/embedding/test_logger.py:96: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.10

test_logger.test_addin_configuration[Mechanical]

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f08acf1d090>
pytestconfig = <_pytest.config.Config object at 0x7f08af2e70a0>
addin_configuration = 'Mechanical', pass_expected = False

    @pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
    @pytest.mark.embedding_scripts
    @pytest.mark.minimum_version(241)
    def test_addin_configuration(
        rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
    ):
        """Test that mechanical can start with both the Mechanical and WorkBench configuration."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            f"log_configuration_{addin_configuration}",
            pass_expected,
        )

tests/embedding/test_logger.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.10

test_logger.test_addin_configuration[WorkBench]

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f08acf1d2d0>
pytestconfig = <_pytest.config.Config object at 0x7f08af2e70a0>
addin_configuration = 'WorkBench', pass_expected = False

    @pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
    @pytest.mark.embedding_scripts
    @pytest.mark.minimum_version(241)
    def test_addin_configuration(
        rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
    ):
        """Test that mechanical can start with both the Mechanical and WorkBench configuration."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            f"log_configuration_{addin_configuration}",
            pass_expected,
        )

tests/embedding/test_logger.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.10

test_logger.test_logging_write_error_after_initialize_with_info_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f08acf1dc60>
pytestconfig = <_pytest.config.Config object at 0x7f08af2e70a0>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_write_error_after_initialize_with_info_level(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test that output is written when an error is logged when configured at the info level."""
>       stderr = _run_embedding_log_test(
            run_subprocess,
            rootdir,
            pytestconfig,
            "log_error_after_initialize_with_info_level",
            pass_expected,
        )

tests/embedding/test_logger.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.10

test_logger.test_logging_level_before_and_after_initialization

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f08acf1ce50>
pytestconfig = <_pytest.config.Config object at 0x7f08af2e70a0>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_level_before_and_after_initialization(
        rootdir, run_subprocess, pytestconfig, pass_expected
    ):
        """Test logging level API  before and after initialization."""
>       stderr = _run_embedding_log_test(
            run_subprocess, rootdir, pytestconfig, "log_check_can_log_message", pass_expected
        )

tests/embedding/test_logger.py:143: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError

Check failure on line 79 in tests/embedding/test_logger.py

View workflow job for this annotation

GitHub Actions / Test Report 3.10

test_logger.test_logging_all_level

AssertionError: assert '@@success@@' not in '@@success@@\n' '@@success@@' is contained here: Strings contain only whitespace, escaping them using repr() '@@success@@\n'
Raw output
rootdir = PosixPath('/__w/pymechanical/pymechanical')
run_subprocess = <function run_subprocess.<locals>.func at 0x7f08acf1dcf0>
pytestconfig = <_pytest.config.Config object at 0x7f08af2e70a0>
pass_expected = False

    @pytest.mark.embedding_scripts
    def test_logging_all_level(rootdir, run_subprocess, pytestconfig, pass_expected):
        """Test all logging level after initialization."""
>       stderr = _run_embedding_log_test(
            run_subprocess, rootdir, pytestconfig, "log_check_all_log_level", pass_expected
        )

tests/embedding/test_logger.py:151: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/embedding/test_logger.py:63: in _run_embedding_log_test
    _assert_success(stdout, pass_expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

stdout = '@@success@@\n', pass_expected = False

    def _assert_success(stdout: str, pass_expected: bool) -> int:
        """Asserts the outcome of the process matches pass_expected"""
    
        # HACK! On linux, due to bug #85, there is always a crash on shutdown
        # so instead there's a print("success") that happens after the test
        # function runs that will only be executed if the function doesn't
        # throw. To check for the subprocess success, ensure that the stdout
        # has "@@success@@" (a value written there in the subprocess after the
        # test function runs)
        if pass_expected:
            assert "@@success@@" in stdout
        else:
>           assert "@@success@@" not in stdout
E           AssertionError: assert '@@success@@' not in '@@success@@\n'
E             
E             '@@success@@' is contained here:
E             Strings contain only whitespace, escaping them using repr()
E               '@@success@@\n'

tests/embedding/test_logger.py:79: AssertionError


def _run_embedding_log_test(
run_subprocess, rootdir: str, pytestconfig, testname: str, pass_expected: bool = True
) -> str:
"""Test stderr logging using a subprocess.
Also ensure that the subprocess either passes or fails based on pass_expected
Mechanical logging all goes into the process stderr at the C level, but capturing
that from python isn't possible because python's stderr stream isn't aware of content
that doesn't come from python (or its C/API)
Returns the stderr
"""
subprocess_pass_expected = pass_expected
version = pytestconfig.getoption("ansys_version")
if pass_expected == True and os.name != "nt" and int(version) < 251:
subprocess_pass_expected = False
stdout, stderr = _run_embedding_log_test_process(
rootdir, run_subprocess, pytestconfig, testname, subprocess_pass_expected
)
stdout = stdout.decode()
stderr = stderr.decode()
_assert_success(stdout, pass_expected)
return stderr


@pytest.mark.embedding_scripts
def test_logging_write_log_before_init(rootdir, run_subprocess, pytestconfig):
"""Test that an error is thrown when trying to log before initializing"""
Expand All @@ -110,43 +90,64 @@ def test_logging_write_log_before_init(rootdir, run_subprocess, pytestconfig):

@pytest.mark.embedding_scripts
def test_logging_write_info_after_initialize_with_error_level(
rootdir, run_subprocess, pytestconfig
rootdir, run_subprocess, pytestconfig, pass_expected
):
"""Test that no output is written when an info is logged when configured at the error level."""
stderr = _run_embedding_log_test(
run_subprocess, rootdir, pytestconfig, "log_info_after_initialize_with_error_level"
run_subprocess,
rootdir,
pytestconfig,
"log_info_after_initialize_with_error_level",
pass_expected,
)
assert "0xdeadbeef" not in stderr


@pytest.mark.parametrize("addin_configuration", ["Mechanical", "WorkBench"])
@pytest.mark.embedding_scripts
@pytest.mark.minimum_version(241)
def test_addin_configuration(rootdir, run_subprocess, pytestconfig, addin_configuration):
def test_addin_configuration(
rootdir, run_subprocess, pytestconfig, addin_configuration, pass_expected
):
"""Test that mechanical can start with both the Mechanical and WorkBench configuration."""
stderr = _run_embedding_log_test(
run_subprocess, rootdir, pytestconfig, f"log_configuration_{addin_configuration}"
run_subprocess,
rootdir,
pytestconfig,
f"log_configuration_{addin_configuration}",
pass_expected,
)
assert f"{addin_configuration} configuration!" in stderr


@pytest.mark.embedding_scripts
def test_logging_write_error_after_initialize_with_info_level(
rootdir, run_subprocess, pytestconfig
rootdir, run_subprocess, pytestconfig, pass_expected
):
"""Test that output is written when an error is logged when configured at the info level."""
stderr = _run_embedding_log_test(
run_subprocess, rootdir, pytestconfig, "log_error_after_initialize_with_info_level"
run_subprocess,
rootdir,
pytestconfig,
"log_error_after_initialize_with_info_level",
pass_expected,
)
assert "Will no one rid me of this turbulent priest?" in stderr


@pytest.mark.embedding_scripts
def test_logging_level_before_and_after_initialization(rootdir, run_subprocess, pytestconfig):
def test_logging_level_before_and_after_initialization(
rootdir, run_subprocess, pytestconfig, pass_expected
):
"""Test logging level API before and after initialization."""
stdout, stderr = _run_embedding_log_test_process(
rootdir, run_subprocess, pytestconfig, "log_check_can_log_message"
stderr = _run_embedding_log_test(
run_subprocess, rootdir, pytestconfig, "log_check_can_log_message", pass_expected
)


@pytest.mark.embedding_scripts
def test_logging_all_level(rootdir, run_subprocess, pytestconfig, pass_expected):
"""Test all logging level after initialization."""
stderr = _run_embedding_log_test(
run_subprocess, rootdir, pytestconfig, "log_check_all_log_level", pass_expected
)
stdout = stdout.decode()
stderr = stderr.decode()
_assert_success(stdout, True)

0 comments on commit d795efd

Please sign in to comment.