Repository: ESSS/pytest-regressions (language: python)

Issue:
module 'pytest' has no attribute 'Parser' in 2.4.0
I haven't yet looked into all the details, but since the pytest-regressions 2.4.0 release our [CI builds](https://github.com/aiidateam/aiida-core/actions/runs/3072038424/jobs/4963247024#step:10:57) started failing with

```
  File "/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/pytest_regressions/plugin.py", line 15, in <module>
    def pytest_addoption(parser: pytest.Parser) -> None:
AttributeError: module 'pytest' has no attribute 'Parser'
``` 

And this despite we're using pytest 6.2.5 https://github.com/aiidateam/aiida-core/actions/runs/3072038424/jobs/4963247024#step:8:140

I read in the changelog that pytest >=6.2 is now required.
Is it possible that you actually require pytest 7 now?


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7b71415..264a0a8 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -22,7 +22,7 @@ jobs:
           - python: "3.9"
             tox_env: "py39"
           - python: "3.10"
-            tox_env: "py310"
+            tox_env: "py310,pytest6"
         exclude:
           - python: "3.6"
             os: windows-latest
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 24af009..5ae452f 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,9 @@
+2.4.1 (2022-09-17)
+------------------
+
+* Compatibility fix for pytest 6.2.
+
+
 2.4.0 (2022-09-16)
 ------------------
 
diff --git a/setup.py b/setup.py
index a7814d3..b7cf9da 100644
--- a/setup.py
+++ b/setup.py
@@ -57,6 +57,9 @@ def read(fname: str) -> str:
         "Programming Language :: Python :: 3",
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: Implementation :: CPython",
         "Operating System :: OS Independent",
         "License :: OSI Approved :: MIT License",
diff --git a/tox.ini b/tox.ini
index 95a2c87..8bb3de2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,28 +1,13 @@
 [tox]
-envlist = py36,py37,py38,py39,py310,docs,linting
+envlist = py36,py37,py38,py39,py310,pytest6, docs,linting
 
 [testenv]
 download = true
 extras = dev
 commands = pytest {posargs:tests}
-
-[testenv:linting]
-basepython = python3.7
-extras = dev
-skipsdist = True
-usedevelop = True
-commands = pre-commit run --all-files --show-diff-on-failure
-
-[testenv:docs]
-basepython = python3.7
-changedir = doc
-skipsdist = True
-usedevelop = True
 deps =
-    sphinx
-    sphinx_rtd_theme
-commands =
-    sphinx-build -W -b html . _build
+    pytest6: pytest ~= 6.2
+
 
 [pytest]
 filterwarnings=


Test patch:
diff --git a/src/pytest_regressions/plugin.py b/src/pytest_regressions/plugin.py
index b0574ed..da2c6e4 100644
--- a/src/pytest_regressions/plugin.py
+++ b/src/pytest_regressions/plugin.py
@@ -1,4 +1,5 @@
 from pathlib import Path
+from typing import Any
 from typing import TYPE_CHECKING
 
 import pytest
@@ -12,7 +13,7 @@
     from .image_regression import ImageRegressionFixture
 
 
-def pytest_addoption(parser: pytest.Parser) -> None:
+def pytest_addoption(parser: Any) -> None:
     group = parser.getgroup("regressions")
     group.addoption(
         "--force-regen",