Skip to content

Commit 8fa3f1f

Browse files
committed
TST: more warnings dealt with
1 parent 1a4edd0 commit 8fa3f1f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

refnx/analysis/tests/test_curvefitter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from importlib import resources
22
import pickle
3+
import multiprocessing as mp
34
import sys
45

56
import numpy as np
@@ -654,6 +655,7 @@ def test_pymc_sample(self):
654655
# can't run test if pymc/pytensor not installed
655656
return
656657

658+
ctx = mp.get_context("spawn")
657659
with pymc_model(self.objective):
658660
s = pm.NUTS()
659661
pm.sample(
@@ -663,6 +665,7 @@ def test_pymc_sample(self):
663665
discard_tuned_samples=True,
664666
compute_convergence_checks=False,
665667
random_seed=1,
668+
mp_ctx=ctx,
666669
)
667670
# don't check for accuracy because it requires a heap more
668671
# draws.

refnx/reflect/_app/tests/test_app.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33
import pickle
44
from importlib import resources
5-
5+
import warnings
66

77
import pytest
88
from qtpy import QtWidgets, QtCore, QtGui
@@ -137,7 +137,12 @@ def test_mcmc_fit_and_reprocess(qtbot, tmp_path):
137137
data_objects = [datastore[name] for name in names_to_fit]
138138

139139
kwds = {"nsteps": 5, "folder": tmp_path, "nplot": 20}
140-
myapp.fit_data_objects(data_objects, mcmc_kws=kwds)
140+
with warnings.catch_warnings():
141+
warnings.simplefilter(
142+
"ignore",
143+
RuntimeWarning
144+
)
145+
myapp.fit_data_objects(data_objects, mcmc_kws=kwds)
141146
assert (tmp_path / "steps_corner.png").exists()
142147

143148

0 commit comments

Comments
 (0)