Skip to content

Instantly share code, notes, and snippets.

@davidbegin
Created January 23, 2020 17:42
Show Gist options
  • Save davidbegin/d6436415540c7aded1b8038734f6caed to your computer and use it in GitHub Desktop.
Save davidbegin/d6436415540c7aded1b8038734f6caed to your computer and use it in GitHub Desktop.
Can you implement a context manager to make the test pass?
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