Skip to content

Revert "[Python/Test] Work around pint TypeError - pint #1969 resolved" #1912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions test/python/test_units.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from contextlib import nullcontext
from dataclasses import dataclass
from typing import Optional, Tuple, Dict
import sys

import pytest
try:
pint = pytest.importorskip("pint", "0.17.0")
except TypeError as e:
# The extra exception handling is here because pint is incompatible with
# Python 3.13. Once https://github.com/hgrecco/pint/issues/1969 is resolved the
# try/except here can be restored to just the importorskip.
pytest.skip(f"pint import failed due to {e}", allow_module_level=True)
pytest.importorskip("pint", "0.17.0")
Comment on lines +1 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be a pure "revert" -- the removal of unused imports that was done in the original commit should be preserved. I also think the sense of "revert" is a bit wrong here; at least to me it implies that the original commit was erroneous, which isn't the case.

import cantera.with_units as ctu
import cantera as ct
try:
Expand Down
Loading