-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#11 flesh out pytest for geom_1 example
add numpy to pixi pytest environment
- Loading branch information
Showing
3 changed files
with
210 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
import os | ||
from pathlib import Path | ||
import numpy as np | ||
import pytest | ||
|
||
|
||
def test_output(): | ||
assert True | ||
# convert from script location to corresponding location in build directory | ||
script_dir = Path(os.path.abspath(__file__)).parent | ||
script_dir_parts = list(script_dir.parts) | ||
script_dir_parts.insert(-2, "build") | ||
script_build_dir = Path(*script_dir_parts) | ||
|
||
assert script_build_dir.exists() | ||
A = np.loadtxt(script_build_dir / "A", skiprows=1) | ||
A_ref = np.loadtxt(script_build_dir / "A_ref", skiprows=1) | ||
assert A.shape == A_ref.shape | ||
assert A == pytest.approx(A_ref) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters