tekknolagi/scrapscript

Add REPL integration tests using I/O mocks

tekknolagi opened this issue · 0 comments

https://news.ycombinator.com/item?id=38449933

  class TestCalculatorREPL(unittest.TestCase):
      pass

  from unittest.mock import patch

  @patch("sys.stdin", StringIO("1"))
  @patch("sys.stdout", new_callable=StringIO)
  def test__():
      pass