diff --git a/lbmpy_tests/test_fluctuating_lb.py b/lbmpy_tests/test_fluctuating_lb.py index 79e9d0ea7e999c00e119d50b4225b626f8e8112f..d156e24efaf783e6effca48064b217b546348967 100644 --- a/lbmpy_tests/test_fluctuating_lb.py +++ b/lbmpy_tests/test_fluctuating_lb.py @@ -1,6 +1,15 @@ """Tests velocity and stress fluctuations for thermalized LB""" +import warnings +import pytest import pystencils as ps + +from pystencils import get_code_str +from pystencils.backends.simd_instruction_sets import get_supported_instruction_sets, get_vector_instruction_set +from pystencils.cpu.cpujit import get_compiler_config +from pystencils.enums import Target +from pystencils.rng import PhiloxTwoDoubles + from lbmpy.creationfunctions import * from lbmpy.forcemodels import Guo from lbmpy.macroscopic_value_kernels import macroscopic_values_setter @@ -8,13 +17,6 @@ import numpy as np from lbmpy.enums import Stencil from lbmpy.moments import is_bulk_moment, is_shear_moment, get_order from lbmpy.stencils import LBStencil -from pystencils.rng import PhiloxTwoDoubles - -import pytest -from pystencils import get_code_str -from pystencils.backends.simd_instruction_sets import get_supported_instruction_sets, get_vector_instruction_set -from pystencils.cpu.cpujit import get_compiler_config -from pystencils.enums import Target def _skip_instruction_sets_windows(instruction_sets): @@ -294,13 +296,11 @@ def test_vectorization(data_type, assume_aligned, assume_inner_stride_one, assum ) if not assume_inner_stride_one and 'storeS' not in get_vector_instruction_set(data_type, instruction_set): - with pytest.warns(UserWarning) as warn: + with pytest.warns(UserWarning) as pytest_warnings: ast = ps.create_kernel(collision, config=config) - assert 'Could not vectorize loop' in warn[0].message.args[0] + assert 'Could not vectorize loop' in pytest_warnings[0].message.args[0] else: - with pytest.warns(None) as warn: - ast = ps.create_kernel(collision, config=config) - assert len(warn) == 0 + ast = ps.create_kernel(collision, config=config) ast.compile() code = get_code_str(ast) print(code) diff --git a/lbmpy_tests/test_force.py b/lbmpy_tests/test_force.py index f0f59bb5490cb753d4f7b0e5efb70ec65c2b9caf..d0debdd224f13f5101ff9f5f86f4e777dc5dfdb8 100644 --- a/lbmpy_tests/test_force.py +++ b/lbmpy_tests/test_force.py @@ -24,7 +24,7 @@ force_models = [f for f in ForceModel if f is not ForceModel.CENTRALMOMENT] def test_total_momentum(method_enum, zero_centered, force_model, omega): if method_enum == Method.CUMULANT and \ force_model not in (ForceModel.SIMPLE, ForceModel.LUO, ForceModel.GUO, ForceModel.HE): - return True + return L = (16, 16) stencil = LBStencil(Stencil.D2Q9) @@ -308,7 +308,7 @@ def test_symmetric_forcing_equivalence(force_model, compressible): nested_moments=moment_polys, compressible=True, force_model=force_model, force=tuple(F)) method = create_lb_method(lbm_config=lbm_config) if not method.force_model.has_symmetric_central_moment_forcing: - return True + return subs_dict = method.subs_dict_relaxation_rate force_moments = method.force_model.central_moment_space_forcing(method)