@@ -10,7 +10,7 @@ On the example of a simple Python script/function establish
1010practice of
1111
1212- interaction with [ Git] ( http://git-scm.com ) and [ GitHub] ( http://github.com )
13- - automated testing using [ nose ] ( https://nose.readthedocs .org )
13+ - automated testing using [ py.test ] ( https://docs.pytest .org/en/latest/ )
1414- code syntax conventions validation using [ flake8] ( http://bitbucket.org/tarek/flake8 )
1515
1616## Problem to solve
2525
2626** Solution** :
2727
28- 1 . Write recursive ` factorial_recursive ` to estimate factorial of an
29- integer n.
28+ 1 . Write ` factorial ` to estimate factorial of an
29+ integer n (could be plain iteration or a recursive call) .
3030 See [ wikipedia] ( http://en.wikipedia.org/wiki/Factorial ) if not sure
3131 about what factorial is
3232
3333### "Extra credit"
3434
35- 2 . Write non-recursive version of a ` factorial ` function
35+ 2 . Write both recursive and non-recursive version of a ` factorial ` function
3636
37373 . Investigate difference (well - ratio) in time of execution between
3838 the two. Use ` time ` module to track time.
4545
4646- In the terminal now run
4747
48- git clone https://github.com/YOURLOGIN/psyc161-hw1
48+ git clone https://github.com/YOURLOGIN/psyc161-hw-factorial
4949
5050 to "clone" your remote fork/clone to your local drive
5151
5454- You are welcome to use any editor to edit the file, but we recommend
5555 starting to work with [ PyCharm] ( https://www.jetbrains.com/pycharm )
5656
57- - Function ` factorial_recursive ` definition provides a skeleton for
57+ - Function ` factorial ` definition provides a skeleton for
5858 you to fill in (docstring + implementation)
5959
6060- Test ` test_factorial() ` implements basic checks already which you
6161 need to expand to degree you feel necessary to state with assurance
6262 that your implementation. You can run all ` tests_ ` present in the
63- file using ` nosetests - s -v factorial.py` (run ` man nosetests ` in a
63+ file using ` python -m pytest - s -v factorial.py` (run ` man pytest ` in a
6464 terminal to check what options -s and -v are for. Do you need them
6565 both really ATM?)
6666
@@ -74,7 +74,7 @@ be done multiple times
7474- Whenever you are ready to submit your homework, run ` git push ` to
7575 push your changes back to ** your** clone on GitHub
7676
77- - Visit your GitHub page (http://github.com/YOURLOGIN/psyc161-hw1 ) and
77+ - Visit your GitHub page (http://github.com/YOURLOGIN/psyc161-hw-factorial ) and
7878 find your changes being present among Commits, and "Send a pull
7979 request" option present.
8080
@@ -83,7 +83,7 @@ be done multiple times
8383
8484- Review status of the pull request in a few minutes -- it should
8585 report successful pass through travis CI run which runs again
86- nosetests and flake8 on my behalf. If not -- inspect travis's logs,
86+ pytest and flake8 on my behalf. If not -- inspect travis's logs,
8787 commit fixes locally, push them to github again so that PR gets
8888 updated, and travis gets another run.
8989
0 commit comments