Skip to content

Commit

Permalink
extend test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Jun 12, 2024
1 parent 58d247c commit b1e8e9e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/core/test_units.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import warnings

import pytest
from numpy.testing import assert_array_equal
from pytest import approx
Expand Down Expand Up @@ -109,10 +111,15 @@ def test_memory(self):

def test_deprecated_memory(self):
# TODO: remove after 2025-01-01
for unit in ("mb", "Mb"):
for unit in ("Kb", "kb", "Mb", "mb", "Gb", "gb", "Tb", "tb"):
with pytest.warns(DeprecationWarning, match=f"Unit {unit} is deprecated"):
Memory(1, unit)

with warnings.catch_warnings():
warnings.simplefilter("error")
for unit in ("KB", "MB", "GB", "TB"):
Memory(1, unit)

def test_unitized(self):
@unitized("eV")
def func1():
Expand Down

0 comments on commit b1e8e9e

Please sign in to comment.