Skip to content

Commit d26411f

Browse files
authored
Drop compatibility with pytest < 3.6 (#322)
* Remove support code for pytest < 3.6 * Update setup.py tags * Require pytest>=3.6 from setup.py
1 parent c6b16b6 commit d26411f

File tree

3 files changed

+4
-50
lines changed

3 files changed

+4
-50
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Unreleased
55
----------
66

77
- Fix ``pytest --generate-missing`` functionality being broken.
8+
- Drop compatibility with pytest < 3.6
89

910
3.2.1
1011
----------

pytest_bdd/utils.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,4 @@ def get_parametrize_markers_args(node):
3030
3131
This function uses that API if it is available otherwise it uses MarkInfo objects.
3232
"""
33-
mark_name = "parametrize"
34-
try:
35-
return get_markers_args_using_iter_markers(node, mark_name)
36-
except AttributeError:
37-
return get_markers_args_using_get_marker(node, mark_name)
38-
39-
40-
def get_markers_args_using_iter_markers(node, mark_name):
41-
"""Recommended on pytest>=3.6"""
42-
args = []
43-
for mark in node.iter_markers(mark_name):
44-
args += mark.args
45-
return tuple(args)
46-
47-
48-
def get_markers_args_using_get_marker(node, mark_name):
49-
"""Deprecated on pytest>=3.6"""
50-
return getattr(node.get_marker(mark_name), "args", ())
33+
return tuple(arg for mark in node.iter_markers("parametrize") for arg in mark.args)

setup.py

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,8 @@
44
import codecs
55
import os
66
import re
7-
import sys
87

98
from setuptools import setup
10-
from setuptools.command.test import test as TestCommand
11-
12-
13-
class ToxTestCommand(TestCommand):
14-
15-
"""Test command which runs tox under the hood."""
16-
17-
user_options = [("tox-args=", "a", "Arguments to pass to tox")]
18-
19-
def initialize_options(self):
20-
"""Initialize options and set their defaults."""
21-
TestCommand.initialize_options(self)
22-
self.tox_args = "--recreate"
23-
24-
def finalize_options(self):
25-
"""Add options to the test runner (tox)."""
26-
TestCommand.finalize_options(self)
27-
self.test_args = []
28-
self.test_suite = True
29-
30-
def run_tests(self):
31-
"""Invoke the test runner (tox)."""
32-
# import here, cause outside the eggs aren't loaded
33-
import tox
34-
import shlex
35-
36-
errno = tox.cmdline(args=shlex.split(self.tox_args))
37-
sys.exit(errno)
389

3910

4011
dirname = os.path.dirname(__file__)
@@ -72,9 +43,8 @@ def run_tests(self):
7243
"Programming Language :: Python :: 2",
7344
"Programming Language :: Python :: 3",
7445
]
75-
+ [("Programming Language :: Python :: %s" % x) for x in "2.7 3.4 3.5 3.6 3.7".split()],
76-
cmdclass={"test": ToxTestCommand},
77-
install_requires=["glob2", "Mako", "parse", "parse_type", "py", "pytest>=3.0.0", "six>=1.9.0"],
46+
+ [("Programming Language :: Python :: %s" % x) for x in "2.7 3.5 3.6 3.7 3.8".split()],
47+
install_requires=["glob2", "Mako", "parse", "parse_type", "py", "pytest>=3.6.0", "six>=1.9.0"],
7848
# the following makes a plugin available to py.test
7949
entry_points={
8050
"pytest11": ["pytest-bdd = pytest_bdd.plugin"],

0 commit comments

Comments
 (0)