예제 #1
0
    def test_pytest_opts(self):
        tool, cmd, args, toolargs = parse_args(
            ["discover", "pytest", "--simple", "--no-hide-stdio", "--pretty",]
        )

        self.assertEqual(tool, "pytest")
        self.assertEqual(cmd, "discover")
        self.assertEqual(args, {"pretty": True, "hidestdio": False, "simple": True})
        self.assertEqual(toolargs, [])
예제 #2
0
    def test_pytest_default(self):
        tool, cmd, args, toolargs = parse_args([
            'discover',
            'pytest',
        ])

        self.assertEqual(tool, 'pytest')
        self.assertEqual(cmd, 'discover')
        self.assertEqual(args, {})
        self.assertEqual(toolargs, [])
예제 #3
0
 def test_unsupported_tool(self):
     with self.assertRaises(SystemExit):
         parse_args(["discover", "unittest"])
     with self.assertRaises(SystemExit):
         parse_args(["discover", "nose"])
     with self.assertRaises(SystemExit):
         parse_args(["discover", "???"])
예제 #4
0
 def test_unsupported_command(self):
     with self.assertRaises(SystemExit):
         parse_args(["run", "pytest"])
     with self.assertRaises(SystemExit):
         parse_args(["debug", "pytest"])
     with self.assertRaises(SystemExit):
         parse_args(["???", "pytest"])
예제 #5
0
 def test_unsupported_tool(self):
     with self.assertRaises(SystemExit):
         parse_args(['discover', 'unittest'])
     with self.assertRaises(SystemExit):
         parse_args(['discover', 'nose'])
     with self.assertRaises(SystemExit):
         parse_args(['discover', '???'])
예제 #6
0
 def test_unsupported_command(self):
     with self.assertRaises(SystemExit):
         parse_args(['run', 'pytest'])
     with self.assertRaises(SystemExit):
         parse_args(['debug', 'pytest'])
     with self.assertRaises(SystemExit):
         parse_args(['???', 'pytest'])
예제 #7
0
    def test_pytest_full(self):
        tool, cmd, args, toolargs = parse_args([
            'discover',
            'pytest',
            # no adapter-specific options yet
            '--',
            '--strict',
            '--ignore', 'spam,ham,eggs',
            '--pastebin=xyz',
            '--no-cov',
            '-d',
            ])

        self.assertEqual(tool, 'pytest')
        self.assertEqual(cmd, 'discover')
        self.assertEqual(args, {})
        self.assertEqual(toolargs, [
            '--',
            '--strict',
            '--ignore', 'spam,ham,eggs',
            '--pastebin=xyz',
            '--no-cov',
            '-d',
            ])
예제 #8
0
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# Replace the "." entry.
import os.path
import sys
sys.path[0] = os.path.dirname(
    os.path.dirname(
        os.path.abspath(__file__)))

from testing_tools.adapter.__main__ import parse_args, main


if __name__ == '__main__':
    tool, cmd, subargs, toolargs = parse_args()
    main(tool, cmd, subargs, toolargs)