use pytest-check

This commit is contained in:
Matthias Hochsteger 2021-01-13 08:40:52 +01:00
parent 1502fd705e
commit ba7fc03800
3 changed files with 4 additions and 2 deletions

View File

@ -2,4 +2,5 @@ FROM ubuntu:19.10
ENV DEBIAN_FRONTEND=noninteractive
MAINTAINER Matthias Hochsteger <matthias.hochsteger@tuwien.ac.at>
RUN apt-get update && apt-get -y install python3 libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk clang-tidy python3-distutils clang libocct-data-exchange-dev libcgns-dev libhdf5-dev
RUN python3 -m pip install pytest-check
ADD . /root/src/netgen

View File

@ -2,5 +2,5 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
MAINTAINER Matthias Hochsteger <matthias.hochsteger@tuwien.ac.at>
RUN apt-get update && apt-get -y install python3 libpython3-dev python3-pip libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev ccache python3-pytest python3-numpy python3-tk python3-mpi4py clang-tidy python3-distutils clang libopenmpi-dev openmpi-bin gfortran
RUN python3 -m pip install pytest-mpi
RUN python3 -m pip install pytest-mpi pytest-check
ADD . /root/src/netgen

View File

@ -2,6 +2,7 @@ from netgen.geom2d import *
import pytest
import math
from pytest import approx
from pytest_check import check
def check_area(geo, area):
@ -14,7 +15,7 @@ def check_area(geo, area):
ngs = pytest.importorskip("ngsolve")
mesh = ngs.Mesh(m)
mesh.Curve(5)
assert ngs.Integrate(1.0, mesh) == approx(area)
with check: assert ngs.Integrate(1.0, mesh) == approx(area)
def test_two_circles():
c1 = Circle(center=(0,0), radius=1)