from panoptes.mount.ioptron import iOptronMount

class TestOptronMount: 

    mount = None

    def setup(self):
        print ("TestMount:setup() before each test method")
 
    def teardown(self):
        print ("TestMount:teardown() after each test method")
 
    @classmethod
    def setup_class(cls):
        print ("setup_class() before any methods in this class")
        _Mounts = []
        for name in os.listdir(os.path.dirname(__file__)):
            if not name.startswith('_') and name.endswith('.py'):
                name = '.' + os.path.splitext(name)[0]
                try:
                    module = importlib.import_module(name,'panoptes')
                    _Mounts.append(module)
                except ImportError as err:
                    self.logger.warn('Failed to load mount plugin: {}'.format(err))
 
    @classmethod
    def teardown_class(cls):
        print ("teardown_class() after any methods in this class")

    def test_is_connected_false(self):
        pass

    def test_connect(self):
        pass

    def test_is_connected_true(self):
        pass

    def test_is_slewing(self):
        pass

    def test_check_coordinates(self):
        pass

    def test_sync_coordinates(self):
        pass

    def test_slew_to_coordinates(self):
        pass

    def test_slew_to_park(self):
        pass

    def test_echo(self):
        pass

import os
import importlib
import warnings

class TestOptronMount: 

    mount = None

    def setup(self):
        print ("TestMount:setup() before each test method")
 
    def teardown(self):
        print ("TestMount:teardown() after each test method")
 
    @classmethod
    def setup_class(cls):
        mount_dir = os.path.dirname(__file__) + '/../mount/'
        print ("setup_class() before any methods in this class")
        _Mounts = []
        for name in os.listdir(os.path.dirname(mount_dir)):
            if not name.startswith('_') and name.endswith('.py'):
                name = '.' + os.path.splitext(name)[0]
                try:
                    module = importlib.import_module(name,'panoptes.mount')
                    _Mounts.append(module)
                except ImportError as err:
                    warnings.warn('Failed to load mount plugin: {}'.format(err))
 
    @classmethod
    def teardown_class(cls):
        print ("teardown_class() after any methods in this class")

    def test_is_connected_false(self):
        pass

    def test_connect(self):
        pass

    def test_is_connected_true(self):
        pass

    def test_is_slewing(self):
        pass

    def test_check_coordinates(self):
        pass

    def test_sync_coordinates(self):
        pass

    def test_slew_to_coordinates(self):
        pass

    def test_slew_to_park(self):
        pass

    def test_echo(self):
        pass

Test file loops over all the mounts
Test file loops over all the mounts

- from panoptes.mount.ioptron import iOptronMount
+ import os
+ import importlib
+ import warnings
  
  class TestOptronMount: 
  
      mount = None
  
      def setup(self):
          print ("TestMount:setup() before each test method")
   
      def teardown(self):
          print ("TestMount:teardown() after each test method")
   
      @classmethod
      def setup_class(cls):
+         mount_dir = os.path.dirname(__file__) + '/../mount/'
          print ("setup_class() before any methods in this class")
          _Mounts = []
-         for name in os.listdir(os.path.dirname(__file__)):
+         for name in os.listdir(os.path.dirname(mount_dir)):
              if not name.startswith('_') and name.endswith('.py'):
                  name = '.' + os.path.splitext(name)[0]
                  try:
-                     module = importlib.import_module(name,'panoptes')
+                     module = importlib.import_module(name,'panoptes.mount')
                      _Mounts.append(module)
                  except ImportError as err:
-                     self.logger.warn('Failed to load mount plugin: {}'.format(err))
+                     warnings.warn('Failed to load mount plugin: {}'.format(err))
   
      @classmethod
      def teardown_class(cls):
          print ("teardown_class() after any methods in this class")
  
      def test_is_connected_false(self):
          pass
  
      def test_connect(self):
          pass
  
      def test_is_connected_true(self):
          pass
  
      def test_is_slewing(self):
          pass
  
      def test_check_coordinates(self):
          pass
  
      def test_sync_coordinates(self):
          pass
  
      def test_slew_to_coordinates(self):
          pass
  
      def test_slew_to_park(self):
          pass
  
      def test_echo(self):
          pass
  
Test file loops over all the mounts
## Code Before:
from panoptes.mount.ioptron import iOptronMount

class TestOptronMount: 

    mount = None

    def setup(self):
        print ("TestMount:setup() before each test method")
 
    def teardown(self):
        print ("TestMount:teardown() after each test method")
 
    @classmethod
    def setup_class(cls):
        print ("setup_class() before any methods in this class")
        _Mounts = []
        for name in os.listdir(os.path.dirname(__file__)):
            if not name.startswith('_') and name.endswith('.py'):
                name = '.' + os.path.splitext(name)[0]
                try:
                    module = importlib.import_module(name,'panoptes')
                    _Mounts.append(module)
                except ImportError as err:
                    self.logger.warn('Failed to load mount plugin: {}'.format(err))
 
    @classmethod
    def teardown_class(cls):
        print ("teardown_class() after any methods in this class")

    def test_is_connected_false(self):
        pass

    def test_connect(self):
        pass

    def test_is_connected_true(self):
        pass

    def test_is_slewing(self):
        pass

    def test_check_coordinates(self):
        pass

    def test_sync_coordinates(self):
        pass

    def test_slew_to_coordinates(self):
        pass

    def test_slew_to_park(self):
        pass

    def test_echo(self):
        pass

## Instruction:
Test file loops over all the mounts
## Code After:
import os
import importlib
import warnings

class TestOptronMount: 

    mount = None

    def setup(self):
        print ("TestMount:setup() before each test method")
 
    def teardown(self):
        print ("TestMount:teardown() after each test method")
 
    @classmethod
    def setup_class(cls):
        mount_dir = os.path.dirname(__file__) + '/../mount/'
        print ("setup_class() before any methods in this class")
        _Mounts = []
        for name in os.listdir(os.path.dirname(mount_dir)):
            if not name.startswith('_') and name.endswith('.py'):
                name = '.' + os.path.splitext(name)[0]
                try:
                    module = importlib.import_module(name,'panoptes.mount')
                    _Mounts.append(module)
                except ImportError as err:
                    warnings.warn('Failed to load mount plugin: {}'.format(err))
 
    @classmethod
    def teardown_class(cls):
        print ("teardown_class() after any methods in this class")

    def test_is_connected_false(self):
        pass

    def test_connect(self):
        pass

    def test_is_connected_true(self):
        pass

    def test_is_slewing(self):
        pass

    def test_check_coordinates(self):
        pass

    def test_sync_coordinates(self):
        pass

    def test_slew_to_coordinates(self):
        pass

    def test_slew_to_park(self):
        pass

    def test_echo(self):
        pass
