Skip to content

Commit

Permalink
Merge pull request #2979 from niboshi/test-print-installed-packages
Browse files Browse the repository at this point in the history
Print installed packages in pytest
  • Loading branch information
kmaehashi committed Feb 12, 2020
1 parent 319ff38 commit f3626d6
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 f3626d6

Please sign in to comment.