Skip to content

Instantly share code, notes, and snippets.

@matthewdeanmartin
Created November 22, 2019 22:01
Show Gist options
  • Save matthewdeanmartin/53f1ff13e8405f55752a58688014059c to your computer and use it in GitHub Desktop.
Save matthewdeanmartin/53f1ff13e8405f55752a58688014059c to your computer and use it in GitHub Desktop.
Parameterized Nose Tests
from nose_parameterized import parameterized
TEST_DATA = [
# and is the default operator
("(Harry and Potter)", "(Harry Potter)"),
("(Harry or Potter)", "(Harry Potter)"),
("(Harry NOT Potter)", "(Harry -Potter)"),
("\"Harry AND STONE\" NOT Potter", "\"Harry AND STONE\" -Potter"),
("\"Harry AND STONE\" NOT Potter", "\"Harry AND STONE\" -Potter"), # to step through this, you must step through them all!
]
@parameterized(TEST_DATA)
def test_parser(input:str, expected:str)->None:
result = parser.parse(input)
assert result == es, f"Got {result}, expected {expected}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment