Skip to content

Commit

Permalink
Merge pull request #23 from nbehrnd/master
Browse files Browse the repository at this point in the history
fix: corrections and edits on pytests installed
  • Loading branch information
nbehrnd authored Nov 12, 2024
2 parents 2b13f3b + 781ba79 commit 3b82ea4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 54 deletions.
63 changes: 13 additions & 50 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI_pytest_appendfilename
# name : pytest.yml
# purpose : regularly run pytest on appendfilename
# date : [2024-10-31 Thu]
# edit : [2024-10-31 Thu]
# edit : [2024-11-12 Tue]

on:
push:
Expand All @@ -17,9 +17,17 @@ on:
# - cron: "0 0 1 * *" # once each 1st of a month, at 00:00 UTC (cf. https://crontab.guru/)

jobs:
test-ubuntu-2404:
runs-on: ubuntu-24.04
timeout-minutes: 5
test:
strategy:
matrix:
# for a factorial test, an explicit selection of GitHUb runner images
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
# state of commit 23478d3 as visited on 2024-11-11 Mon
os: [ubuntu-20.04, ubuntu-22.04,ubuntu-24.04, windows-2019, windows-2022, macos-14]
python-version: ["3.10", "3.12"]
runs-on: ${{ matrix.os }}

timeout-minutes: 5 # Timeout for each job individually

steps:
- uses: actions/checkout@v4
Expand All @@ -28,52 +36,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies with PyPI
run: pip install -r requirements.txt

- name: run the check by pytest
run: |
python -m pytest -m "default"
python -m pytest -m "prepend"
python -m pytest -m "smart"
test-windows-2022:
runs-on: windows-2022
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
# by [2024-10-23 Wed], this version possibly will be considered "old", cf.
# https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies with PyPI
run: pip install -r requirements.txt

- name: run the check by pytest
run: |
python -m pytest -m "default"
python -m pytest -m "prepend"
python -m pytest -m "smart"
test-macos-14:
runs-on: macos-14
timeout-minutes: 5

steps:
- uses: actions/checkout@v4
# by [2024-10-23 Wed], this version possibly will be considered "old", cf.
# https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

- uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: ${{ matrix.python-version }}

- name: Install dependencies with PyPI
run: pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
Markers =
markers =
default: appendfilename's default string insertions
prepend: appendfilename's optional -p/--prepend flag
smart: appendfilename's optional --smart-prepend flag
2 changes: 1 addition & 1 deletion test_appendfilename.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def test_smart_prepend(arg1, arg2, arg3):
old_filename_no_timestamp = old_filename[8:]

# pattern `--short` # currently fails
elif re.search(r"^\d{4}[012]\d[012]\d", old_filename):
elif re.search(r"^\d{4}[012]\d[0-3]\d", old_filename):
time_stamp = old_filename[:6]
time_stamp_separator = old_filename[6]
old_filename_no_timestamp = old_filename[7:]
Expand Down
4 changes: 2 additions & 2 deletions test_generator.org
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pytest-3 test_appendfilename.py -m "default and prepend" -v

#+begin_src shell :tangle pytest.ini
[pytest]
Markers =
markers =
default: appendfilename's default string insertions
prepend: appendfilename's optional -p/--prepend flag
smart: appendfilename's optional --smart-prepend flag
Expand Down Expand Up @@ -467,7 +467,7 @@ def test_smart_prepend(arg1, arg2, arg3):
old_filename_no_timestamp = old_filename[8:]

# pattern `--short` # currently fails
elif re.search(r"^\d{4}[012]\d[012]\d", old_filename):
elif re.search(r"^\d{4}[012]\d[0-3]\d", old_filename):
time_stamp = old_filename[:6]
time_stamp_separator = old_filename[6]
old_filename_no_timestamp = old_filename[7:]
Expand Down

0 comments on commit 3b82ea4

Please sign in to comment.