Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport] Print installed packages in pytest #3065

Merged
merged 1 commit into from Feb 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/conftest.py
@@ -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'])