# Path: px/px.py
# ERROR_REPORTING_HEADER = """
# ---
# 
# Problems detected, please send this text to one of:
# * https://github.com/walles/px/issues/new
# * johan.walles@gmail.com
# """
#         LOG = logging.getLogger(__name__)
# def install(argv):
# def main():
# def configureLogging(loglevel, stringIO):
# def handleLogMessages(messages):
# def _main(argv):


import os
import sys
from px import px



def test_run_on_pid(capfd):
    """
    Just run px on a PID.

    The only verification done here is that it doesn't crash,
    there is room for improvement...
    """
    argv = [
        sys.argv[0],
        "--no-pager",  # Paging causes problems on Travis CI
        # Note that px hides our own PID by design, so we look for our
        # parent PID in this test.
        str(os.getppid()),
    ]

    # Enable manual inspection of the output:
    # https://docs.pytest.org/en/latest/capture.html
    with capfd.disabled():

# Path: px/px.py
# ERROR_REPORTING_HEADER = """
# ---
# 
# Problems detected, please send this text to one of:
# * https://github.com/walles/px/issues/new
# * johan.walles@gmail.com
# """
#         LOG = logging.getLogger(__name__)
# def install(argv):
# def main():
# def configureLogging(loglevel, stringIO):
# def handleLogMessages(messages):
# def _main(argv):


# Path: tests/px_integration_test.py
import os
import sys
from px import px




def test_run_on_pid(capfd):
    """
    Just run px on a PID.

    The only verification done here is that it doesn't crash,
    there is room for improvement...
    """
    argv = [
        sys.argv[0],
        "--no-pager",  # Paging causes problems on Travis CI
        # Note that px hides our own PID by design, so we look for our
        # parent PID in this test.
        str(os.getppid()),
    ]

    # Enable manual inspection of the output:
    # https://docs.pytest.org/en/latest/capture.html
    with capfd.disabled():

        px._main(argv)