diff --git a/.github/classroom/autograding.json b/.github/classroom/autograding.json index 8c381f5..568eeff 100644 --- a/.github/classroom/autograding.json +++ b/.github/classroom/autograding.json @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/.github/workflows/classroom.yml b/.github/workflows/classroom.yml index 8e05703..3142cbe 100644 --- a/.github/workflows/classroom.yml +++ b/.github/workflows/classroom.yml @@ -7,5 +7,5 @@ name: Autograding runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: education/autograding@v1 diff --git a/conftest.py b/conftest.py deleted file mode 100644 index 8b13789..0000000 --- a/conftest.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/test_exercise_5_6.py b/tests/test_exercise_5_6.py index c482b23..737fedf 100644 --- a/tests/test_exercise_5_6.py +++ b/tests/test_exercise_5_6.py @@ -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)