Skip to content

Commit bfb37ef

Browse files
committed
pytest: fix collection warnings via __test__=False
Fixes > "cannot collect test class %r because it has a __init__ constructor Ref: pytest-dev/pytest#2007
1 parent 36e5b8b commit bfb37ef

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

paste/fixture.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ def reset(self):
9090
"SMTP connection not quit")
9191
self.__class__.existing = None
9292

93+
9394
class AppError(Exception):
9495
pass
9596

97+
9698
class TestApp(object):
9799

98-
# for py.test
99-
disabled = True
100+
__test__ = False # Ignore with pytest test collection.
100101

101102
def __init__(self, app, namespace=None, relative_to=None,
102103
extra_environ=None, pre_request_hook=None,
@@ -494,10 +495,10 @@ def writelines(self, lines):
494495
def getvalue(self):
495496
return self.captured.getvalue()
496497

498+
497499
class TestResponse(object):
498500

499-
# for py.test
500-
disabled = True
501+
__test__ = False # Ignore with pytest test collection.
501502

502503
"""
503504
Instances of this class are return by `TestApp
@@ -884,10 +885,10 @@ def showbrowser(self):
884885
url = 'file:' + fn.replace(os.sep, '/')
885886
webbrowser.open_new(url)
886887

888+
887889
class TestRequest(object):
888890

889-
# for py.test
890-
disabled = True
891+
__test__ = False # Ignore with pytest test collection.
891892

892893
"""
893894
Instances of this class are created by `TestApp
@@ -1331,8 +1332,7 @@ class TestFileEnvironment(object):
13311332
scripts will be run.
13321333
"""
13331334

1334-
# for py.test
1335-
disabled = True
1335+
__test__ = False # Ignore with pytest test collection.
13361336

13371337
def __init__(self, base_path, template_path=None,
13381338
script_path=None,

0 commit comments

Comments
 (0)