# Path: diffoscope/main.py
# def main(args=None):
#     if args is None:
#         args = sys.argv[1:]
#     signal.signal(signal.SIGTERM, sigterm_handler)
#     parsed_args = None
#     try:
#         with profile('main', 'parse_args'):
#             parser = create_parser()
#             parsed_args = parser.parse_args(args)
#         sys.exit(run_diffoscope(parsed_args))
#     except KeyboardInterrupt:
#         logger.info('Keyboard Interrupt')
#         sys.exit(2)
#     except BrokenPipeError:
#         sys.exit(2)
#     except Exception:
#         traceback.print_exc()
#         if parsed_args and parsed_args.debugger:
#             import pdb
#             pdb.post_mortem()
#         sys.exit(2)
#     finally:
#         with profile('main', 'cleanup'):
#             clean_all_temp_files()
# 
#         # Print profiling output at the very end
#         if parsed_args is not None:
#             ProfileManager().finish(parsed_args)


import os
import pytest
import signal
import tempfile
from diffoscope.main import main
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.



TEST_TAR1_PATH = os.path.join(os.path.dirname(__file__), 'data/test1.tar')
TEST_TAR2_PATH = os.path.join(os.path.dirname(__file__), 'data/test2.tar')
TEST_TARS = (TEST_TAR1_PATH, TEST_TAR2_PATH)


def run(capsys, *args):
    with pytest.raises(SystemExit) as exc:

# Path: diffoscope/main.py
# def main(args=None):
#     if args is None:
#         args = sys.argv[1:]
#     signal.signal(signal.SIGTERM, sigterm_handler)
#     parsed_args = None
#     try:
#         with profile('main', 'parse_args'):
#             parser = create_parser()
#             parsed_args = parser.parse_args(args)
#         sys.exit(run_diffoscope(parsed_args))
#     except KeyboardInterrupt:
#         logger.info('Keyboard Interrupt')
#         sys.exit(2)
#     except BrokenPipeError:
#         sys.exit(2)
#     except Exception:
#         traceback.print_exc()
#         if parsed_args and parsed_args.debugger:
#             import pdb
#             pdb.post_mortem()
#         sys.exit(2)
#     finally:
#         with profile('main', 'cleanup'):
#             clean_all_temp_files()
# 
#         # Print profiling output at the very end
#         if parsed_args is not None:
#             ProfileManager().finish(parsed_args)


# Path: tests/test_main.py
import os
import pytest
import signal
import tempfile
from diffoscope.main import main

# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2015 Jérémy Bobbio <lunar@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.



TEST_TAR1_PATH = os.path.join(os.path.dirname(__file__), 'data/test1.tar')
TEST_TAR2_PATH = os.path.join(os.path.dirname(__file__), 'data/test2.tar')
TEST_TARS = (TEST_TAR1_PATH, TEST_TAR2_PATH)


def run(capsys, *args):
    with pytest.raises(SystemExit) as exc:

        main(args)