Skip to content

Make pytest fail on uncaught warnings #133

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

Merged
merged 6 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion pymc_experimental/inference/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def one_step(state, rng_key):

dims = {
var_name: [dim for dim in dims if dim is not None]
for var_name, dims in model.RV_dims.items()
for var_name, dims in model.named_vars_to_dims.items()
}

idata = convert_flat_trace_to_idata(
Expand Down
2 changes: 2 additions & 0 deletions pymc_experimental/tests/test_pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import platform
import sys

import numpy as np
Expand All @@ -21,6 +22,7 @@
import pymc_experimental as pmx


@pytest.mark.skipif(platform.machine() != "x86_64", reason="Test requires x86_64 architecture")
@pytest.mark.skipif(sys.platform == "win32", reason="JAX not supported on windows.")
def test_pathfinder():
# Data of the Eight Schools Model
Expand Down
6 changes: 6 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
filterwarnings =
error
ignore:.*?(\b(pkg_resources\.declare_namespace)\b).*:DeprecationWarning
ignore::UserWarning:arviz.data.inference_data
ignore::DeprecationWarning:pkg_resources