Skip to content

Commit b97529d

Browse files
authored
Move validate_solutions and add durations flag to pytest.ini (TheAlgorithms#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
1 parent 1cd8e68 commit b97529d

7 files changed

+8
-48
lines changed

.github/workflows/autoblack.yml

-25
This file was deleted.

.github/workflows/codespell.yml

-17
This file was deleted.

.github/workflows/project_euler.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
on:
22
pull_request:
3-
# only check if a file is changed within the project_euler directory
3+
# only check if a file is changed within the project_euler directory and related files
44
paths:
55
- 'project_euler/**'
66
- '.github/workflows/project_euler.yml'
7+
- 'scripts/validate_solutions.py'
78

89
name: 'Project Euler'
910

@@ -17,7 +18,7 @@ jobs:
1718
run: |
1819
python -m pip install --upgrade pip
1920
python -m pip install --upgrade pytest pytest-cov
20-
- run: pytest --doctest-modules --durations=10 --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
21+
- run: pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
2122
validate-solutions:
2223
runs-on: ubuntu-latest
2324
steps:
@@ -27,4 +28,4 @@ jobs:
2728
run: |
2829
python -m pip install --upgrade pip
2930
python -m pip install --upgrade pytest
30-
- run: pytest --durations=10 project_euler/validate_solutions.py
31+
- run: pytest scripts/validate_solutions.py

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: Build
1010
install: pip install pytest-cov -r requirements.txt
1111
script:
12-
- pytest --doctest-modules --ignore=project_euler/ --durations=10 --cov-report=term-missing:skip-covered --cov=. .
12+
- pytest --doctest-modules --ignore=project_euler/ --cov-report=term-missing:skip-covered --cov=. .
1313
after_success:
1414
- scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
1515
notifications:

pytest.ini

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
[pytest]
33
markers =
44
mat_ops: mark a test as utilizing matrix operations.
5+
addopts = --durations=10
File renamed without changes.

project_euler/validate_solutions.py scripts/validate_solutions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import pytest
99

1010
PROJECT_EULER_DIR_PATH = pathlib.Path.cwd().joinpath("project_euler")
11-
PROJECT_EULER_ANSWERS_PATH = PROJECT_EULER_DIR_PATH.joinpath(
12-
"project_euler_answers.json"
11+
PROJECT_EULER_ANSWERS_PATH = pathlib.Path.cwd().joinpath(
12+
"scripts", "project_euler_answers.json"
1313
)
1414

1515
with open(PROJECT_EULER_ANSWERS_PATH) as file_handle:

0 commit comments

Comments
 (0)