Skip to content

Commit 08cd4c1

Browse files
jswhit2jswhit2
authored andcommitted
fix version comparison checks in tests.
1 parent 6601594 commit 08cd4c1

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎Changelog‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
=================================
33
* make sure zstd compression filter test always runs unless specifically disabled, fix cli test so it runs on
44
32-bit x86. New wheels for linux that include plugins (they were left out of the 1.7.5 release).
5+
* fix version comparison logic that was broken when using netcdf-c >= 4.10.0 - this was the cause of
6+
issue #1515 (diskless persisted datasets are no longer persisted).
57

68
version 1.7.5 (tag v1.7.5rel)
79
=============================

‎test/test_masked5.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22
import os
33
import tempfile
4+
from packaging.version import Version
45

56
import numpy as np
67
from numpy import ma
@@ -55,7 +56,7 @@ def test_scaled(self):
5556
# issue 730
5657
# this part fails with netcdf 4.1.3
5758
# a bug in vlen strings?
58-
if __netcdf4libversion__ >= '4.4.0':
59+
if Version(__netcdf4libversion__) >= Version('4.4.0'):
5960
assert v2[0] == 'first'
6061
assert v2[1] == '<missing>'
6162

‎test/test_vlen.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import unittest
33
import os
44
import tempfile
5+
from packaging.version import Version
56
from netCDF4 import Dataset
67
import numpy as np
78
from numpy.testing import assert_array_equal
@@ -163,7 +164,7 @@ class VlenAppendTestCase(unittest.TestCase):
163164
def setUp(self):
164165

165166
import netCDF4
166-
if netCDF4.__netcdf4libversion__ < "4.4.1":
167+
if Version(netCDF4.__netcdf4libversion__) < Version("4.4.1"):
167168
self.skip = True
168169
try:
169170
self.skipTest("This test requires NetCDF 4.4.1 or later.")

0 commit comments

Comments
 (0)