Skip to content

Commit

Permalink
Merge pull request #424 from davidhassell/py3.10_test_decorators
Browse files Browse the repository at this point in the history
Fix test_decorators issue by setting correct assertLogs levels
  • Loading branch information
davidhassell authored Jul 18, 2022
2 parents 8ce4c63 + ae9b95d commit 07cb04f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
version 3.13.1
--------------

**2022-??-??**
**2022-07-??**

* Upgrade to allow cf to work with Python 3.10
(https://github.com/NCAS-CMS/cf-python/issues/419)
* Fix bug when setting coordinate bounds with different units to their
parent coordinates
(https://github.com/NCAS-CMS/cf-python/issues/417)

----

version 3.13.0
--------------

Expand Down
6 changes: 3 additions & 3 deletions cf/test/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_manage_log_level_via_verbose_attr(self):
# all messages should appear, regardless of global log_level:
for attr in (-1, "DEBUG", "debug", "Debug", "DeBuG"):
test_class.verbose = attr
with self.assertLogs(level=cf.log_level().value) as catch:
with self.assertLogs(level=-1) as catch:
test_class.decorated_logging_func()
for msg in log_message:
self.assertIn(msg, catch.output)
Expand All @@ -157,7 +157,7 @@ def test_manage_log_level_via_verbose_attr(self):
# regardless of global log_level value set:
for attr in (1, "WARNING", "warning", "Warning", "WaRning"):
test_class.verbose = attr
with self.assertLogs(level=cf.log_level().value) as catch:
with self.assertLogs(level=1) as catch:
test_class.decorated_logging_func()
for msg in log_message:
if msg.split(":")[0] == "WARNING":
Expand All @@ -169,7 +169,7 @@ def test_manage_log_level_via_verbose_attr(self):

# ... verbose=2 should be equivalent to verbose=3 now:
test_class.verbose = True
with self.assertLogs(level=cf.log_level().value) as catch:
with self.assertLogs(level=3) as catch:
test_class.decorated_logging_func()
for msg in log_message:
if msg.split(":")[0] == "DEBUG":
Expand Down
6 changes: 3 additions & 3 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Windows Subsystem for Linux (WSL)
**Python versions**
-------------------

The cf package is only for Python 3.7, 3.8 and 3.9.
The cf package is only for Python 3.7 or newer.

Versions 2.x of cf work only for Python 2.7.

Expand Down Expand Up @@ -138,7 +138,7 @@ To install from source (without any dependencies):
1. Download the cf package from https://pypi.org/project/cf-python

2. Unpack the library (replacing ``<version>`` with the version that
you want to install, e.g. ``3.13.0``):
you want to install, e.g. ``3.13.1``):

.. code-block:: console
Expand Down Expand Up @@ -199,7 +199,7 @@ installed, which
Required
^^^^^^^^

* `Python <https://www.python.org/>`_, 3.7, 3.8 or 3.9.
* `Python <https://www.python.org/>`_, 3.7 or newer.

* `numpy <https://pypi.org/project/numpy/>`_, 1.15 or newer.

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
netCDF4>=1.5.4
cftime>=1.5.0
numpy>=1.15
cfdm>=1.9.0.2, <1.9.1.0
cfdm>=1.9.0.4, <1.9.1.0
psutil>=0.6.0
cfunits>=3.3.4
packaging>=20.0

0 comments on commit 07cb04f

Please sign in to comment.