Skip to content

Clean-up try-except-pass patterns #2553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

PProfizi
Copy link
Contributor

No description provided.

@PProfizi PProfizi self-assigned this Aug 20, 2025
@PProfizi PProfizi requested a review from a team as a code owner August 20, 2025 13:44
Copy link

codecov bot commented Aug 20, 2025

❌ 406 Tests Failed:

Tests completed Failed Passed Skipped
26227 406 25821 3545
View the top 3 failed test(s) by shortest run time
tests\test_python_plugins.py::test_python_plugins::test_lists[ansys-grpc-dpf]
Stack Traces | 0.028s run time
sLibraryKey = 'py_test_types'
sDllPath = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles\\pythonPlugins\\all_types'
sloader_symbol = 'load_operators'
client = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x0000015474AF4A60>

    @staticmethod
    def data_processing_load_library_on_client(sLibraryKey, sDllPath, sloader_symbol, client):
        from ansys.grpc.dpf import base_pb2
        request = base_pb2.PluginRequest()
        request.name = sLibraryKey
        request.dllPath = sDllPath
        request.symbol = sloader_symbol
        try:
>           _get_stub(client).Load(request)

.tox\test-api\lib\site-packages\ansys\dpf\gate\data_processing_grpcapi.py:178: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-api\lib\site-packages\grpc\_channel.py:1178: in __call__
    return _end_unary_response_blocking(state, call, False, None)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

state = <grpc._channel._RPCState object at 0x0000015479032020>
call = <grpc._cython.cygrpc.SegregatedCall object at 0x000001547087E680>
with_call = False, deadline = None

    def _end_unary_response_blocking(
        state: _RPCState,
        call: cygrpc.SegregatedCall,
        with_call: bool,
        deadline: Optional[float],
    ) -> Union[ResponseType, Tuple[ResponseType, grpc.Call]]:
        if state.code is grpc.StatusCode.OK:
            if with_call:
                rendezvous = _MultiThreadedRendezvous(state, call, None, deadline)
                return state.response, rendezvous
            else:
                return state.response
        else:
>           raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
E           grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E           	status = StatusCode.INTERNAL
E           	details = "error code 4:DPF error - runtime error: PythonPluginWrapper<class 'FileNotFoundError'>; Failed to load Python module: <class 'FileNotFoundError'>: FileNotFoundError(2, 'The system cannot find the path specified')"
E           	debug_error_string = "UNKNOWN:Error received from peer  {grpc_status:13, grpc_message:"error code 4:DPF error - runtime error: PythonPluginWrapper<class \'FileNotFoundError\'>; Failed to load Python module: <class \'FileNotFoundError\'>: FileNotFoundError(2, \'The system cannot find the path specified\')"}"
E           >

.tox\test-api\lib\site-packages\grpc\_channel.py:1006: _InactiveRpcError

During handling of the above exception, another exception occurred:

server_type_remote_process = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x0000015474AF4A60>
testfiles_dir = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles'

    def test_lists(server_type_remote_process, testfiles_dir):
>       load_all_types_plugin_with_serv(server_type_remote_process, testfiles_dir)

