Created
January 23, 2020 17:42
-
-
Save davidbegin/d6436415540c7aded1b8038734f6caed to your computer and use it in GitHub Desktop.
Can you implement a context manager to make the test pass?
This file contains hidden or 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
import pytest | |
# DON'T UPDATE THIS JUST CREATE A CONTEXT MANAGER | |
def reverso(): | |
with YOUR_CONTEXT_MANAGER as what: | |
return print("Alice, Kitty and Snowdrop") | |
def test_looking_glass(capsys): | |
reverso() | |
captured = capsys.readouterr() | |
assert captured.out == "pordwonS dna yttiK ,ecilA\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment