class_docstr: Tests included here all pertain to the NiftyNet global configuration
  file and `NiftyNetGlobalConfig` is a singleton. These require each test
  to be run separately. This is why all tests are decorated with
  `skipUnless`.
class_docstr_tok: ["Tests","included","here","all","pertain","to","the","NiftyNet","global","configuration","file","and","`","NiftyNetGlobalConfig","`","is","a","singleton",".","These","require","each","test","to","be","run","separately",".","This","is","why","all","tests","are","decorated","with","`","skipUnless","`","."]
code: def setUpClass(cls):
      # use this method in sub-classes
      if cls is not NiftyNetGlobalConfigTestBase:
          NiftyNetGlobalConfigTestBase.setUpClass()
          return
  
      cls.config_home = join(expanduser("~"), ".niftynet")
      cls.file_type = "ini"
      cls.config_file = join(cls.config_home, cls.typify("config"))
  
      cls.header = "[global]"
      cls.default_config_opts = {
          "home": "~/niftynet",
          "ext": "extensions",
          "ext_mods": ["network"],
      }
  
imports: from glob import glob
  from os import remove, makedirs
  from os.path import expanduser, join, isdir, isfile
  from os.path import getmtime
  from shutil import rmtree
  from unittest import TestCase
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
label_desc: Use image node_id 3 for calling the NiftyNetGlobalConfigTestBase obj's underlying member method code with example usage: obj.setUpClass(cls) without return types