diff --git a/test/unit/clitest/test_sess.py b/test/unit/clitest/test_sess.py index 05833148b..5a66316dc 100644 --- a/test/unit/clitest/test_sess.py +++ b/test/unit/clitest/test_sess.py @@ -658,6 +658,7 @@ def testSessionReattachConflictingPort(self, connection, port, group): connection, name=None, port=port[1], group=group) with pytest.raises(NonZeroReturnCode): cli.invoke(["s", "login", "-k", "%s" % MOCKKEY] + key_conn_args) + cli.STORE.clear(testhost, testuser) @pytest.mark.parametrize('connection', CONNECTION_TYPES) @pytest.mark.parametrize('port', ALL_PORTS) @@ -706,6 +707,7 @@ def testSessionReattachFailsPortGroup(self, connection, port, group): connection, name=None, port=port[1], group=group[1]) with pytest.raises(NonZeroReturnCode): cli.invoke(["s", "login", "-k", "%s" % MOCKKEY] + key_conn_args) + cli.STORE.clear(testhost, testuser) @pytest.mark.parametrize('port', ALL_PORTS) @pytest.mark.parametrize('connection', CONNECTION_TYPES) diff --git a/test/unit/tablestest/test_hdfstorage.py b/test/unit/tablestest/test_hdfstorage.py index 3fa42e230..c8d57508f 100755 --- a/test/unit/tablestest/test_hdfstorage.py +++ b/test/unit/tablestest/test_hdfstorage.py @@ -30,6 +30,7 @@ import omero.hdfstorageV2 as storage_module import sys +import warnings if sys.platform.startswith("win"): pytest.skip("skipping tests on windows", allow_module_level=True) @@ -344,7 +345,11 @@ def testNonNaturalNameWarning(self, name): hdf = HdfStorage(self.hdfpath(), self.lock) cols = [omero.columns.StringColumnI( name, "A column with non natural name", bytesize, None)] - hdf.initialize(cols) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + hdf.initialize(cols) + assert len(w) == 1 + assert issubclass(w[-1].category, tables.NaturalNameWarning) cols[0].settable(hdf._HdfStorage__mea) # Needed for size cols[0].values = ["foo", "bar"] hdf.append(cols)