Exemplo n.º 1
0
 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
         """
     )
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
 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"
Exemplo n.º 4
0
    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"
Exemplo n.º 5
0
 def mypy(self) -> None:
     run("mypy .")
Exemplo n.º 6
0
 def isort(self) -> None:
     run("isort .")
Exemplo n.º 7
0
 def black(self) -> None:
     self.isort()
     run("black .")
Exemplo n.º 8
0
 def mypy(self) -> None:
     logger.info("Running mypy")
     run("mypy envo")
Exemplo n.º 9
0
 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 == ""
Exemplo n.º 10
0
 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")
Exemplo n.º 11
0
 def bootstrap(self) -> None:
     run("mkdir -p workspace")
     super().bootstrap()
Exemplo n.º 12
0
 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")
Exemplo n.º 13
0
    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")
Exemplo n.º 14
0
 def clean(self) -> None:
     run("rm **/*/__pycache__ -rf")
     run("rm **/*/.eggs -rf")
     run("rm **/*/*.egg-info -rf")
     run("rm **/*/*.egg-info -rf")
Exemplo n.º 15
0
 def test(self) -> None:
     run("pytest -v tests")
Exemplo n.º 16
0
 def __flake(self) -> None:
     run("circleci local execute --job flake8")
Exemplo n.º 17
0
 def build(self) -> None:
     run("poetry build")
Exemplo n.º 18
0
 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"
Exemplo n.º 19
0
 def publish(self) -> None:
     run("poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD")
Exemplo n.º 20
0
 def test(self) -> None:
     logger.info("Running tests")
     run("pytest tests -v")
Exemplo n.º 21
0
 def flake(self) -> None:
     self.black()
     run("flake8 .")
Exemplo n.º 22
0
 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]
Exemplo n.º 23
0
 def flake(self) -> None:
     logger.info("Running flake8")
     run("black .", print_output=False)
     run("flake8")