Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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 examples/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ setup:

TEST_OPTS ?= --ceed /cpu/self/ref/serial
test: setup
$(PYTHON) -m pytest ex_test.py $(TEST_OPTS)
$(PYTHON) -m pytest ex_test.py bps_test.py $(TEST_OPTS)

.PHONY: clean setup test
67 changes: 67 additions & 0 deletions examples/python/bps_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors
# All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-2-Clause
#
# This file is part of CEED: http://github.com/ceed

import pytest
from argparse import Namespace

# The BP examples use PETSc, unlike ex1-ex3, so skip them where it is unavailable
pytest.importorskip("petsc4py")
import bpsraw # noqa: E402

# -------------------------------------------------------------------------------


def test_401(ceed_resource):

@jeremylt jeremylt Jul 20, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd pick a clearer set of test names, like test_bp_1_degree_1 or such? Once this merges, I'll be adding an issue for a student to expand this to BP2, BP3, and BP4, so naming the tests by the BP will help us there

args = Namespace(
ceed=ceed_resource,
problem='bp1',
degree=1,
q_extra=None,
local=1000,
test=True,
benchmark=False,
write_solution=False,
ksp_max_it_clip=[15, 15],
)
assert bpsraw.example_bps(args) == 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we either should use assert in the other test cases or not use it here. I think but am not sure that not having the assert results in this test just returning the error code of example_bps


# -------------------------------------------------------------------------------


def test_402(ceed_resource):
args = Namespace(
ceed=ceed_resource,
problem='bp1',
degree=2,
q_extra=None,
local=1000,
test=True,
benchmark=False,
write_solution=False,
ksp_max_it_clip=[15, 15],
)
assert bpsraw.example_bps(args) == 0

# -------------------------------------------------------------------------------


def test_403(ceed_resource):
args = Namespace(
ceed=ceed_resource,
problem='bp1',
degree=3,
q_extra=None,
local=1000,
test=True,
benchmark=False,
write_solution=False,
ksp_max_it_clip=[15, 15],
)
assert bpsraw.example_bps(args) == 0

# -------------------------------------------------------------------------------
Loading