Skip to content

Commit

Permalink
test update
Browse files Browse the repository at this point in the history
  • Loading branch information
dham committed Oct 25, 2023
1 parent 2b80e37 commit de6ef63
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/classroom/autograding.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"tests": [
{
"name": "setup",
"setup": "python3 -m pip install -U pip",
"run": "python3 -m pip install numpy setuptools pytest pytest-timeout flake8 pep8-naming flake8-docstrings",
"setup": "python3 -m venv venv",
"run": "venv/bin/python -m pip install numpy pytest pytest-timeout flake8 pep8-naming flake8-docstrings",
"input": "",
"output": "",
"comparison": "included",
Expand All @@ -13,7 +13,7 @@
{
"name": "package-install",
"setup": "",
"run": "python3 -m pip install -e .",
"run": "venv/bin/python -m pip install -e .",
"input": "",
"output": "",
"comparison": "included",
Expand All @@ -23,7 +23,7 @@
{
"name": "exercise-5-4",
"setup": "",
"run": "python3 -m pytest tests/test_exercise_5_4.py",
"run": "venv/bin/python -m pytest tests/test_exercise_5_4.py",
"input": "",
"output": "",
"comparison": "included",
Expand All @@ -33,7 +33,7 @@
{
"name": "exercise-5-5",
"setup": "",
"run": "python3 -m pytest tests/test_exercise_5_5.py",
"run": "venv/bin/python -m pytest tests/test_exercise_5_5.py",
"input": "",
"output": "",
"comparison": "included",
Expand All @@ -43,7 +43,7 @@
{
"name": "exercise-5-6",
"setup": "",
"run": "python3 -m pytest tests/test_exercise_5_6.py",
"run": "venv/bin/python -m pytest tests/test_exercise_5_6.py",
"input": "",
"output": "",
"comparison": "included",
Expand All @@ -53,7 +53,7 @@
{
"name": "flake8-test",
"setup": "",
"run": "python3 -m flake8 adt_examples/",
"run": "venv/bin/python -m flake8 adt_examples/",
"input": "",
"output": "",
"comparison": "included",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/classroom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
name: Autograding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: education/autograding@v1
1 change: 0 additions & 1 deletion conftest.py

This file was deleted.

11 changes: 11 additions & 0 deletions tests/test_exercise_5_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ def test_pointers(idx, iterated, base_data):
assert np.array_equal([q for q in Q], iterated)


@pytest.mark.parametrize("idx, iterated", [
(0, [15, 20, 25, 35, 40]),
(1, ['n+3', 'n+2', 'n', 'n+4'])
])
def test_double_iterate(idx, iterated, base_data):
Q = base_data[idx]
assert np.array_equal([(q, r) for q in Q for r in Q],
[(q, r) for q in iterated for r in iterated])



def test_mem_leakage():
Q = Deque(2)
Q.append(1)
Expand Down

0 comments on commit de6ef63

Please sign in to comment.