Exemplo n.º 1
0
 def test_pytest_command(self):
     if system().lower() == 'windows':
         self.assertEqual(
             get_command('pytest'),
             "py.test.exe --tb=short",
         )
     else:
         self.assertEqual(
             get_command('pytest'),
             "py.test --tb=short",
         )
 def test_pytest_command(self):
     if system().lower() == 'windows':
         self.assertEqual(
             get_command('pytest'),
             "py.test.exe --tb=short",
         )
     else:
         self.assertEqual(
             get_command('pytest'),
             "py.test --tb=short",
         )
Exemplo n.º 3
0
def run(runner, args):
    """
    Run test tests and prints out parsed output result in stdout.

    :param runner: Name of the runner to be used.
    :param args: List of command arguments for the test runner.
    """

    cmd = get_command(runner).split()
    cmd.extend(args)

    # Call tests runner with the current args
    p = subprocess.Popen(
        cmd,
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )
    stdout, stderr = p.communicate()

    # In python3, the byte array needs to be decoded back to a string
    if (sys.version_info > (3, 0)):
        stdout = stdout.decode()
        stderr = stderr.decode()

    output = "".join([stdout, stderr])

    parse = get_parse_function(runner)

    result = parse(output.splitlines())
    print("\n".join(result))
Exemplo n.º 4
0
def run(runner, args):
    """
    Run test tests and prints out parsed output result in stdout.

    :param runner: Name of the runner to be used.
    :param args: List of command arguments for the test runner.
    """

    cmd = get_command(runner).split()
    cmd.extend(args)

    # Call tests runner with the current args
    p = subprocess.Popen(
        cmd,
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )
    stdout, stderr = p.communicate()

    # In python3, the byte array needs to be decoded back to a string
    if (sys.version_info > (3, 0)):
        stdout = stdout.decode()
        stderr = stderr.decode()

    output = "".join([stdout, stderr])

    parse = get_parse_function(runner)

    result = parse(output.splitlines())
    print("\n".join(result))
Exemplo n.º 5
0
 def test_nose_command(self):
     self.assertEqual(
         get_command('nose'),
         "nosetests",
     )
 def test_nose_command(self):
     self.assertEqual(
         get_command('nose'),
         "nosetests",
     )