test_ros_pytest.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 import pytest
3 
4 import ros_pytest
5 
6 
8  output = ros_pytest.get_output_file(['runner.py', '--gtest_output=xml:~/junit_output.xml'])
9 
10  assert output == '~/junit_output.xml'
11 
12 
15  'runner.py', '--gtest_output=xml:~/junit_output.xml',
16  '--ignore=some_tests', '__name:=test_lib',
17  ])
18 
19  assert output == ['--ignore=some_tests']
20 
21 
23  with pytest.raises(RuntimeError):
24  ros_pytest.get_output_file(['main.py', '--file', 'random.txt'])
25 
26 
28  args = ros_pytest.create_cache_dir_args("3.0.1", "/tmp/output_file.xml")
29 
30  assert args == ['-p', 'no:cacheprovider']
31 
32 
34  args = ros_pytest.create_cache_dir_args("3.5.0", "/tmp/output_file.xml")
35 
36  assert args == ['--rootdir=/tmp']
test_ros_pytest.test_rootdir_is_set_for_newer_pytest_versions
def test_rootdir_is_set_for_newer_pytest_versions()
Definition: test_ros_pytest.py:33
test_ros_pytest.test_additional_args_are_correctly_extracted_from_argv
def test_additional_args_are_correctly_extracted_from_argv()
Definition: test_ros_pytest.py:13
test_ros_pytest.test_output_file_is_correctly_extracted_from_argv
def test_output_file_is_correctly_extracted_from_argv()
Definition: test_ros_pytest.py:7
test_ros_pytest.test_not_passing_output_file_throws_runtime_error
def test_not_passing_output_file_throws_runtime_error()
Definition: test_ros_pytest.py:22
test_ros_pytest.test_caching_is_disabled_for_older_pytest_versions
def test_caching_is_disabled_for_older_pytest_versions()
Definition: test_ros_pytest.py:27
ros_pytest.create_cache_dir_args
def create_cache_dir_args(version, output_file)
Definition: __init__.py:27
ros_pytest.get_additional_args
def get_additional_args(argv)
Definition: __init__.py:16
ros_pytest.get_output_file
def get_output_file(argv)
Definition: __init__.py:8


ros_pytest
Author(s):
autogenerated on Wed Mar 8 2023 03:16:33