Skip to content

Commit

Permalink
Merge pull request #3065 from kmaehashi/bp-2979-v7-test-print-install…
Browse files Browse the repository at this point in the history
…ed-packages

[backport] Print installed packages in pytest
  • Loading branch information
mergify[bot] committed Feb 13, 2020
2 parents 319ff38 + f3626d6 commit cbc9514
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import subprocess
import sys


def _is_pip_installed():
try:
import pip # NOQA
return True
except ImportError:
return False


def _is_in_ci():
ci_name = os.environ.get('CUPY_CI', '')
return ci_name != ''


def pytest_configure(config):
# Print installed packages
if _is_in_ci() and _is_pip_installed():
print("***** Installed packages *****", flush=True)
subprocess.check_call([sys.executable, '-m', 'pip', 'freeze', '--all'])

0 comments on commit cbc9514

Please sign in to comment.