diff options
author | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2019-07-09 10:20:20 +0200 |
---|---|---|
committer | Alexandre Marie <alexandre.marie@synchrotron-soleil.fr> | 2019-07-09 10:20:20 +0200 |
commit | 654a6ac93513c3cc1ef97cacd782ff674c6f4559 (patch) | |
tree | 3b986e4972de7c57fa465820367602fc34bcb0d3 /silx/io/test/test_spech5.py | |
parent | a763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (diff) |
New upstream version 0.11.0+dfsg
Diffstat (limited to 'silx/io/test/test_spech5.py')
-rw-r--r-- | silx/io/test/test_spech5.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/silx/io/test/test_spech5.py b/silx/io/test/test_spech5.py index 7c8ed5d..0263c3c 100644 --- a/silx/io/test/test_spech5.py +++ b/silx/io/test/test_spech5.py @@ -1,6 +1,6 @@ # coding: utf-8 # /*########################################################################## -# Copyright (C) 2016-2018 European Synchrotron Radiation Facility +# Copyright (C) 2016-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -272,6 +272,13 @@ class TestSpecH5(unittest.TestCase): self.assertEqual(self.sfh5["25.1/start_time"], u"2015-03-14T03:53:50") + def assertRaisesRegex(self, *args, **kwargs): + # Python 2 compatibility + if sys.version_info.major >= 3: + return super(TestSpecH5, self).assertRaisesRegex(*args, **kwargs) + else: + return self.assertRaisesRegexp(*args, **kwargs) + def testDatasetInstanceAttr(self): """The SpecH5Dataset objects must implement some dummy attributes to improve compatibility with widgets dealing with h5py datasets.""" @@ -279,7 +286,7 @@ class TestSpecH5(unittest.TestCase): self.assertIsNone(self.sfh5["1.1"]["measurement"]["MRTSlit UP"].chunks) # error message must be explicit - with self.assertRaisesRegexp( + with self.assertRaisesRegex( AttributeError, "SpecH5Dataset has no attribute tOTo"): dummy = self.sfh5["/1.1/start_time"].tOTo |