opentracing-python-instrumentation icon indicating copy to clipboard operation
opentracing-python-instrumentation copied to clipboard

Tornado test raising type error

Open ror6ax opened this issue 7 years ago • 2 comments
trafficstars

Running tests gives me this:

=========================================================================================== ERRORS ===========================================================================================
__________________________________________________________ ERROR collecting tests/opentracing_instrumentation/test_tornado_http.py ___________________________________________________________

self = <CallInfo when='collect' exception: test_http_fetch() takes exactly 4 arguments (0 given)>, func = <function <lambda> at 0x7f93c987c668>, when = 'collect'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

/usr/lib/python2.7/site-packages/_pytest/runner.py:191: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/site-packages/_pytest/runner.py:370: in <lambda>
    lambda: list(collector.collect()),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Generator 'test_http_fetch'>

    def collect(self):
        # test generators are seen as collectors but they also
        # invoke setup/teardown on popular request
        # (induced by the common "test_*" naming shared with normal tests)
        from _pytest import deprecated
        self.session._setupstate.prepare(self)
        # see FunctionMixin.setup and test_setupstate_is_preserved_134
        self._preservedparent = self.parent.obj
        values = []
        seen = {}
>       for i, x in enumerate(self.obj()):
E       TypeError: test_http_fetch() takes exactly 4 arguments (0 given)

/usr/lib/python2.7/site-packages/_pytest/python.py:597: TypeError
__________________________________________________________ ERROR collecting tests/opentracing_instrumentation/test_tornado_http.py ___________________________________________________________

self = <CallInfo when='collect' exception: test_http_fetch_with_interceptor() takes exactly 4 arguments (0 given)>, func = <function <lambda> at 0x7f93c2c58578>, when = 'collect'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

/usr/lib/python2.7/site-packages/_pytest/runner.py:191: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/site-packages/_pytest/runner.py:370: in <lambda>
    lambda: list(collector.collect()),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Generator 'test_http_fetch_with_interceptor'>

    def collect(self):
        # test generators are seen as collectors but they also
        # invoke setup/teardown on popular request
        # (induced by the common "test_*" naming shared with normal tests)
        from _pytest import deprecated
        self.session._setupstate.prepare(self)
        # see FunctionMixin.setup and test_setupstate_is_preserved_134
        self._preservedparent = self.parent.obj
        values = []
        seen = {}
>       for i, x in enumerate(self.obj()):
E       TypeError: test_http_fetch_with_interceptor() takes exactly 4 arguments (0 given)

/usr/lib/python2.7/site-packages/_pytest/python.py:597: TypeError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================== 2 error in 0.38 seconds ===================================================================================

Python 3 version is failing similarly. What am I doing wrong? ;)

ror6ax avatar Feb 12 '18 13:02 ror6ax

Are you running in virtualenv with the correct dependencies?

yurishkuro avatar Feb 12 '18 16:02 yurishkuro

Hello @ror6ax, Can this issue be closed already?

Jamim avatar Aug 31 '19 22:08 Jamim