From 0b6cc6518cd5c61f4f681e0b593fcea77a4473b9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 18 Aug 2019 00:09:36 +0200 Subject: [PATCH] Fix Python 3.8 support --- .travis.yml | 1 + pytest_bdd/steps.py | 2 ++ tox.ini | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2610720..06f9567 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ python: - "3.5" - "3.6" - "3.7" + - "3.8-dev" install: pip install tox tox-travis diff --git a/pytest_bdd/steps.py b/pytest_bdd/steps.py index e423d24..071de4b 100644 --- a/pytest_bdd/steps.py +++ b/pytest_bdd/steps.py @@ -220,6 +220,8 @@ def recreate_function(func, module=None, name=None, add_args=[], firstlineno=Non ] if six.PY3: argnames.insert(1, "co_kwonlyargcount") + if sys.version_info.minor >= 8: + argnames.insert(1, "co_posonlyargcount") for arg in get_args(func): if arg in add_args: diff --git a/tox.ini b/tox.ini index 8365eda..b8a0e85 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ distshare = {homedir}/.tox/distshare envlist = py27-pytestlatest-linters, py27-pytest{36,37,38,39,310,4,41,42,43,44,45,46}, py37-pytest{36,37,38,39,310,4,41,42,43,44,45,46,5,latest}, - py{35,36}-pytestlatest, + py{35,36,38}-pytestlatest, py27-pytestlatest-xdist skip_missing_interpreters = true