Skip to content

[docs] unittest example fails #2717

Closed
@timhughes

Description

Long story short

The example for unittest has undefined variables root and loop plus the tests fail
https://github.com/aio-libs/aiohttp/blame/master/docs/testing.rst#L264

Expected behaviour

The example test to pass

Actual behaviour

----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/thughes/git/updateserver/updateserver/test_server.py", line 31, in test_example
    self.loop.run_until_complete(test_get_route())
  File "/home/thughes/.pyenv/versions/3.6.3/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
  File "/home/thughes/git/updateserver/updateserver/test_server.py", line 25, in test_get_route
    url = root + "/"
NameError: name 'root' is not defined

Steps to reproduce

copy the example into a file names test_foo.py and then run python -m unittest

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions