Hacker News new | past | comments | ask | show | jobs | submit login
Building a Small REPL in Python (bernsteinbear.com)
27 points by ingve on Nov 28, 2023 | hide | past | favorite | 2 comments



But then what about tests?

https://github.com/4dsolutions/python_camp/pull/4/files :

  class TestCalculatorREPL(unittest.TestCase):

  from unittest.mock import patch

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


Ooh, this is interesting. Thanks for the tip. The rest of the project is well-tested but I've been cowboy developing the REPL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: