From 9bddd54864f56ea3bb83fa86f92346c38943ade0 Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Thu, 31 Aug 2023 13:46:19 -0400 Subject: [PATCH] Remove unnecessary warning traceback, move TODOs --- tests/conftest.py | 13 ------------- tests/test_compute_funs.py | 3 +-- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9f8fc3464f..15be656bd6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,6 @@ """Test fixtures for computing equilibria etc.""" import os -import sys -import traceback -import warnings import h5py import numpy as np @@ -15,16 +12,6 @@ from desc.vmec import VMECIO -# print full tracebacks to help find sources of warnings -def _warn_with_traceback(message, category, filename, lineno, file=None, line=None): - log = file if hasattr(file, "write") else sys.stderr - traceback.print_stack(file=log) - log.write(warnings.formatwarning(message, category, filename, lineno, line)) - - -warnings.showwarning = _warn_with_traceback - - @pytest.fixture(scope="session") def TmpDir(tmpdir_factory): """Create a temporary directory to store testing files.""" diff --git a/tests/test_compute_funs.py b/tests/test_compute_funs.py index 2e220982ce..7ecfe14f89 100644 --- a/tests/test_compute_funs.py +++ b/tests/test_compute_funs.py @@ -43,7 +43,6 @@ def myconvolve_2d(arr_1d, stencil, shape): return conv -# TODO: add more tests for compute_geometry @pytest.mark.unit def test_total_volume(DummyStellarator): """Test that the volume enclosed by the LCFS is equal to the total volume.""" @@ -1114,11 +1113,11 @@ def test_partial_derivative(name): test_partial_derivative("(B*grad(|B|))_z") -# TODO: add test with stellarator example @pytest.mark.unit @pytest.mark.solve def test_boozer_transform(DSHAPE_current): """Test that Boozer coordinate transform agrees with BOOZ_XFORM.""" + # TODO: add test with stellarator example eq = EquilibriaFamily.load(load_from=str(DSHAPE_current["desc_h5_path"]))[-1] grid = LinearGrid(M=eq.M_grid, N=eq.N_grid, NFP=eq.NFP) data = eq.compute("|B|_mn", grid=grid, M_booz=eq.M, N_booz=eq.N)