From 22b8aea1590be54f40a11328eb4043cc30de4813 Mon Sep 17 00:00:00 2001 From: Kevin Lu Date: Sat, 21 Oct 2023 14:53:54 -0700 Subject: [PATCH 1/2] Update sweep.yaml --- sweep.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sweep.yaml b/sweep.yaml index 2be7e55..1057f89 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -10,6 +10,8 @@ rules: - "There should be no unused imports or variables." - "Code should be properly commented and include docstrings for functions and classes." +repo_description: "Use pytest to write unit tests." + # This is the branch that Sweep will develop from and make pull requests to. Most people use 'main' or 'master' but some users also use 'dev' or 'staging'. branch: 'main' From 759168c2de8a203dad8bfa0199dced514dd78938 Mon Sep 17 00:00:00 2001 From: William Zeng <44910023+wwzeng1@users.noreply.github.com> Date: Sun, 22 Oct 2023 16:14:59 -0700 Subject: [PATCH 2/2] Create pytest.yml --- .github/workflows/pytest.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..0ba31fa --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,35 @@ +name: Pytest + +on: [push] + +jobs: + pytest: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Python 3.x + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + # Caching Poetry dependencies + - name: Cache Poetry dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-poetry- + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + + - name: Install Dependencies + run: | + poetry install + + - name: Run Pytest + run: poetry run pytest