pytest에서 sys.argv 값 지정하기 테스트을 하기 위해서 sys.argv 는 아래와 같이 값을 입력하면 된다. run.py def get_date(): target_date = sys.argv[1] return target_date test_run.py sys.argv = ["2021", "20210102"] current_date = run.get_date() assert current_date == "20210102" 파이썬(Python) 2021.10.22
jupyter notebook에서 pytest로 unit test하기 아직은 주피터 노트북에서 유닛 테스트를 할 일은 없지만 필요하다면 아래 모듈을 이용하면 될 것 같다. https://github.com/chmp/ipytest#usage chmp/ipytest Pytest in IPython notebooks. Contribute to chmp/ipytest development by creating an account on GitHub. github.com 카테고리 없음 2021.07.17