Phil Dawson pushed to branch phil/plugin-testing-api at BuildStream / buildstream
Commits:
2 changed files:
Changes:
| 1 | 1 |
import os
|
| 2 | 2 |
|
| 3 |
-from buildstream import _yaml
|
|
| 4 |
- |
|
| 5 | 3 |
|
| 6 | 4 |
# Return a list of files relative to the given directory
|
| 7 | 5 |
def walk_dir(root):
|
| ... | ... | @@ -24,6 +22,6 @@ def walk_dir(root): |
| 24 | 22 |
def assert_contains(directory, expected):
|
| 25 | 23 |
missing = set(expected)
|
| 26 | 24 |
missing.difference_update(walk_dir(directory))
|
| 27 |
- if len(missing) > 0:
|
|
| 25 |
+ if missing:
|
|
| 28 | 26 |
raise AssertionError("Missing {} expected elements from list: {}"
|
| 29 | 27 |
.format(len(missing), missing))
|
| ... | ... | @@ -5,7 +5,6 @@ import shutil |
| 5 | 5 |
import tempfile
|
| 6 | 6 |
import itertools
|
| 7 | 7 |
import traceback
|
| 8 |
-import subprocess
|
|
| 9 | 8 |
from contextlib import contextmanager, ExitStack
|
| 10 | 9 |
from ruamel import yaml
|
| 11 | 10 |
import pytest
|
| ... | ... | @@ -327,7 +326,7 @@ class Cli(): |
| 327 | 326 |
|
| 328 | 327 |
return result
|
| 329 | 328 |
|
| 330 |
- def invoke(self, cli, args=None, color=False, binary_capture=False, **extra):
|
|
| 329 |
+ def invoke(self, bst_cli, args=None, color=False, binary_capture=False, **extra):
|
|
| 331 | 330 |
exc_info = None
|
| 332 | 331 |
exception = None
|
| 333 | 332 |
exit_code = 0
|
| ... | ... | @@ -342,7 +341,7 @@ class Cli(): |
| 342 | 341 |
capture.start_capturing()
|
| 343 | 342 |
|
| 344 | 343 |
try:
|
| 345 |
- cli.main(args=args or (), prog_name=cli.name, **extra)
|
|
| 344 |
+ bst_cli.main(args=args or (), prog_name=bst_cli.name, **extra)
|
|
| 346 | 345 |
except SystemExit as e:
|
| 347 | 346 |
if e.code != 0:
|
| 348 | 347 |
exception = e
|
| ... | ... | @@ -355,7 +354,7 @@ class Cli(): |
| 355 | 354 |
sys.stdout.write(str(exit_code))
|
| 356 | 355 |
sys.stdout.write('\n')
|
| 357 | 356 |
exit_code = 1
|
| 358 |
- except Exception as e:
|
|
| 357 |
+ except Exception as e: #pylint: disable=broad-except
|
|
| 359 | 358 |
exception = e
|
| 360 | 359 |
exit_code = -1
|
| 361 | 360 |
exc_info = sys.exc_info()
|
