See the discussion on #2174. An uncaught C++ error on main causes an error like:
```
TypeError: Cannot create property 'pyodide_fatal_error' on number '28811048'
```
With this the same error looks like:
```
Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
The cause of the fatal error was:
CppException: Unable to cast Python instance to C++ type (compile in debug mode for details)
```
Support for C++ exceptions in packages. See the discussion on #2174. An uncaught C++ error on main causes an error like:
```
TypeError: Cannot create property 'pyodide_fatal_error' on number '28811048'
```
With this the same error looks like:
```
Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
The cause of the fatal error was:
CppException: Unable to cast Python instance to C++ type (compile in debug mode for details)
```
def test_pytest(selenium):
    # TODO: don't use numpy in this test as it's not necessairly installed.
    selenium.load_package(["pytest", "numpy", "nose"])

    selenium.run(
        """
        from pathlib import Path
        import os
        import numpy
        import pytest

        base_dir = Path(numpy.__file__).parent / "core" / "tests"
        """
    )

    selenium.run("pytest.main([str(base_dir / 'test_api.py')])")

    logs = "\n".join(selenium.logs)
    assert "INTERNALERROR" not in logs

def test_pytest(selenium):
    # TODO: don't use numpy in this test as it's not necessairly installed.
    selenium.load_package(["pytest", "numpy", "nose"])

    selenium.run(
        """
        from pathlib import Path
        import os
        import numpy
        import pytest

        base_dir = Path(numpy.__file__).parent / "core" / "tests"
        """
    )

    selenium.run("pytest.main([str(base_dir / 'test_api.py')])")

    logs = "\n".join(selenium.logs)
    assert "INTERNALERROR" not in logs
