d5c3fb3 When tox fails, print tox output before failing

Authored and Committed by churchyard 4 years ago
    When tox fails, print tox output before failing
    
    Previously, it wasn't possible to see why tox failed:
    
    ...
    Requirement satisfied: tox-current-env >= 0.0.2
       (installed: tox-current-env 0.0.2)
    Traceback (most recent call last):
      File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 269, in main
        generate_requires(
      File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 221, in generate_requires
        generate_tox_requirements(toxenv, requirements)
      File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 184, in generate_tox_requirements
        r = subprocess.run(
      File "/usr/lib64/python3.8/subprocess.py", line 512, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['tox', '--print-deps-to-file', '/tmp/tmp96smu4rv', '-qre', 'py38']' returned non-zero exit status 1.
    
    Now it is:
    
    ...
    Requirement satisfied: tox-current-env >= 0.0.2
       (installed: tox-current-env 0.0.2)
    ERROR: tox config file (either pyproject.toml, tox.ini, setup.cfg) not found
    Traceback (most recent call last):
      File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 270, in main
        generate_requires(
      File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 222, in generate_requires
        generate_tox_requirements(toxenv, requirements)
      File "/usr/lib/rpm/redhat/pyproject_buildrequires.py", line 193, in generate_tox_requirements
        r.check_returncode()
      File "/usr/lib64/python3.8/subprocess.py", line 444, in check_returncode
        raise CalledProcessError(self.returncode, self.args, self.stdout,
    subprocess.CalledProcessError: Command '['tox', '--print-deps-to-file', '/tmp/tmpwp8sffv1', '-qre', 'py38']' returned non-zero exit status 1.
    
    Inspired by https://src.fedoraproject.org/rpms/python-chaospy/pull-request/1#comment-32750
    
        
file modified
+4 -1
file modified
+3 -2