def upload_codecov(self) -> None: run( """ curl -s https://codecov.io/bash | bash -s -- \ -t "${CODECOV_TOKEN}" \ -n "${CIRCLE_BUILD_NUM}" \ -f "./workspace/cov.xml" \ -Z """ )
def test_exceptions(self, capsys): with pytest.raises(SystemExit) as e: run( """ echo "test1" echo "throws error" && missing_command echo "test2" """ ) out, err = capsys.readouterr() assert "missing_command: command not found\r\n" in out assert e.value.code == 127
def test_multine_command(self): result = run( """ export VAR1=123 echo "test \\ blabla" echo "test\\ $VAR1" """ ) assert len(result) == 2 assert result[0] == "test blabla" assert result[1] == "test123"
def test_run_multiple_results(self, capsys): result = run( """ export VAR1=123 echo "test" echo "test$VAR1" """ ) assert len(result) == 2 assert result[0] == "test" assert result[1] == "test123" assert capsys.readouterr().out == "test\r\ntest123\r\n"
def mypy(self) -> None: run("mypy .")
def isort(self) -> None: run("isort .")
def black(self) -> None: self.isort() run("black .")
def mypy(self) -> None: logger.info("Running mypy") run("mypy envo")
def test_run_simple_echo(self, capsys): result = run('echo "test"', print_output=False) assert len(result) == 1 assert result[0] == "test" assert capsys.readouterr().out == ""
def test(self) -> None: logger.info("Running tests", print_msg=True) run("pytest --reruns 3 -v tests --cov-report xml:workspace/cov.xml --cov=stickybeak ./workspace")
def bootstrap(self) -> None: run("mkdir -p workspace") super().bootstrap()
def test(self) -> None: logger.info("Running tests") run("mkdir -p workspace") run("pytest -v tests --cov-report xml:workspace/cov.xml --cov=envo ./workspace")
def bootstrap(self) -> None: run(f"pip install pip=={self.pip_version}") run(f"pip install poetry=={self.poetry_version}") run("poetry config virtualenvs.create true") run("poetry config virtualenvs.in-project true") run("poetry install --no-root") os.chdir(self.django_srv_dir) run("poetry config virtualenvs.create true") run("poetry config virtualenvs.in-project true") run("poetry install --no-root") os.chdir(self.flask_srv_dir) run("poetry config virtualenvs.create true") run("poetry config virtualenvs.in-project true") run("poetry install --no-root")
def clean(self) -> None: run("rm **/*/__pycache__ -rf") run("rm **/*/.eggs -rf") run("rm **/*/*.egg-info -rf") run("rm **/*/*.egg-info -rf")
def test(self) -> None: run("pytest -v tests")
def __flake(self) -> None: run("circleci local execute --job flake8")
def build(self) -> None: run("poetry build")
def test_run_simple_echo_print(self, capsys): result = run('echo "test"', print_output=True) assert capsys.readouterr().out == "test\r\n" assert result[0] == "test"
def publish(self) -> None: run("poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD")
def test(self) -> None: logger.info("Running tests") run("pytest tests -v")
def flake(self) -> None: self.black() run("flake8 .")
def test_ignore_errors(self): result = run("""non_existend_command""", ignore_errors=True) assert len(result) == 1 assert "non_existend_command: command not found" in result[0]
def flake(self) -> None: logger.info("Running flake8") run("black .", print_output=False) run("flake8")