Skip to content

Commit

Permalink
Move validate_solutions and add durations flag to pytest.ini (TheAlgo…
Browse files Browse the repository at this point in the history
…rithms#3704)

* Move PE validate_solutions to scripts/ directory

* Update pytest.ini file with durations settings

* Remove codespell and autoblack workflow file

* Dependent changes to test config files

* Update pytest.ini
  • Loading branch information
dhruvmanila authored Oct 24, 2020
1 parent 1cd8e68 commit b97529d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 48 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/autoblack.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/codespell.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/project_euler.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
on:
pull_request:
# only check if a file is changed within the project_euler directory
# only check if a file is changed within the project_euler directory and related files
paths:
- 'project_euler/**'
- '.github/workflows/project_euler.yml'
- 'scripts/validate_solutions.py'

name: 'Project Euler'

Expand All @@ -17,7 +18,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pytest pytest-cov
- run: pytest --doctest-modules --durations=10 --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
- run: pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
validate-solutions:
runs-on: ubuntu-latest
steps:
Expand All @@ -27,4 +28,4 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pytest
- run: pytest --durations=10 project_euler/validate_solutions.py
- run: pytest scripts/validate_solutions.py
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Build
install: pip install pytest-cov -r requirements.txt
script:
- pytest --doctest-modules --ignore=project_euler/ --durations=10 --cov-report=term-missing:skip-covered --cov=. .
- pytest --doctest-modules --ignore=project_euler/ --cov-report=term-missing:skip-covered --cov=. .
after_success:
- scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
notifications:
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
[pytest]
markers =
mat_ops: mark a test as utilizing matrix operations.
addopts = --durations=10
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import pytest

PROJECT_EULER_DIR_PATH = pathlib.Path.cwd().joinpath("project_euler")
PROJECT_EULER_ANSWERS_PATH = PROJECT_EULER_DIR_PATH.joinpath(
"project_euler_answers.json"
PROJECT_EULER_ANSWERS_PATH = pathlib.Path.cwd().joinpath(
"scripts", "project_euler_answers.json"
)

with open(PROJECT_EULER_ANSWERS_PATH) as file_handle:
Expand Down

0 comments on commit b97529d

Please sign in to comment.