Skip to content

Commit

Permalink
Catch zstandard warning (existed prior to PR #231)
Browse files Browse the repository at this point in the history
  • Loading branch information
Callek committed Mar 4, 2024
1 parent 7c3186e commit 7b8051d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/memory_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Simple test for evaluating zstandard binding memory usage.
"""

import io
import sys

Expand Down
9 changes: 8 additions & 1 deletion tests/test_degraded.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import importlib
import subprocess
import sys
import warnings


def test_degraded():
Expand All @@ -17,7 +18,13 @@ def test_degraded():
# this is only testing conda_package_handling's code, and does not test
# that conda_package_streaming works without zstandard.

import conda_package_handling.api
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always") # Ensure warnings are sent
import conda_package_handling.api

assert len(w) == 1
assert issubclass(w[-1].category, UserWarning)
assert "zstandard" in str(w[-1].message)

importlib.reload(conda_package_handling.api)

Expand Down

0 comments on commit 7b8051d

Please sign in to comment.