Skip to content

Commit dd50ed0

Browse files
committed
Fix QA
1 parent a5d77e9 commit dd50ed0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/ansys/dpf/gate/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, msg=""):
2020
if not hasattr(self, "__notes__"): #if the system is python < 3.11 we custom our own notes property
2121
self.__notes__ = []
2222
self.__notes__.append(error_note)
23-
23+
2424

2525
class DPFServerNullObject(Exception):
2626
"""Error raised when the DPF server cannot find an object."""

tests/test_server_errors.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,32 @@
2121
# SOFTWARE.
2222

2323
import pytest
24-
import sys
24+
2525
import ansys.dpf.core as dpf
2626
from ansys.dpf.core import errors, operators as ops
2727

28+
2829
def test_server_exception_from_operator():
2930
ds = dpf.DataSources(r"dummy/file.rst")
3031
op = ops.result.displacement(data_sources=ds)
3132
with pytest.raises(errors.DPFServerException) as exception_note:
3233
op.eval()
33-
34+
3435
exception = exception_note.value
35-
assert hasattr(exception, '__notes__'), "The exception does not contain any note"
36+
assert hasattr(exception, "__notes__"), "The exception does not contain any note"
3637
assert exception.__notes__
3738

39+
3840
def test_server_exception_from_workflow():
3941
op = dpf.operators.result.displacement(data_sources=dpf.DataSources("toto.rst"))
40-
42+
4143
wf = dpf.Workflow()
4244
wf.add_operator(op)
4345
wf.set_output_name("out", op.outputs.fields_container)
44-
46+
4547
with pytest.raises(errors.DPFServerException) as exception_note:
4648
wf.get_output("out", output_type=dpf.FieldsContainer)
4749

4850
exception = exception_note.value
49-
assert hasattr(exception, '__notes__'), "The exception does not contain any note"
51+
assert hasattr(exception, "__notes__"), "The exception does not contain any note"
5052
assert exception.__notes__

0 commit comments

Comments
 (0)