Skip to content

Commit

Permalink
feat: Add Pytest 8.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondEvil committed Feb 1, 2024
1 parent 293224e commit c36b812
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 50 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
if: github.repository == 'pytest-dev/pytest-selenium'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1
uses: hynek/build-and-inspect-python-package@v2

- name: Download Package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
Expand Down
73 changes: 34 additions & 39 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- master

# schedule:
# - cron: '0 18 * * *' # Run daily at 14:00 UTC
schedule:
- cron: '0 18 * * *' # Run daily at 18:00 UTC

pull_request:

Expand All @@ -19,12 +19,12 @@ jobs:
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'pytest-dev/pytest-selenium')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install dependencies
run: |
Expand All @@ -35,28 +35,20 @@ jobs:
run: tox -e linting

test:
name: ubuntu-latest - ${{ matrix.tox-env || matrix.python-version }}
name: ubuntu-latest - ${{ matrix.tox-env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: ubuntu-latest
python-version: pypy3.9
tox-env: py3.9

- os: ubuntu-latest
python-version: 3.12
tox-env: devel
tox-env: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.10", "devel"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.tox-env == 'devel' && 3.12 || matrix.tox-env }} # default is for devel

- name: Install tox
run: |
Expand All @@ -67,43 +59,46 @@ jobs:
run: docker/start

- name: Cache tox environments
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .tox
key: tox-ubuntu-latest-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
key: ubuntu-latest-tox-${{ matrix.tox-env }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
restore-keys: |
tox-ubuntu-latest-${{ matrix.python-version }}-
- name: Set tox variable
shell: bash
run: |
echo "python-version: ${{ matrix.python-version }}"
echo "tox-env: ${{ matrix.tox-env }}"
if [[ -n "${{ matrix.tox-env }}" ]]; then
echo "tox=${{ matrix.tox-env }}" >> "$GITHUB_ENV"
else
echo "tox=py${{ matrix.python-version }}" >> "$GITHUB_ENV"
fi
ubuntu-latest-tox-${{ matrix.tox-env }}-
# - name: Set tox variable
# shell: bash
# run: |
# echo "python-version: ${{ matrix.python-version }}"
# echo "tox-env: ${{ matrix.tox-env }}"
# if [[ -n "${{ matrix.tox-env }}" ]]; then
# echo "tox=${{ matrix.tox-env }}" >> "$GITHUB_ENV"
# else
# echo "tox=py${{ matrix.python-version }}" >> "$GITHUB_ENV"
# fi
#
# - name: Test
# run: tox -e "${{ env.tox }}"

- name: Test
run: tox -e "${{ env.tox }}"
run: tox -e ${{ matrix.tox-env }}

- name: Archive report.html
if: failure()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: report.html.${{ matrix.os }}-${{ env.tox }}.zip
path: .tox/${{ env.tox }}/log/report.html
name: report.html-${{ matrix.tox-env }}.zip
path: .tox/${{ matrix.tox-env }}/log/report.html

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.1.1
hooks:
- id: black
args: [--safe, --quiet]
language_version: python3

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
exclude: docs
Expand Down
7 changes: 7 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release Notes
=============

4.1.0 (2024-02-01)
------------------

* Support pytest 8.0

* Thanks to `@sandre35 <https://github.com/sandre35>`_ for reporting the issue and the PR.

4.0.2 (2023-11-20)
------------------

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name = "pytest-selenium"
description = "pytest plugin for Selenium"
readme = "README.rst"
license = "MPL-2.0"
requires-python = ">=3.7"
requires-python = ">=3.8"
keywords = [
"pytest",
"selenium",
Expand All @@ -27,16 +27,16 @@ classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Quality Assurance",
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_selenium/pytest_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def pytest_addoption(parser):
parser.addini(
"selenium_exclude_debug",
help="debug to exclude from capture",
default=os.getenv("SELENIUM_EXCLUDE_DEBUG"),
default=os.getenv("SELENIUM_EXCLUDE_DEBUG", ""),
)

_auth_choices = ("none", "token", "hour", "day")
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py{3.7, 3.8, 3.9, 3.10, 3.11, py3.9}, docs, linting
envlist = py{3.8, 3.9, 3.10, 3.11, 3.12, py3.10}, docs, linting
isolated_build = True

[testenv]
Expand Down

0 comments on commit c36b812

Please sign in to comment.