Skip to content

Instantly share code, notes, and snippets.

@timseed
Created May 10, 2018 06:49
Show Gist options
  • Select an option

  • Save timseed/c81e1744fabbbaed4b7ef0f0d8fdb44c to your computer and use it in GitHub Desktop.

Select an option

Save timseed/c81e1744fabbbaed4b7ef0f0d8fdb44c to your computer and use it in GitHub Desktop.

Instead of writing my tests scripts one at a time (testing the same type of data here), I am using the built in nose generator method.

from CheckService import CheckService


def test_generator():
    sites=[ "ftp.esat.net",
            "ftp.leo.org",
            "ftp.mirror.nl",
            "ftp.it.freebsd.org"]
    for s in sites:
        yield check_service,s


def check_service(s):
    assert s.startswith('ftp')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment