コード例 #1
0
    def test_manual_disabling(self):
        """
        Test that disabling the logging manually works
        """
        with open(self._config_file, "w") as fd:
            fd.write("file_logging: true\n")

        logger = IgnisLogging().get_logger(__name__)
        logger.disable_file_logging()
        logger.log_to_file(test="test")

        self.assertFalse(os.path.exists(self._default_log))
コード例 #2
0
    def test_manual_disabling(self):
        """
        Test that disabling the logging manually works
        :return:
        """
        with open(os.path.join(self._qiskit_dir, "logging.yaml"), "w") as file:
            file.write("file_logging: true\n")

        logger = IgnisLogging().get_logger(__name__)
        logger.disable_file_logging()
        logger.log_to_file(test="test")

        self.assertFalse(os.path.exists(self._default_log))