diff --git a/.github/workflows/classroom.yml b/.github/workflows/classroom.yml index eb8abe7..5cc9d1e 100644 --- a/.github/workflows/classroom.yml +++ b/.github/workflows/classroom.yml @@ -18,8 +18,8 @@ jobs: uses: classroom-resources/autograding-command-grader@v1 with: test-name: test code formatting - setup-command: '' - command: python -m pytest + setup-command: 'pip install -r requirements.txt' + command: python -m pytest -m "not skipautograding" timeout: 10 - name: Autograding Reporter uses: classroom-resources/autograding-grading-reporter@v1 diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..0b37e4f --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +markers = + skipautograding: disable tests for autograding since environment is not consistent \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index fe3757d..12a4f25 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ pytest black -flake8 \ No newline at end of file +flake8 +flake8-nb \ No newline at end of file diff --git a/tests/test_linter_formatter.py b/tests/test_linter_formatter.py index afe60d8..56d1bea 100644 --- a/tests/test_linter_formatter.py +++ b/tests/test_linter_formatter.py @@ -1,6 +1,7 @@ import os import re import subprocess +import pytest from pathlib import Path @@ -23,6 +24,7 @@ def test_flake8(): print("No stylistic errors found!") assert failure == 0 +@pytest.mark.skipautograding def test_flake8_nb(): # Get the repository directory current_dir = Path(__file__).resolve().parents[1]