Skip to content
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

Bug in test_unused_thermal_cond due to pytest update #691

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions test/unit/test_materials.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import festim as F
from fenics import *
import pytest
import warnings


def test_find_material_from_id():
Expand Down Expand Up @@ -78,15 +79,12 @@ def test_unused_thermal_cond():

# this shouldn't throw warnings
derived_quantities = [F.SurfaceFlux("T", surface=0)]
# record the warnings
with pytest.warns(None) as record:
with warnings.catch_warnings():
warnings.simplefilter("error")
my_mats.check_for_unused_properties(
T=F.Temperature(100), derived_quantities=derived_quantities
)

# check that no warning were raised
assert len(record) == 0


def test_missing_thermal_cond():
"""Tests that an error is raised when the thermal cond is missing"""
Expand Down
Loading