from __future__ import absolute_import

import h5py

from ..common import ut, TestCase


class TestDeprecations(TestCase):
    def test_highlevel_access(self):
        warning_message = (
            "The h5py.highlevel module is deprecated, code should import "
            "directly from h5py, e.g. 'from h5py import File'."
        )
        with self.assertWarnsRegex(H5pyDeprecationWarning, warning_message) as warning:
            hl = h5py.highlevel

from __future__ import absolute_import

import h5py
from h5py.h5py_warnings import H5pyDeprecationWarning

from ..common import ut, TestCase


class TestDeprecations(TestCase):
    def test_highlevel_access(self):
        warning_message = (
            "The h5py.highlevel module is deprecated, code should import "
            "directly from h5py, e.g. 'from h5py import File'."
        )
        with self.assertWarnsRegex(H5pyDeprecationWarning, warning_message) as warning:
            File = h5py.highlevel.File

Fix test which appeared to not be run
BUG: Fix test which appeared to not be run

  from __future__ import absolute_import
  
  import h5py
+ from h5py.h5py_warnings import H5pyDeprecationWarning
  
  from ..common import ut, TestCase
  
  
  class TestDeprecations(TestCase):
      def test_highlevel_access(self):
          warning_message = (
              "The h5py.highlevel module is deprecated, code should import "
              "directly from h5py, e.g. 'from h5py import File'."
          )
          with self.assertWarnsRegex(H5pyDeprecationWarning, warning_message) as warning:
-             hl = h5py.highlevel
+             File = h5py.highlevel.File
  
Fix test which appeared to not be run
## Code Before:
from __future__ import absolute_import

import h5py

from ..common import ut, TestCase


class TestDeprecations(TestCase):
    def test_highlevel_access(self):
        warning_message = (
            "The h5py.highlevel module is deprecated, code should import "
            "directly from h5py, e.g. 'from h5py import File'."
        )
        with self.assertWarnsRegex(H5pyDeprecationWarning, warning_message) as warning:
            hl = h5py.highlevel

## Instruction:
Fix test which appeared to not be run
## Code After:
from __future__ import absolute_import

import h5py
from h5py.h5py_warnings import H5pyDeprecationWarning

from ..common import ut, TestCase


class TestDeprecations(TestCase):
    def test_highlevel_access(self):
        warning_message = (
            "The h5py.highlevel module is deprecated, code should import "
            "directly from h5py, e.g. 'from h5py import File'."
        )
        with self.assertWarnsRegex(H5pyDeprecationWarning, warning_message) as warning:
            File = h5py.highlevel.File
