Use argparse mutually_exclusive_group for --config-file and --config-data
This does the same as your solution 😉
This commit is contained in:
@@ -145,8 +145,11 @@ class CommandLineTestCase(unittest.TestCase):
|
||||
|
||||
out, err = sys.stdout.getvalue(), sys.stderr.getvalue()
|
||||
self.assertEqual(out, '')
|
||||
self.assertRegexpMatches(err, r'^Options --config-file and '
|
||||
r'--config-data cannot be used')
|
||||
self.assertRegexpMatches(
|
||||
err.splitlines()[-1],
|
||||
r'^yamllint: error: argument -d\/--config-data: '
|
||||
r'not allowed with argument -c\/--config-file$'
|
||||
)
|
||||
|
||||
def test_run_with_bad_config(self):
|
||||
sys.stdout, sys.stderr = StringIO(), StringIO()
|
||||
|
||||
Reference in New Issue
Block a user