tests\test_python_plugins.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_python_plugins.py:71: in load_all_types_plugin_with_serv
    return dpf.load_library(
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:95: in load_library
    base.load_library(filename, name, symbol, generate_operators)
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:417: in load_library
    self._internal_obj = self._api.data_processing_load_library_on_client(
.tox\test-api\lib\site-packages\ansys\dpf\gate\errors.py:38: in wrapper
    out = func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

sLibraryKey = 'py_test_types'
sDllPath = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles\\pythonPlugins\\all_types'
sloader_symbol = 'load_operators'
client = <ansys.dpf.core.server_types.LegacyGrpcServer object at 0x0000015474AF4A60>

    @staticmethod
    def data_processing_load_library_on_client(sLibraryKey, sDllPath, sloader_symbol, client):
        from ansys.grpc.dpf import base_pb2
        request = base_pb2.PluginRequest()
        request.name = sLibraryKey
        request.dllPath = sDllPath
        request.symbol = sloader_symbol
        try:
            _get_stub(client).Load(request)
        except Exception as e:
>           raise errors.DPFServerException(
                f'Unable to load library "{sDllPath}". File may not exist or'
                f" is missing dependencies:\n{str(e)}"
            )
E           ansys.dpf.gate.errors.DPFServerException: Unable to load library "D:\a\pydpf-core\pydpf-core\tests\testfiles\pythonPlugins\all_types". File may not exist or is missing dependencies:
E           <_InactiveRpcError of RPC that terminated with:
E           	status = StatusCode.INTERNAL
E           	details = "error code 4:DPF error - runtime error: PythonPluginWrapper<class 'FileNotFoundError'>; Failed to load Python module: <class 'FileNotFoundError'>: FileNotFoundError(2, 'The system cannot find the path specified')"
E           	debug_error_string = "UNKNOWN:Error received from peer  {grpc_status:13, grpc_message:"error code 4:DPF error - runtime error: PythonPluginWrapper<class \'FileNotFoundError\'>; Failed to load Python module: <class \'FileNotFoundError\'>: FileNotFoundError(2, \'The system cannot find the path specified\')"}"
E           >

.tox\test-api\lib\site-packages\ansys\dpf\gate\data_processing_grpcapi.py:180: DPFServerException
tests\test_python_plugins.py::test_python_plugins::test_lists[gRPC CLayer]
Stack Traces | 0.028s run time
server_type_remote_process = <ansys.dpf.core.server_types.GrpcServer object at 0x0000025C82B494B0>
testfiles_dir = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles'

    def test_lists(server_type_remote_process, testfiles_dir):
>       load_all_types_plugin_with_serv(server_type_remote_process, testfiles_dir)

tests\test_python_plugins.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_python_plugins.py:71: in load_all_types_plugin_with_serv
    return dpf.load_library(
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:95: in load_library
    base.load_library(filename, name, symbol, generate_operators)
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:417: in load_library
    self._internal_obj = self._api.data_processing_load_library_on_client(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

sLibraryKey = 'py_test_types'
sDllPath = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles\\pythonPlugins\\all_types'
sloader_symbol = 'load_operators'
client = <ansys.dpf.core.server_types.GrpcClient object at 0x0000025C8652A650>

    @staticmethod
    def data_processing_load_library_on_client(sLibraryKey, sDllPath, sloader_symbol, client):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.DataProcessing_load_library_on_client(utils.to_char_ptr(sLibraryKey), utils.to_char_ptr(sDllPath), utils.to_char_ptr(sloader_symbol), client._internal_obj if client is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
    	if errorSize.value != 0:
>   		raise errors.DPFServerException(sError.value)
E     ansys.dpf.gate.errors.DPFServerException: a 'data processing core error' error occurred: error code 4:DPF error - runtime error: PythonPluginWrapper<class 'FileNotFoundError'>; Failed to load Python module: <class 'FileNotFoundError'>: FileNotFoundError(2, 'The system cannot find the path specified')

.tox\test-api\lib\site-packages\ansys\dpf\gate\generated\data_processing_capi.py:389: DPFServerException
tests\test_python_plugins.py::test_python_plugins::test_lists[gRPC CLayer]
Stack Traces | 0.028s run time
server_type_remote_process = <ansys.dpf.core.server_types.GrpcServer object at 0x0000024E98DFA3E0>
testfiles_dir = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles'

    def test_lists(server_type_remote_process, testfiles_dir):
>       load_all_types_plugin_with_serv(server_type_remote_process, testfiles_dir)

tests\test_python_plugins.py:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_python_plugins.py:71: in load_all_types_plugin_with_serv
    return dpf.load_library(
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:95: in load_library
    base.load_library(filename, name, symbol, generate_operators)
.tox\test-api\lib\site-packages\ansys\dpf\core\core.py:417: in load_library
    self._internal_obj = self._api.data_processing_load_library_on_client(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

sLibraryKey = 'py_test_types'
sDllPath = 'D:\\a\\pydpf-core\\pydpf-core\\tests\\testfiles\\pythonPlugins\\all_types'
sloader_symbol = 'load_operators'
client = <ansys.dpf.core.server_types.GrpcClient object at 0x0000024E96EA0A00>

    @staticmethod
    def data_processing_load_library_on_client(sLibraryKey, sDllPath, sloader_symbol, client):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.DataProcessing_load_library_on_client(utils.to_char_ptr(sLibraryKey), utils.to_char_ptr(sDllPath), utils.to_char_ptr(sloader_symbol), client._internal_obj if client is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
    	if errorSize.value != 0:
>   		raise errors.DPFServerException(sError.value)
E     ansys.dpf.gate.errors.DPFServerException: a 'data processing core error' error occurred: error code 4:DPF error - runtime error: PythonPluginWrapper<class 'FileNotFoundError'>; Failed to load Python module: <class 'FileNotFoundError'>: FileNotFoundError(2, 'The system cannot find the path specified')

.tox\test-api\lib\site-packages\ansys\dpf\gate\generated\data_processing_capi.py:389: DPFServerException

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link
Contributor

github-actions bot commented Aug 21, 2025

Some tests with 'continue-on-error: true' have failed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant