Created
November 22, 2019 22:01
-
-
Save matthewdeanmartin/53f1ff13e8405f55752a58688014059c to your computer and use it in GitHub Desktop.
Parameterized Nose Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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