Example #1
0
    def test_python_version(self):
        """Make sure project runs on supported Python version.

        This healthcheck focuses on compatibility of project within
        environments that actually use it, whereas unit tests take care of:

        * supported Python versions declaration (setup.py, setup.cfg).
        * project was developed within supported environment(s).

        """
        assert_supported_python_version(self.distribution)
Example #2
0
 def test_custom_msg(self):
     """assert_ping() accepts optional ``msg`` argument."""
     distribution = pkg_resources.get_distribution('hospital')
     version = '2.6'
     msg = "Custom message."
     # Make sure AssertionError is raised.
     with self.assertRaises(AssertionError) as context:
         packaging.assert_supported_python_version(distribution,
                                                   version,
                                                   msg=msg)
     # Let's check exception's message.
     self.assertEqual(context.exception.args[0], msg)
Example #3
0
 def test_custom_msg(self):
     """assert_ping() accepts optional ``msg`` argument."""
     distribution = pkg_resources.get_distribution('hospital')
     version = '2.6'
     msg = "Custom message."
     # Make sure AssertionError is raised.
     with self.assertRaises(AssertionError) as context:
         packaging.assert_supported_python_version(
             distribution,
             version,
             msg=msg)
     # Let's check exception's message.
     self.assertEqual(context.exception.args[0], msg)