Skip to content

Commit

Permalink
Check Python 3.12 & 3.13 in CI pipeline (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C authored Jan 20, 2025
1 parent 2e8eadd commit bf88c71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
Expand All @@ -26,7 +26,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install --upgrade . -r dev-requirements.txt
- name: Execute all pre-commit hooks on all files
- name: Execute all pre-commit hooks on all files 🔎
run: pre-commit run --all-files
- name: Running tests ☑
run: pytest
11 changes: 2 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: remove-crlf
- id: remove-tabs
- id: chmod
args: ['644']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -25,10 +25,3 @@ repos:
entry: pylint
files: \.py$
exclude: ^tests/resources/.*(init_with_license|todo)
- id: pytest
name: pytest
language: python
entry: pytest -sv
require_serial: true
pass_filenames: false
files: \.py$
12 changes: 6 additions & 6 deletions tests/safety_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ def test_full_report(tmpdir, report, capfd):
@pytest.mark.parametrize(
"args",
[
["--ignore=37055,37071,38834,43975,61601,61893"],
['--ignore=37055', '--ignore=37071', '--ignore=38834', '--ignore=43975', '--ignore=61601', '--ignore=61893'],
["--ignore=37055,37071,38834,43975,61601,61893,71562,71608"],
['--ignore=37055', '--ignore=37071', '--ignore=38834', '--ignore=43975', '--ignore=61601', '--ignore=61893', '--ignore=71562', '--ignore=71608'],
]
)
def test_ignore_ok(tmpdir, args):
def test_ignore_ok(capfd, tmpdir, args):
requirements_file = tmpdir.join('requirements.txt')
requirements_file.write('urllib3==1.24.1')
assert safety([str(requirements_file)] + args) == 0
assert safety([str(requirements_file)] + args) == 0, capfd.readouterr()

@pytest.mark.parametrize(
"ignore_arg,status",
[
("--ignore=37055,37071,38834,43975,61601,61893", 0),
("--ignore=37055,37071,38834", EXIT_CODE_VULNERABILITIES_FOUND),
("--ignore=37055,37071,38834,43975,61601,61893,71562,71608", 0),
("--ignore=37055,37071,38834,43975,61601,61893,71562", EXIT_CODE_VULNERABILITIES_FOUND),
("--ignore=37055", EXIT_CODE_VULNERABILITIES_FOUND),
("--ignore=37071", EXIT_CODE_VULNERABILITIES_FOUND),
("--ignore=38834", EXIT_CODE_VULNERABILITIES_FOUND),
Expand Down

0 comments on commit bf88c71

Please sign in to comment.