running tests in parallel with `tox p` fails
Running tests in parallel with tox p fails, meaning I have to run all local test envs serially right now. It seems that the detected terminal environment is different in parallel mode, causing the pager tests to fail.
FAILED tests/test_utils.py::test_echo_via_pager[test0-cat] - AssertionError: Unexpected pager output in test case 'Plain string argument'
Shouldn't it fail? Don't some test s use click's testing which is not thread safe.
It worked until the changes to the pager, and only fail on the pager test. I made sure everything ran correctly with tox p in all projects, it makes pre-checking a PR way faster.
I agree. What did you do? I was just planning on looking some tests
There are multiple instances of this:
def test_file_args(runner):
@click.command()
@click.argument("input", type=click.File("rb"))
@click.argument("output", type=click.File("wb"))
def inout(input, output):
while True:
chunk = input.read(1024)
if not chunk:
break
output.write(chunk)
with runner.isolated_filesystem():
result = runner.invoke(inout, ["-", "hello.txt"], input="Hey!")
assert result.output == ""
assert result.exit_code == 0
with open("hello.txt", "rb") as f:
assert f.read() == b"Hey!"
result = runner.invoke(inout, ["hello.txt", "-"])
assert result.output == "Hey!"
assert result.exit_code == 0
Seems like the isolated_filesystem() would not be thread safe.