def setUp(self):
     """Set up test fixtures."""
     (jupyter_patches, self.jupyter_dirs,
      remove_jupyter_dirs) = patch_jupyter_dirs()
     for ptch in jupyter_patches:
         ptch.start()
         self.addCleanup(ptch.stop)
     self.addCleanup(remove_jupyter_dirs)
 def setUp(self):
     """Set up test fixtures."""
     (jupyter_patches, self.jupyter_dirs,
      remove_jupyter_dirs) = patch_jupyter_dirs()
     for ptch in jupyter_patches:
         ptch.start()
         self.addCleanup(ptch.stop)
     self.addCleanup(remove_jupyter_dirs)
 def setUp(self):
     """Set up test fixtures for each test."""
     (jupyter_patches, self.jupyter_dirs,
      remove_jupyter_dirs) = patch_jupyter_dirs()
     for ptch in jupyter_patches:
         ptch.start()
         self.addCleanup(ptch.stop)
     self.addCleanup(remove_jupyter_dirs)
     for klass in app_classes:
         patch_traitlets_app_logs(klass)
         klass.log_level.default_value = logging.DEBUG
Exemple #4
0
 def setUp(self):
     """Set up test fixtures for each test."""
     (jupyter_patches, self.jupyter_dirs,
      remove_jupyter_dirs) = patch_jupyter_dirs()
     for ptch in jupyter_patches:
         ptch.start()
         self.addCleanup(ptch.stop)
     self.addCleanup(remove_jupyter_dirs)
     for klass in app_classes:
         patch_traitlets_app_logs(klass)
         klass.log_level.default_value = logging.DEBUG
    def _setup_patches(cls):
        (cls.jupyter_patches, cls.jupyter_dirs,
         remove_jupyter_dirs) = patch_jupyter_dirs()
        # store in a list to avoid confusion over bound/unbound method in pypy
        cls.removal_funcs = [remove_jupyter_dirs]
        try:
            for ptch in cls.jupyter_patches:
                ptch.start()

            # patches for items called in NotebookTestBase.teardown_class
            # env_patch needs a start method as well because of a typo in
            # notebook 4.0 which calls it in the teardown_class method
            cls.env_patch = cls.path_patch = Mock(['start', 'stop'])
            cls.home_dir = cls.config_dir = cls.data_dir = Mock(['cleanup'])
            cls.runtime_dir = cls.notebook_dir = Mock(['cleanup'])
        except Exception:
            for func in cls.removal_funcs:
                func()
            raise
    def _setup_patches(cls):
        (cls.jupyter_patches, cls.jupyter_dirs,
         remove_jupyter_dirs) = patch_jupyter_dirs()
        # store in a list to avoid confusion over bound/unbound method in pypy
        cls.removal_funcs = [remove_jupyter_dirs]
        try:
            for ptch in cls.jupyter_patches:
                ptch.start()

            # patches for items called in NotebookTestBase.teardown_class
            # env_patch needs a start method as well because of a typo in
            # notebook 4.0 which calls it in the teardown_class method
            cls.env_patch = cls.path_patch = Mock(['start', 'stop'])
            cls.home_dir = cls.config_dir = cls.data_dir = Mock(['cleanup'])
            cls.runtime_dir = cls.notebook_dir = Mock(['cleanup'])
            cls.tmp_dir = Mock(['cleanup'])
        except Exception:
            for func in cls.removal_funcs:
                func()
            raise