mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Fix testing and docs build failures
This commit is contained in:
parent
c64773d7f4
commit
d469ab2811
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -300,7 +300,7 @@ jobs:
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python3 -m pip install ruamel.yaml scons numpy cython sphinx\<4.0 jinja2\<3.1.0 \
|
||||
sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink
|
||||
sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink pint
|
||||
- name: Build Cantera with documentation
|
||||
run: python3 `which scons` build -j2 doxygen_docs=y sphinx_docs=y debug=n optimize=n use_pch=n
|
||||
- name: Ensure 'scons help' options work
|
||||
|
@ -1,12 +1,16 @@
|
||||
from contextlib import nullcontext
|
||||
import pytest
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional, Tuple, Dict
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
import cantera.with_units as ctu
|
||||
import cantera as ct
|
||||
import numpy as np
|
||||
from pint.testing import assert_allclose
|
||||
try:
|
||||
from pint.testing import assert_allclose
|
||||
except ModuleNotFoundError:
|
||||
# pint.testing was introduced in pint 0.20
|
||||
from pint.testsuite.helpers import assert_quantity_almost_equal as assert_allclose
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@ -25,7 +29,13 @@ def generic_phase(request):
|
||||
|
||||
|
||||
def test_setting_basis_units_fails(generic_phase):
|
||||
with pytest.raises(AttributeError, match="basis_units"):
|
||||
# Python 3.10 includes the name of the attribute which was improperly used as a
|
||||
# setter. Earlier versions have just a generic error message.
|
||||
if sys.version_info.minor < 10:
|
||||
match = "set attribute"
|
||||
else:
|
||||
match = "basis_units"
|
||||
with pytest.raises(AttributeError, match=match):
|
||||
generic_phase.basis_units = "some random string"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user