Skip to content

Commit c5be64b

Browse files
authored
Chore: Add Pytest 8.0 support (#325)
1 parent 293224e commit c5be64b

File tree

8 files changed

+39
-51
lines changed

8 files changed

+39
-51
lines changed

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
if: github.repository == 'pytest-dev/pytest-selenium'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717
persist-credentials: false
1818

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

2222
- name: Download Package
23-
uses: actions/download-artifact@v3
23+
uses: actions/download-artifact@v4
2424
with:
2525
name: Packages
2626
path: dist

.github/workflows/test.yml

+20-39
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- master
77

8-
# schedule:
9-
# - cron: '0 18 * * *' # Run daily at 14:00 UTC
8+
schedule:
9+
- cron: '0 18 * * *' # Run daily at 18:00 UTC
1010

1111
pull_request:
1212

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

2424
- name: Set up Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
27-
python-version: "3.10"
27+
python-version: "3.12"
2828

2929
- name: Install dependencies
3030
run: |
@@ -35,28 +35,20 @@ jobs:
3535
run: tox -e linting
3636

3737
test:
38-
name: ubuntu-latest - ${{ matrix.tox-env || matrix.python-version }}
38+
name: ubuntu-latest - ${{ matrix.tox-env }}
3939
runs-on: ubuntu-latest
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
44-
include:
45-
- os: ubuntu-latest
46-
python-version: pypy3.9
47-
tox-env: py3.9
48-
49-
- os: ubuntu-latest
50-
python-version: 3.12
51-
tox-env: devel
43+
tox-env: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.10", "devel"]
5244

5345
steps:
54-
- uses: actions/checkout@v3
46+
- uses: actions/checkout@v4
5547

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

6153
- name: Install tox
6254
run: |
@@ -67,43 +59,32 @@ jobs:
6759
run: docker/start
6860

6961
- name: Cache tox environments
70-
uses: actions/cache@v3
62+
uses: actions/cache@v4
7163
with:
7264
path: .tox
73-
key: tox-ubuntu-latest-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
65+
key: ubuntu-latest-tox-${{ matrix.tox-env }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
7466
restore-keys: |
75-
tox-ubuntu-latest-${{ matrix.python-version }}-
76-
77-
- name: Set tox variable
78-
shell: bash
79-
run: |
80-
echo "python-version: ${{ matrix.python-version }}"
81-
echo "tox-env: ${{ matrix.tox-env }}"
82-
if [[ -n "${{ matrix.tox-env }}" ]]; then
83-
echo "tox=${{ matrix.tox-env }}" >> "$GITHUB_ENV"
84-
else
85-
echo "tox=py${{ matrix.python-version }}" >> "$GITHUB_ENV"
86-
fi
67+
ubuntu-latest-tox-${{ matrix.tox-env }}-
8768
8869
- name: Test
89-
run: tox -e "${{ env.tox }}"
70+
run: tox -e ${{ matrix.tox-env }}
9071

9172
- name: Archive report.html
9273
if: failure()
93-
uses: actions/upload-artifact@v1
74+
uses: actions/upload-artifact@v4
9475
with:
95-
name: report.html.${{ matrix.os }}-${{ env.tox }}.zip
96-
path: .tox/${{ env.tox }}/log/report.html
76+
name: report.html-${{ matrix.tox-env }}.zip
77+
path: .tox/${{ matrix.tox-env }}/log/report.html
9778

9879
docs:
9980
runs-on: ubuntu-latest
10081
steps:
101-
- uses: actions/checkout@v3
82+
- uses: actions/checkout@v4
10283

10384
- name: Set up Python
104-
uses: actions/setup-python@v4
85+
uses: actions/setup-python@v5
10586
with:
106-
python-version: "3.10"
87+
python-version: "3.12"
10788

10889
- name: Install dependencies
10990
run: |

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 22.3.0
3+
rev: 24.1.1
44
hooks:
55
- id: black
66
args: [--safe, --quiet]
77
language_version: python3
88

99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.1.0
10+
rev: v4.5.0
1111
hooks:
1212
- id: trailing-whitespace
1313
- id: end-of-file-fixer
1414

1515
- repo: https://github.com/PyCQA/flake8
16-
rev: 4.0.1
16+
rev: 7.0.0
1717
hooks:
1818
- id: flake8
1919
exclude: docs

docs/installing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
Requirements
55
------------
66

7-
pytest-selenium will work with Python >=3.7.
7+
pytest-selenium will work with Python >=3.8.
88

99
Install pytest-selenium
1010
-----------------------

docs/news.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Release Notes
22
=============
33

4+
4.1.0 (2024-02-01)
5+
------------------
6+
7+
* Support pytest 8.0
8+
9+
* Thanks to `@sandre35 <https://github.com/sandre35>`_ for reporting the issue and the PR.
10+
411
4.0.2 (2023-11-20)
512
------------------
613

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "pytest-selenium"
1010
description = "pytest plugin for Selenium"
1111
readme = "README.rst"
1212
license = "MPL-2.0"
13-
requires-python = ">=3.7"
13+
requires-python = ">=3.8"
1414
keywords = [
1515
"pytest",
1616
"selenium",
@@ -27,16 +27,16 @@ classifiers = [
2727
"Development Status :: 5 - Production/Stable",
2828
"Framework :: Pytest",
2929
"Intended Audience :: Developers",
30-
"License :: OSI Approved :: MIT License",
30+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
3131
"Natural Language :: English",
3232
"Operating System :: POSIX",
3333
"Operating System :: Microsoft :: Windows",
3434
"Operating System :: MacOS :: MacOS X",
35-
"Programming Language :: Python :: 3.7",
3635
"Programming Language :: Python :: 3.8",
3736
"Programming Language :: Python :: 3.9",
3837
"Programming Language :: Python :: 3.10",
3938
"Programming Language :: Python :: 3.11",
39+
"Programming Language :: Python :: 3.12",
4040
"Programming Language :: Python :: Implementation :: CPython",
4141
"Programming Language :: Python :: Implementation :: PyPy",
4242
"Topic :: Software Development :: Quality Assurance",

src/pytest_selenium/pytest_selenium.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def pytest_addoption(parser):
400400
parser.addini(
401401
"selenium_exclude_debug",
402402
help="debug to exclude from capture",
403-
default=os.getenv("SELENIUM_EXCLUDE_DEBUG"),
403+
default=os.getenv("SELENIUM_EXCLUDE_DEBUG", ""),
404404
)
405405

406406
_auth_choices = ("none", "token", "hour", "day")

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py{3.7, 3.8, 3.9, 3.10, 3.11, py3.9}, docs, linting
7+
envlist = py{3.8, 3.9, 3.10, 3.11, 3.12, py3.10}, docs, linting
88
isolated_build = True
99

1010
[testenv]

0 commit comments

Comments
 (0)