Skip to content

Commit

Permalink
Switch to using syrupy
Browse files Browse the repository at this point in the history
pytest-snapshottest uses imp, which was deprecated in 3.11 and gone now.
They don't look like moving
syrusakbary/snapshottest#166

Conflicts:
	.github/workflows/python-build-test.yml
  • Loading branch information
kwinkunks committed Dec 21, 2023
1 parent 5f43ed5 commit 37ba8b4
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 100 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/python-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ dependencies = [
[project.optional-dependencies]
test = [
"pytest",
"snapshottest",
"syrupy",
"hypothesis",
"matplotlib",
"pillow>=10.0.0", # not directly required, pinned by Snyk to avoid a vulnerability
"Flake8-pyproject" # Work around Flake8 incompatibility with pyproject.toml
"pillow>=10.0.0", # Not directly required, pinned by Snyk to avoid a vulnerability
"Flake8-pyproject", # Work around Flake8 incompatibility with pyproject.toml
]
docs = [
"sphinx",
Expand Down
4 changes: 4 additions & 0 deletions tests/__snapshots__/test_config_fluids.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# serializer version: 1
# name: test_fluids_vectorized
Material(shear_modulus=0, bulk_modulus=[1.64734606e+08 1.83184882e+08], primary_velocity=[1144.72360384 1021.36998928], secondary_velocity=[0. 0.], density=[125.71397711 175.59956795])
# ---
7 changes: 7 additions & 0 deletions tests/__snapshots__/test_depth_trend.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# serializer version: 1
# name: test_dryrock_depthtrend_k_my
Material(shear_modulus=[12.], bulk_modulus=[20.], primary_velocity=[0.1165543], secondary_velocity=[0.06729266], density=[2650.])
# ---
# name: test_dryrock_depthtrend_vp_vs
Material(shear_modulus=[12.], bulk_modulus=[20.], primary_velocity=[0.1165543], secondary_velocity=[0.06729266], density=[2650.])
# ---
13 changes: 13 additions & 0 deletions tests/__snapshots__/test_dryrock.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# serializer version: 1
# name: test_dryrock_phi_fitted_vp_vs
tuple(
Material(shear_modulus=[7.6585e+09], bulk_modulus=[1.20751667e+10], primary_velocity=[2900.], secondary_velocity=[1700.], density=[2650.]),
Material(shear_modulus=44.0, bulk_modulus=36.8, primary_velocity=0.18980294316133353, secondary_velocity=0.128855630784633, density=2650.0),
)
# ---
# name: test_dryrock_phi_k_my
tuple(
Material(shear_modulus=[12.], bulk_modulus=[20.], primary_velocity=[0.1165543], secondary_velocity=[0.06729266], density=[2650.]),
Material(shear_modulus=44.0, bulk_modulus=36.8, primary_velocity=0.18980294316133353, secondary_velocity=0.128855630784633, density=2650.0),
)
# ---
4 changes: 4 additions & 0 deletions tests/__snapshots__/test_fluid_substitution.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# serializer version: 1
# name: test_fluid_substitution
Material(shear_modulus=[1.], bulk_modulus=[1.94708995], primary_velocity=[1.28070748], secondary_velocity=[0.70710678], density=[2.])
# ---
4 changes: 4 additions & 0 deletions tests/__snapshots__/test_murphy_coordination_number.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# serializer version: 1
# name: test_murphy_coordination_number
17.555560500000002
# ---
10 changes: 10 additions & 0 deletions tests/__snapshots__/test_pressure.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# serializer version: 1
# name: test_pressure_dependency_no_pressure_exp_fit
Material(shear_modulus=1.0, bulk_modulus=0.9999999999999998, primary_velocity=1.5275252316519465, secondary_velocity=1.0, density=1.0)
# ---
# name: test_pressure_dependency_no_pressure_poly_fit
Material(shear_modulus=1.0, bulk_modulus=0.9999999999999998, primary_velocity=1.5275252316519465, secondary_velocity=1.0, density=1.0)
# ---
# name: test_pressure_dependency_no_pressure_power_fit
Material(shear_modulus=1.0, bulk_modulus=0.9999999999999998, primary_velocity=1.5275252316519465, secondary_velocity=1.0, density=1.0)
# ---
Empty file removed tests/snapshots/__init__.py
Empty file.
12 changes: 0 additions & 12 deletions tests/snapshots/snap_test_config_fluids.py

This file was deleted.

16 changes: 0 additions & 16 deletions tests/snapshots/snap_test_depth_trend.py

This file was deleted.

26 changes: 0 additions & 26 deletions tests/snapshots/snap_test_dryrock.py

This file was deleted.

12 changes: 0 additions & 12 deletions tests/snapshots/snap_test_fluid_substitution.py

This file was deleted.

10 changes: 0 additions & 10 deletions tests/snapshots/snap_test_murphy_coordination_number.py

This file was deleted.

20 changes: 0 additions & 20 deletions tests/snapshots/snap_test_pressure.py

This file was deleted.

0 comments on commit 37ba8b4

Please sign in to comment.