-
-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] setup pytest on existing samples (#124)
* fix: load answer key from image with working samples * fix: pytests set up with snapshots for all samples * fix: run sample1 on pre-commit; run all tests on pre-push fix: add default_install_hook_types fix: add explicit stages * fix: update snapshots * fix: bug fixes * [Feature] Simplify template jsons (#127) * fix: update snapshots feat: simplify template schema and block logic; consume it; use fields terminology; update all samples fix: bug fixes * fix: refactor template.py; minor template json cleanup * fix: changes after updating wiki * feat: setup tests for template validations; fixed few bugs fix: renaming fix: test * fix: refactor fix: refactor tests structure and add utils * fix: minor fixes * fix: reorder imports; rename question -> field * fix: review changes * fix: remove streak logic
- Loading branch information
1 parent
b2f394b
commit 426b7a6
Showing
60 changed files
with
2,220 additions
and
3,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,52 @@ | ||
exclude: "__snapshots__/.*$" | ||
default_install_hook_types: [pre-commit, pre-push] | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
stages: [commit] | ||
- id: end-of-file-fixer | ||
exclude_types: ["csv", "json"] | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pycqa/isort | ||
stages: [commit] | ||
- id: trailing-whitespace | ||
stages: [commit] | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.5.4 | ||
hooks: | ||
- id: isort | ||
- id: isort | ||
args: ["--profile", "black"] | ||
- repo: https://github.com/psf/black | ||
stages: [commit] | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
- id: black | ||
stages: [commit] | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.7.9 | ||
hooks: | ||
- id: flake8 | ||
- id: flake8 | ||
args: | ||
- "F401,F841" # unused imports, unused variables | ||
- "--ignore=E501,W503,E203,E741" # Line too long, Line break occurred before a binary operator, Whitespace before ':' | ||
- "F401,F841" # unused imports, unused variables | ||
- "--ignore=E501,W503,E203,E741" # Line too long, Line break occurred before a binary operator, Whitespace before ':' | ||
stages: [commit] | ||
- repo: local | ||
hooks: | ||
- id: pytest-on-commit | ||
name: Running single sample test | ||
entry: pytest -k sample1 | ||
language: system | ||
pass_filenames: false | ||
always_run: true | ||
fail_fast: true | ||
stages: [commit] | ||
- repo: local | ||
hooks: | ||
- id: pytest-on-push | ||
name: Running all tests before push... | ||
entry: pytest | ||
language: system | ||
pass_filenames: false | ||
always_run: true | ||
fail_fast: true | ||
stages: [push] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# pytest.ini | ||
[pytest] | ||
minversion = 7.0 | ||
addopts = -qq --capture=no | ||
testpaths = | ||
src/tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
-r requirements.txt | ||
pre-commit | ||
pytest>=7.1.3 | ||
pytest-mock>=3.10.0 | ||
syrupy>=3.0.6 | ||
freezegun>=1.2.2 | ||
pre-commit>=2.20.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.