Skip to content

Commit

Permalink
Debug pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Apr 14, 2024
1 parent 4a7198e commit 5a0aff5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions tests/test_em27.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ def test_detect_corrupt_ifgs() -> None:
with tempfile.TemporaryDirectory() as tmpdir:
with open(os.path.join(tmpdir, "test_ifg"), "w") as f:
f.write("corrupt interferogram")
assert len(tum_esm_utils.optional.em27.detect_corrupt_ifgs(tmpdir)) == 0
assert len(tum_esm_utils.em27.detect_corrupt_ifgs(tmpdir)) == 0

test_data_path = os.path.join(_PROJECT_DIR, "tests", "data")
detection_results = tum_esm_utils.optional.em27.detect_corrupt_ifgs(
test_data_path
)
detection_results = tum_esm_utils.em27.detect_corrupt_ifgs(test_data_path)
assert detection_results == {
"md20220409s0e00a.0199": [
"charfilter 'GFW' is missing",
Expand All @@ -38,7 +36,7 @@ def test_load_proffast2_result() -> None:
if f.startswith("comb_inv") and f.endswith(".csv")
]
for f in files:
df = tum_esm_utils.optional.em27.load_proffast2_result(
df = tum_esm_utils.em27.load_proffast2_result(
os.path.join(input_dir, f)
)
assert len(df) > 2
Expand Down
8 changes: 4 additions & 4 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ def test_plotting() -> None:
if os.path.exists(figure_path):
os.remove(figure_path)

tum_esm_utils.optional.plotting.apply_better_defaults(
tum_esm_utils.plotting.apply_better_defaults(
font_family="Roboto" if platform.system() == "Darwin" else None
)

with tum_esm_utils.optional.plotting.create_figure(
with tum_esm_utils.plotting.create_figure(
"/tmp/tum_esm_utils_plotting_test.png"
) as fig:
axis1 = tum_esm_utils.optional.plotting.add_subplot(
axis1 = tum_esm_utils.plotting.add_subplot(
fig, (2, 1, 1), title="Test Plot", xlabel="X", ylabel="Y"
)
axis1.plot([1, 2, 3], [1, 2, 3])

axis2 = tum_esm_utils.optional.plotting.add_subplot(
axis2 = tum_esm_utils.plotting.add_subplot(
fig, (2, 1, 2), title="Test Plot 2", xlabel="X", ylabel="Y"
)
axis2.plot([1, 2, 3], [3, 2, 1])
Expand Down

0 comments on commit 5a0aff5

Please sign in to comment.