Please describe the behavior you are expecting
What is the current behavior?
Assign output of command to a variable, then use the variable. Needs $<); \ to pipe the output and concatenate the subsequent line, since each line is executed in a separate shell.
# Usage: make db-upgrade-gcp environment=dev
db-upgrade-gcp:
TOKEN=$$(gcloud auth print-identity-token $<); \
python bin/db_upgrade_gcp.py $(environment) --gcp_token $$TOKENAdapted from https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option
Add the following to conftest.py:
import pytestBasic example:
import os
os.system("python --version")Better, since stdout and return codes aren't easily processed when using os.system:
| import os | |
| import sys | |
| def progressbar(it, prefix="", file=sys.stdout): | |
| count = len(it) | |
| num_bar_chars = 5 | |
| width = os.get_terminal_size().columns - ( | |
| len(prefix) + len(str(count)) * 2 + num_bar_chars | |
| ) |
| # Outside top right | |
| l1 = plt.legend(bbox_to_anchor=(1.04,1), borderaxespad=0) | |
| # Outside bottom right | |
| l2 = plt.legend(bbox_to_anchor=(1.04,0), loc="lower left", borderaxespad=0) | |
| # Outside center right | |
| l3 = plt.legend(bbox_to_anchor=(1.04,0.5), loc="center left", borderaxespad=0) | |
| # Outside top single row | |
| l4 = plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc="lower left", | |
| mode="expand", borderaxespad=0, ncol=3) | |
| # Outside bottom right |