1diff --git a/common_setup.py b/common_setup.py
2index 002952b..11ca9c9 100644
3--- a/common_setup.py
4+++ b/common_setup.py
5@@ -1,45 +1,5 @@
6 # Common setup.py code shared between all the projects in this repository
7-import sys
8 import os
9-import logging
10-
11-from setuptools.command.test import test as TestCommand
12-from setuptools.command.egg_info import egg_info as EggInfoCommand
13-
14-
15-class PyTest(TestCommand):
16- pytest_args = []
17- src_dir = None
18-
19- def initialize_options(self):
20- TestCommand.initialize_options(self)
21-
22- def finalize_options(self):
23- TestCommand.finalize_options(self)
24- self.test_args = []
25- self.test_suite = True
26-
27- def run_tests(self):
28- global pytest_args
29- logging.basicConfig(format='%(asctime)s %(levelname)s %(name)s %(message)s', level='DEBUG')
30-
31- # import here, cause outside the eggs aren't loaded
32- import pytest
33-
34- self.pytest_args.extend(['--junitxml', 'junit.xml'])
35- errno = pytest.main(self.pytest_args)
36- sys.exit(errno)
37-
38-
39-class EggInfo(EggInfoCommand):
40- """ Customisation of the package metadata creation. Changes are:
41- - Save the test requirements into an extra called 'tests'
42- """
43- def run(self):
44- if self.distribution.extras_require is None:
45- self.distribution.extras_require = {}
46- self.distribution.extras_require['tests'] = self.distribution.tests_require
47- EggInfoCommand.run(self)
48
49
50 def common_setup(src_dir):
51@@ -57,13 +17,6 @@ def common_setup(src_dir):
52 long_description = open(readme_file).read()
53 changelog = open(changelog_file).read()
54
55- # Gather trailing arguments for pytest, this can't be done using setuptools' api
56- if 'test' in sys.argv:
57- PyTest.pytest_args = sys.argv[sys.argv.index('test') + 1:]
58- if PyTest.pytest_args:
59- sys.argv = sys.argv[:-len(PyTest.pytest_args)]
60- PyTest.src_dir = src_dir
61-
62 return dict(
63 # Version is shared between all the projects in this repo
64 version=open(version_file).read().strip(),
65@@ -71,6 +24,5 @@ def common_setup(src_dir):
66 url='https://github.com/manahl/pytest-plugins',
67 license='MIT license',
68 platforms=['unix', 'linux'],
69- cmdclass={'test': PyTest, 'egg_info': EggInfo},
70 include_package_data=True
71 )
72diff --git a/pytest-devpi-server/setup.py b/pytest-devpi-server/setup.py
73index 8891130..22b460f 100644
74--- a/pytest-devpi-server/setup.py
75+++ b/pytest-devpi-server/setup.py
76@@ -27,8 +27,6 @@ install_requires = ['pytest-server-fixtures',
77 'ruamel.yaml>=0.15;python_version > "3.4"',
78 ]
79
80-tests_require = []
81-
82 entry_points = {
83 'pytest11': [
84 'devpi_server = _pytest_devpi_server',
85@@ -44,7 +42,6 @@ if __name__ == '__main__':
86 author_email='eeaston@gmail.com',
87 classifiers=classifiers,
88 install_requires=install_requires,
89- tests_require=tests_require,
90 packages=find_packages(exclude='tests'),
91 entry_points=entry_points,
92 ))
93diff --git a/pytest-fixture-config/setup.py b/pytest-fixture-config/setup.py
94index 164ad33..15a9e16 100644
95--- a/pytest-fixture-config/setup.py
96+++ b/pytest-fixture-config/setup.py
97@@ -20,8 +20,9 @@ classifiers = [
98
99 install_requires = ['pytest']
100
101-tests_require = ['six',
102- ]
103+extras_require = {
104+ 'test': ["six"]
105+}
106
107 if __name__ == '__main__':
108 kwargs = common_setup('pytest_fixture_config')
109@@ -32,7 +33,7 @@ if __name__ == '__main__':
110 author_email='eeaston@gmail.com',
111 classifiers=classifiers,
112 install_requires=install_requires,
113- tests_require=tests_require,
114+ extras_require=extras_require,
115 py_modules=['pytest_fixture_config'],
116 ))
117 setup(**kwargs)
118diff --git a/pytest-git/setup.py b/pytest-git/setup.py
119index 8f4a1d3..9c4557a 100644
120--- a/pytest-git/setup.py
121+++ b/pytest-git/setup.py
122@@ -27,9 +27,6 @@ install_requires = ['pytest',
123 'gitpython',
124 ]
125
126-tests_require = [
127- ]
128-
129 entry_points = {
130 'pytest11': [
131 'git_repo = pytest_git',
132@@ -46,7 +43,6 @@ if __name__ == '__main__':
133 author_email='eeaston@gmail.com',
134 classifiers=classifiers,
135 install_requires=install_requires,
136- tests_require=tests_require,
137 py_modules=['pytest_git'],
138 entry_points=entry_points,
139 ))
140diff --git a/pytest-listener/setup.py b/pytest-listener/setup.py
141index 3ce8897..dcde454 100644
142--- a/pytest-listener/setup.py
143+++ b/pytest-listener/setup.py
144@@ -23,8 +23,6 @@ install_requires = ['six',
145 'pytest-server-fixtures'
146 ]
147
148-tests_require = []
149-
150 entry_points = {
151 'pytest11': [
152 'listener = pytest_listener',
153@@ -40,7 +38,6 @@ if __name__ == '__main__':
154 author_email='drtimcouper@gmail.com',
155 classifiers=classifiers,
156 install_requires=install_requires,
157- tests_require=tests_require,
158 packages=find_packages(exclude='tests'),
159 entry_points=entry_points,
160 ))
161diff --git a/pytest-profiling/setup.py b/pytest-profiling/setup.py
162index 612899a..fa412da 100644
163--- a/pytest-profiling/setup.py
164+++ b/pytest-profiling/setup.py
165@@ -22,9 +22,9 @@ install_requires = ['six',
166 'gprof2dot',
167 ]
168
169-tests_require = [
170- 'pytest-virtualenv',
171- ]
172+extras_require = {
173+ 'tests': ['pytest-virtualenv']
174+}
175
176 entry_points = {
177 'pytest11': [
178@@ -41,7 +41,7 @@ if __name__ == '__main__':
179 author_email='ed@catmur.co.uk',
180 classifiers=classifiers,
181 install_requires=install_requires,
182- tests_require=tests_require,
183+ extras_require=extras_require,
184 py_modules=['pytest_profiling'],
185 entry_points=entry_points,
186 ))
187diff --git a/pytest-pyramid-server/setup.py b/pytest-pyramid-server/setup.py
188index f6fbea0..a02587a 100644
189--- a/pytest-pyramid-server/setup.py
190+++ b/pytest-pyramid-server/setup.py
191@@ -26,9 +26,9 @@ install_requires = ['pytest-server-fixtures',
192 'six',
193 ]
194
195-tests_require = [
196- 'pyramid-debugtoolbar',
197- ]
198+extras_require = {
199+ 'tests': ['pyramid-debugtoolbar']
200+}
201
202 entry_points = {
203 'pytest11': [
204@@ -48,7 +48,7 @@ if __name__ == '__main__':
205 author_email='eeaston@gmail.com',
206 classifiers=classifiers,
207 install_requires=install_requires,
208- tests_require=tests_require,
209+ extras_require=extras_require,
210 py_modules=['pytest_pyramid_server', 'pyramid_server_test'],
211 entry_points=entry_points,
212 ))
213diff --git a/pytest-qt-app/setup.py b/pytest-qt-app/setup.py
214index 27f367a..3170aaf 100644
215--- a/pytest-qt-app/setup.py
216+++ b/pytest-qt-app/setup.py
217@@ -22,8 +22,9 @@ install_requires = ['pytest',
218 'pytest-shutil',
219 ]
220
221-tests_require = ['pytest-cov'
222- ]
223+extras_require = {
224+ 'tests': ['pytest-cov']
225+}
226
227 entry_points = {
228 'pytest11': [
229@@ -40,7 +41,7 @@ if __name__ == '__main__':
230 author_email='eeaston@gmail.com',
231 classifiers=classifiers,
232 install_requires=install_requires,
233- tests_require=tests_require,
234+ extras_require=extras_require,
235 py_modules=['pytest_qt_app'],
236 entry_points=entry_points,
237 ))
238diff --git a/pytest-server-fixtures/setup.py b/pytest-server-fixtures/setup.py
239index 065c1c2..88af64c 100644
240--- a/pytest-server-fixtures/setup.py
241+++ b/pytest-server-fixtures/setup.py
242@@ -36,13 +36,12 @@ extras_require = {
243 's3': ["boto3"],
244 'docker': ["docker"],
245 'kubernetes': ["kubernetes"],
246+ 'tests': [
247+ 'mock; python_version<"3.3"',
248+ 'psutil',
249+ ],
250 }
251
252-tests_require = [
253- 'mock; python_version<"3.3"',
254- 'psutil',
255- ]
256-
257 entry_points = {
258 'pytest11': [
259 'httpd_server = pytest_server_fixtures.httpd',
260@@ -66,7 +65,6 @@ if __name__ == '__main__':
261 classifiers=classifiers,
262 install_requires=install_requires,
263 extras_require=extras_require,
264- tests_require=tests_require,
265 packages=find_packages(exclude='tests'),
266 entry_points=entry_points,
267 ))
268diff --git a/pytest-shutil/setup.py b/pytest-shutil/setup.py
269index 43ed91e..e1d9e56 100644
270--- a/pytest-shutil/setup.py
271+++ b/pytest-shutil/setup.py
272@@ -27,8 +27,10 @@ install_requires = ['six',
273 'termcolor'
274 ]
275
276-tests_require = ['pytest',
277- ]
278+
279+extras_require = {
280+ 'tests': ["pytest"],
281+}
282
283 entry_points = {
284 'pytest11': [
285@@ -45,7 +47,7 @@ if __name__ == '__main__':
286 author_email='eeaston@gmail.com',
287 classifiers=classifiers,
288 install_requires=install_requires,
289- tests_require=tests_require,
290+ extras_require=extras_require,
291 packages=find_packages(exclude='tests'),
292 entry_points=entry_points,
293 ))
294diff --git a/pytest-svn/setup.py b/pytest-svn/setup.py
295index 470181f..9d4d272 100644
296--- a/pytest-svn/setup.py
297+++ b/pytest-svn/setup.py
298@@ -21,9 +21,6 @@ install_requires = ['pytest',
299 'pytest-shutil',
300 ]
301
302-tests_require = [
303- ]
304-
305 entry_points = {
306 'pytest11': [
307 'svn_repo = pytest_svn',
308@@ -40,7 +37,6 @@ if __name__ == '__main__':
309 author_email='eeaston@gmail.com',
310 classifiers=classifiers,
311 install_requires=install_requires,
312- tests_require=tests_require,
313 py_modules=['pytest_svn'],
314 entry_points=entry_points,
315 ))
316diff --git a/pytest-verbose-parametrize/setup.py b/pytest-verbose-parametrize/setup.py
317index ae0a482..b6fa5e1 100644
318--- a/pytest-verbose-parametrize/setup.py
319+++ b/pytest-verbose-parametrize/setup.py
320@@ -21,10 +21,11 @@ install_requires = ['pytest',
321 'six',
322 ]
323
324-tests_require = ['mock; python_version<"3.3"',
325- 'pytest-virtualenv',
326- 'coverage',
327- ]
328+extras_require = {
329+ 'tests': ['mock; python_version<"3.3"',
330+ 'pytest-virtualenv',
331+ 'coverage']
332+}
333
334 entry_points = {
335 'pytest11': [
336@@ -41,7 +42,7 @@ if __name__ == '__main__':
337 author_email='eeaston@gmail.com',
338 classifiers=classifiers,
339 install_requires=install_requires,
340- tests_require=tests_require,
341+ extras_require=extras_require,
342 py_modules=['pytest_verbose_parametrize'],
343 entry_points=entry_points,
344 ))
345diff --git a/pytest-virtualenv/setup.py b/pytest-virtualenv/setup.py
346index 815b59c..55f97e3 100644
347--- a/pytest-virtualenv/setup.py
348+++ b/pytest-virtualenv/setup.py
349@@ -25,9 +25,9 @@ install_requires = ['pytest-fixture-config',
350 'importlib-metadata',
351 ]
352
353-tests_require = [
354- 'mock; python_version<"3.3"'
355- ]
356+extras_require = {
357+ 'tests': ['mock; python_version<"3.3"']
358+}
359
360 entry_points = {
361 'pytest11': [
362@@ -44,7 +44,7 @@ if __name__ == '__main__':
363 author_email='eeaston@gmail.com',
364 classifiers=classifiers,
365 install_requires=install_requires,
366- tests_require=tests_require,
367+ extras_require=extras_require,
368 py_modules=['pytest_virtualenv'],
369 entry_points=entry_points,
370 ))
371diff --git a/pytest-webdriver/setup.py b/pytest-webdriver/setup.py
372index 280818a..afb618b 100644
373--- a/pytest-webdriver/setup.py
374+++ b/pytest-webdriver/setup.py
375@@ -23,8 +23,10 @@ install_requires = ['py',
376 'selenium',
377 ]
378
379-tests_require = ['mock; python_version<"3.3"',
380- ]
381+
382+extras_require = {
383+ 'tests': ['mock; python_version,"3.3"'],
384+}
385
386 entry_points = {
387 'pytest11': [
388@@ -41,7 +43,7 @@ if __name__ == '__main__':
389 author_email='eeaston@gmail.com',
390 classifiers=classifiers,
391 install_requires=install_requires,
392- tests_require=tests_require,
393+ extras_require=extras_require,
394 py_modules=['pytest_webdriver'],
395 entry_points=entry_points,
396 ))