Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] unittest example fails #2717

Closed
timhughes opened this issue Feb 11, 2018 · 1 comment · Fixed by #2718
Closed

[docs] unittest example fails #2717

timhughes opened this issue Feb 11, 2018 · 1 comment · Fixed by #2718
Labels

Comments

@timhughes
Copy link
Contributor

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

asvetlov added a commit that referenced this issue Feb 11, 2018
* fixes #2717 Makes unittest example work (#2718)

* Convert tests

* Convert more

* Convert even more

* Convert more

* Convert more

* Increase timeout to fix flaky test
asvetlov added a commit that referenced this issue Feb 11, 2018
* fixes #2717 Makes unittest example work (#2718)

* Convert a couplt asserts

* Convert test

* Convert other test

* Convert more

* Cleanup
@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant