FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Unit tests should not need the network · Issue #490 · aimacode/aima-python · GitHub

Repository navigation

Unit tests should not need the network #490

Description

test_nlp.py has a call to loadPageHTML -- I found out about it when running py.test seemed to hang up for minutes. (It eventually finished. I was downloading the Anaconda installer at the same time.)

Tests should try to use only local data -- maybe from aima-data? Or keep it cached after the first run. I'd rate this as a nice-to-have, not a big problem, currently.

Activity

  1. antmarakis commented on Apr 13, 2017

    Collaborator

    I worked on this a bit and I found that only test_stripRawHTML requires an internet connection. If we remove that test, everything will still work fine and there will be no need for network connectivity.

    Shouldn't we though keep the test to make sure we don't accidentally break something in the used functions?

    If we are to keep it, I tried some different wikipedia pages to make the process faster. If instead of "https://en.wikipedia.org/wiki/Ethics" we use "https://en.wikipedia.org/wiki/Terminus_post_quem" (which is significantly shorter) we reduce the testing time by about 1 second on bad connections. I don't know if that one second is worth it, but we could try.

  2. lucasmoura commented on Apr 13, 2017

    Contributor

    One way to deal with that is to mock the call to urllib.request.urlopen. I have done that in #495, if anyone wants to check it out and comment if that is a good approach, I will appreciate any feedback :)

  3. darius commented on Apr 13, 2017

    CollaboratorAuthor

    Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL