Skip to content

Commit deecd21

Browse files
committed
Enable the plugin by default, according to #9
1 parent e06e27c commit deecd21

File tree

6 files changed

+26
-50
lines changed

6 files changed

+26
-50
lines changed

MANIFEST.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
include MANIFEST.in
22
include README.rst
3-
include pytest_twisted/__init__.py
4-
include pytest_twisted/plugin.py
3+
include pytest_twisted.py
54
include setup.cfg
65
include setup.py
76
include testing/conftest.py

make-manifest

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import os
55

66
def main():
77
files = sorted(set([x.strip() for x in os.popen("git ls-files")]) -
8-
set(("make-manifest", ".gitignore")))
8+
{"make-manifest", ".gitignore"})
99

1010
with open("MANIFEST.in", "w") as f:
1111
for x in files:
1212
f.write("include %s\n" % x)
1313

14+
1415
if __name__ == '__main__':
1516
main()
File renamed without changes.

pytest_twisted/__init__.py

-21
This file was deleted.

setup.py

+20-17
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
from setuptools import setup
44

5-
6-
setup(name='pytest-twisted',
7-
version='1.5',
8-
description='A twisted plugin for py.test.',
9-
long_description=open("README.rst").read(),
10-
author='Ralf Schmitt',
11-
author_email='[email protected]',
12-
url='https://github.com/schmir/pytest-twisted',
13-
packages=['pytest_twisted'],
14-
install_requires=["greenlet", "pytest>=2.3", "decorator"],
15-
classifiers=['Development Status :: 5 - Production/Stable',
16-
'Intended Audience :: Developers',
17-
'License :: OSI Approved :: BSD License',
18-
'Operating System :: OS Independent',
19-
'Programming Language :: Python',
20-
'Topic :: Software Development :: Testing'],
21-
entry_points=dict(pytest11=['twisted = pytest_twisted:_loader']))
5+
setup(
6+
name='pytest-twisted',
7+
version='1.5',
8+
description='A twisted plugin for py.test.',
9+
long_description=open("README.rst").read(),
10+
author='Ralf Schmitt',
11+
author_email='[email protected]',
12+
url='https://github.com/schmir/pytest-twisted',
13+
py_modules=['pytest_twisted'],
14+
install_requires=["greenlet", "pytest>=2.3", "decorator"],
15+
classifiers=[
16+
'Development Status :: 5 - Production/Stable',
17+
'Intended Audience :: Developers',
18+
'License :: OSI Approved :: BSD License',
19+
'Operating System :: OS Independent',
20+
'Programming Language :: Python',
21+
'Topic :: Software Development :: Testing'
22+
],
23+
entry_points={'pytest11': ['twisted = pytest_twisted']}
24+
)

testing/test_basic.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
def test_fail_later(testdir):
77
testdir.makepyfile("""
8-
pytest_plugins = "pytest_twisted"
9-
108
from twisted.internet import reactor, defer
119
1210
def test_fail():
@@ -34,15 +32,13 @@ def test_succeed():
3432
reactor.callLater(0.01, d.callback, 1)
3533
return d
3634
""")
37-
rr = testdir.run(sys.executable, "-m", "pytest", "--twisted")
35+
rr = testdir.run(sys.executable, "-m", "pytest")
3836
outcomes = rr.parseoutcomes()
3937
assert outcomes.get("passed") == 1
4038

4139

4240
def test_non_deferred(testdir):
4341
testdir.makepyfile("""
44-
pytest_plugins = "pytest_twisted"
45-
4642
from twisted.internet import reactor, defer
4743
4844
def test_succeed():
@@ -55,8 +51,6 @@ def test_succeed():
5551

5652
def test_exception(testdir):
5753
testdir.makepyfile("""
58-
pytest_plugins = "pytest_twisted"
59-
6054
def test_more_fail():
6155
raise RuntimeError("foo")
6256
""")
@@ -82,7 +76,7 @@ def test_succeed(foo):
8276
if foo == "web":
8377
raise RuntimeError("baz")
8478
""")
85-
rr = testdir.run(sys.executable, "-m", "pytest", "--twisted", "-v")
79+
rr = testdir.run(sys.executable, "-m", "pytest", "-v")
8680
outcomes = rr.parseoutcomes()
8781
assert outcomes.get("passed") == 2
8882
assert outcomes.get("failed") == 1
@@ -106,6 +100,6 @@ def test_MAIN():
106100
assert MAIN is greenlet.getcurrent()
107101
108102
""")
109-
rr = testdir.run(sys.executable, "-m", "pytest", "--twisted", "-v")
103+
rr = testdir.run(sys.executable, "-m", "pytest", "-v")
110104
outcomes = rr.parseoutcomes()
111105
assert outcomes.get("passed") == 1

0 commit comments

Comments
 (0)