Created
April 27, 2019 21:36
-
-
Save trszdev/1ff56ae410168bb2a66474dd988f75e2 to your computer and use it in GitHub Desktop.
python competitive programming template for pytest
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 sys import * | |
def main(cin, cout): | |
a, b = map(int, cin.readline().split()) | |
cout.write(str(a + b)) | |
def get_main_output(input_str): | |
from io import StringIO | |
cin = StringIO(input_str) | |
cout = StringIO() | |
main(cin, cout) | |
return cout.getvalue() | |
def test_example(): | |
out = get_main_output('1 -2') | |
assert out == '-1' | |
if __name__ == '__main__': | |
main(stdin, stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment