Skip to content

Commit 47bf517

Browse files
committed
Remove rogue prints from tests, please use str() instead to test strings
1 parent 026ef8b commit 47bf517

13 files changed

+22
-22
lines changed

tests/test_cff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_cff_model(server_type, fluent_multi_species):
2222
)
2323
def test_results_cfx(cfx_heating_coil, server_type):
2424
model = dpf.Model(cfx_heating_coil(server=server_type), server=server_type)
25-
print(model)
25+
# print(model)
2626
result_names = [
2727
"specific_heat",
2828
"epsilon",
@@ -55,7 +55,7 @@ def test_results_cfx(cfx_heating_coil, server_type):
5555
)
5656
def test_results_fluent(fluent_mixing_elbow_steady_state, server_type):
5757
model = dpf.Model(fluent_mixing_elbow_steady_state(server=server_type), server=server_type)
58-
print(model)
58+
# print(model)
5959
result_names = [
6060
"epsilon",
6161
"enthalpy",

tests/test_codegeneration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def test_generated_operator_set_config():
286286
inpt2.unit = "m"
287287

288288
conf = op.math.add.default_config()
289-
print(conf)
289+
# print(conf)
290290
conf.set_work_by_index_option(True)
291291
op1 = op.math.add(config=conf)
292292
op1.inputs.fieldA.connect(inpt)

tests/test_custom_type_field.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_set_get_data_custom_type_field(server_type):
2727
data[i] = np.byte(b"2")
2828
field.data = data
2929
assert np.allclose(field.data, data)
30-
print(field.data)
30+
# print(field.data)
3131

3232

3333
@conftest.raises_for_servers_version_under("5.0")
@@ -96,7 +96,7 @@ def test_set_get_field_def_custom_type_field(server_type):
9696

9797
copy = field.field_definition
9898

99-
print(copy.dimensionality)
99+
# print(copy.dimensionality)
100100
assert copy.dimensionality == dpf.core.Dimensionality([3], dpf.core.natures.vector)
101101
assert copy.location == core.locations.elemental
102102
assert copy.name == "thing"

tests/test_elements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def test_no_element_descriptor():
136136
# descriptor = dpf.element_types.descriptor(89)
137137
# assert not descriptor
138138
descriptor = dpf.element_types.descriptor(dpf.element_types.General)
139-
print(descriptor)
139+
# print(descriptor)
140140
unknown_shape = "unknown_shape"
141141
assert descriptor.shape == unknown_shape
142142
assert dpf.element_types.descriptor(dpf.element_types.General).shape == unknown_shape

tests/test_factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def test_elemental_scoping():
271271

272272
def test_named_selection_scoping(model_with_ns):
273273
model = Model(model_with_ns)
274-
print(model.metadata.available_named_selections)
274+
# print(model.metadata.available_named_selections)
275275
scop = mesh_scoping_factory.named_selection_scoping("SELECTION", model)
276276
assert scop is not None
277277
assert len(scop.ids) != 0

tests/test_geometry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_create_points():
2828
points = rng.random((n_points, 3))
2929
points = create_points(points)
3030
points.plot()
31-
print(points)
31+
# print(points)
3232
assert points.dimension == 3
3333
assert len(points) == points.n_points == n_points
3434

@@ -57,7 +57,7 @@ def test_create_line_from_points(points_param):
5757
info += f"Starting point: {np.array(points[0])}\n"
5858
info += f"Ending point: {np.array(points[1])}\n"
5959
info += f"Line discretized with {line.n_points} points\n"
60-
assert print(line) == print(info)
60+
assert str(line) == str(info)
6161
assert line.length == np.linalg.norm(points)
6262
diff = np.array(points[1]) - np.array(points[0])
6363
assert all(line.direction) == all(diff / np.linalg.norm(diff))
@@ -297,7 +297,7 @@ def test_plane_discretization(component):
297297
info_discretization += f" Height (y-dir): {height}\n"
298298
info_discretization += f" Num cells x-dir: {n_cells_x}\n"
299299
info_discretization += f" Num cells y-dir: {n_cells_y}\n"
300-
assert print(plane) == print(info_discretization)
300+
assert str(plane) == str(info_discretization)
301301

302302

303303
plane_mapping_data = [

tests/test_launcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def test_launch_server_full_path(self, server_config):
184184
else:
185185
path = os.path.join(ansys_path, "aisol", "bin", "linx64")
186186

187-
print("trying to launch on ", path)
188-
print(os.listdir(path))
187+
# print("trying to launch on ", path)
188+
# print(os.listdir(path))
189189
server = core.start_local_server(as_global=False, ansys_path=path, config=server_config)
190190
assert "server_port" in server.info
191191

tests/test_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_connect_bool_operator(server_type):
9090

9191
def test_print_operator():
9292
op = dpf.core.Operator("S")
93-
print(op)
93+
assert str(op)
9494

9595

9696
def test_connect_get_out_all_types_operator(server_type):

tests/test_pathsupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_print_data_sources_path(allkindofcomplexity):
2727
path = Path(allkindofcomplexity)
2828
data_sources = dpf.core.DataSources()
2929
data_sources.set_result_file_path(path)
30-
print(data_sources)
30+
assert str(data_sources)
3131
assert data_sources.result_key == "rst"
3232
assert len(data_sources.result_files) == 1
3333
assert os.path.normpath(data_sources.result_files[0]) == os.path.normpath(allkindofcomplexity)

tests/test_propertyfield.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def test_print_property_field(server_type):
244244
scop = core.Scoping(ids=list_ids, location=locations.nodal, server=server_type)
245245
pfield.scoping = scop
246246
pfield.data = [1, 2, 4, 6, 7]
247-
print(pfield)
247+
# print(pfield)
248248
assert "Property Field" in str(pfield)
249249
assert "5" in str(pfield)
250250
assert "Nodal" in str(pfield)

0 commit comments

Comments
 (0)