# Path: stestr/commands/run.py
# def _to_int(possible, default=0, out=sys.stderr):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _find_failing(repo):
#     def gather_errors(test_dict):
# def run_command(config='.stestr.conf', repo_type='file',
#                 repo_url=None, test_path=None, top_dir=None, group_regex=None,
#                 failing=False, serial=False, concurrency=0, load_list=None,
#                 subunit_out=False, until_failure=False,
#                 analyze_isolation=False, isolated=False, worker_path=None,
#                 exclude_list=None,
#                 include_list=None,
#                 exclude_regex=None, no_discover=False,
#                 random=False, combine=False, filters=None, pretty_out=True,
#                 color=False, stdout=sys.stdout, abbreviate=False,
#                 suppress_attachments=False, all_attachments=False,
#                 show_binary_attachments=True, pdb=False):
#         def run_tests():
# def _run_tests(cmd, until_failure,
#                subunit_out=False, combine_id=None, repo_type='file',
#                repo_url=None, pretty_out=True, color=False, stdout=sys.stdout,
#                abbreviate=False, suppress_attachments=False,
#                all_attachments=False, show_binary_attachments=False):
#         def run_tests():
# class Run(command.Command):
# 
# Path: stestr/tests/base.py
# class TestCase(testtools.TestCase):
#     def setUp(self):


import io
from stestr.commands import run
from stestr.tests import base
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.




class TestRunCommand(base.TestCase):
    def test_to_int_positive_int(self):
        self.assertEqual(29, run._to_int(29))

    def test_to_int_positive_int_str(self):
        self.assertEqual(42, run._to_int('42'))

    def test_to_int_negative_int(self):
        self.assertEqual(-2, run._to_int(-2))

    def test_to_int_negative_int_str(self):
        self.assertEqual(-45, run._to_int('-45'))

    def test_to_int_invalid_str(self):
        fake_stderr = io.StringIO()

# Path: stestr/commands/run.py
# def _to_int(possible, default=0, out=sys.stderr):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# def _find_failing(repo):
#     def gather_errors(test_dict):
# def run_command(config='.stestr.conf', repo_type='file',
#                 repo_url=None, test_path=None, top_dir=None, group_regex=None,
#                 failing=False, serial=False, concurrency=0, load_list=None,
#                 subunit_out=False, until_failure=False,
#                 analyze_isolation=False, isolated=False, worker_path=None,
#                 exclude_list=None,
#                 include_list=None,
#                 exclude_regex=None, no_discover=False,
#                 random=False, combine=False, filters=None, pretty_out=True,
#                 color=False, stdout=sys.stdout, abbreviate=False,
#                 suppress_attachments=False, all_attachments=False,
#                 show_binary_attachments=True, pdb=False):
#         def run_tests():
# def _run_tests(cmd, until_failure,
#                subunit_out=False, combine_id=None, repo_type='file',
#                repo_url=None, pretty_out=True, color=False, stdout=sys.stdout,
#                abbreviate=False, suppress_attachments=False,
#                all_attachments=False, show_binary_attachments=False):
#         def run_tests():
# class Run(command.Command):
# 
# Path: stestr/tests/base.py
# class TestCase(testtools.TestCase):
#     def setUp(self):


# Path: stestr/tests/test_run.py
import io
from stestr.commands import run
from stestr.tests import base

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.




class TestRunCommand(base.TestCase):
    def test_to_int_positive_int(self):
        self.assertEqual(29, run._to_int(29))

    def test_to_int_positive_int_str(self):
        self.assertEqual(42, run._to_int('42'))

    def test_to_int_negative_int(self):
        self.assertEqual(-2, run._to_int(-2))

    def test_to_int_negative_int_str(self):
        self.assertEqual(-45, run._to_int('-45'))

    def test_to_int_invalid_str(self):
        fake_stderr = io.StringIO()

        out = run._to_int('I am not an int', out=fake_stderr)