Skip to content

Commit 6829ada

Browse files
committed
pre-commit & explicit failure of pytest
1 parent 5141966 commit 6829ada

9 files changed

+16
-5
lines changed

pixi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ ninja = "1.13.*"
7171
hdf5 = { version = "*", build = "* mpi_openmpi*" }
7272
fftw = { version = "*", build = "* mpi_openmpi*" } # works
7373
openmpi-mpicxx = "*"
74-
eigen = "*"
74+
eigen = "*"

test/pytest/conftest.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import pytest
22
import os
33

4+
45
def pytest_addoption(parser):
56
parser.addoption(
6-
"--from-pixi", action="store_true", default=False,
7-
help="Run tests from pixi task."
7+
"--from-pixi",
8+
action="store_true",
9+
default=False,
10+
help="Run tests from pixi task.",
811
)
912

13+
1014
@pytest.fixture(
1115
params=[
1216
"test_J2Plasticity",
@@ -35,4 +39,5 @@ def test_files(request):
3539

3640
if os.path.exists(json_path) and os.path.exists(h5_path):
3741
return json_path, h5_path
38-
pytest.skip(f"Required test files not found: {json_path} or {h5_path}")
42+
43+
assert False, f"Required test files not found: {json_path} or {h5_path}"

test/pytest/test_displacement_averaging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
from fans_dashboard.core.utils import identify_hierarchy, extract_and_organize_data
66

7+
78
def test_displacement_averaging(test_files):
89
"""
910
This test verifies that the average of displacement fluctuations is zero for all

test/pytest/test_homogenization_consistency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
from fans_dashboard.core.utils import identify_hierarchy, extract_and_organize_data
66

7+
78
def test_homogenization_consistency(test_files):
89
"""
910
This test verifies that the relationship stress_average = homogenized_tangent * strain_average

test/pytest/test_homogenized_tangent_spd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from fans_dashboard.core.utils import identify_hierarchy, extract_and_organize_data
66
from scipy.linalg import eigvalsh
77

8+
89
def test_homogenized_tangent_spd(test_files):
910
"""
1011
This test verifies that the homogenized tangent is strictly Symmetric Positive Definite (SPD)

test/pytest/test_homogenized_tangent_within_VRbounds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
compute_volume_fractions,
1111
)
1212

13+
1314
def test_homogenized_tangent_within_VRbounds(test_files):
1415
"""
1516
This test verifies that the homogenized tangent is within Voigt and Reuss bounds

test/pytest/test_loading_to_strain_average.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
from fans_dashboard.core.utils import identify_hierarchy, extract_and_organize_data
66

7+
78
def test_loading_to_strain_average(test_files):
89
"""
910
This test verifies that the strain_average field in the results matches the macroscale_loading

test/pytest/test_strain_stress_averaging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55
from fans_dashboard.core.utils import identify_hierarchy, extract_and_organize_data
66

7+
78
def test_strain_stress_averaging(test_files):
89
"""
910
This test verifies that the average of strain/stress fields matches the strain_average/stress_average

test/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ $TIME_CMD mpiexec -n $num_processes "$FANS_EXEC" input_files/test_PseudoPlastic.
2929

3030
$TIME_CMD mpiexec -n $num_processes "$FANS_EXEC" input_files/test_J2Plasticity.json output/test_J2Plasticity.h5 > test_J2Plasticity.log 2>&1
3131

32-
$TIME_CMD mpiexec -n $num_processes "$FANS_EXEC" input_files/test_MixedBCs.json output/test_MixedBCs.h5 > test_MixedBCs.log 2>&1
32+
$TIME_CMD mpiexec -n $num_processes "$FANS_EXEC" input_files/test_MixedBCs.json output/test_MixedBCs.h5 > test_MixedBCs.log 2>&1

0 commit comments

Comments
 (0)