First i wanna say Thanks to Zed for LPTHW and what he conveyed in it. Before starting to learn with LPTHW i had totally no , yes no CS backgrounds. I finished another py course( PY4E by Charles Russell Severance) so everything went well until EX46.
I met dfferent Errors in EX46, from installing virtualenv to create and edit files in virtualenv( i thought setup.py and other scripts shouid edit in IDLE launched from powershell so that can be a real work in virtualenv) and even to set Administrator account in win10 . All these Errors spend me a whole day to fix. In the early morning of the second day, i repeated to follow the steps in EX46 and everything went in order automatically(strange, i donāt konw why) . All done!
Than i began to run test with nose.
My work env is win10 64 bit, powershell to input command, python 3.8 32bit, vs code and notepad.exe to edit .py files (everytime i try to use IDLE from powershell i got syntax Error)
I ran nosetests but it ran 0 test, that means 0 test was found be nose? I googled the solution but not workd.
In order to fix it, i checked and dit:
- the structure of skeleton to ensure it is right like what shows in the book
- copy init.py to every folder in skeleton, even in docs and bin, which didnāt work
- i typed line by line the setup.py and NAME_tests.py in notepad, or in vs code and copied them to /skeleton and /skeleton/tests
- i checked and scanned in nose documentations but seems found nothing useful.
- i changed name of NAME_tests.py, it didnāt work
- i jumped to EX47, set game.py and ex47_tests.py ready and tested with nosetests, it didnāt work again.
I also had idea to set other new virtualenvs in other PATH, but didnāt do that because sort of tired.
Short before i editting this post i used nose -h to see if any command may help, -where can find tests in the dir, so i tried.
Didnāt i type in the command properly? I donāt know.
So now is the third day i got stuck in EX46, hope anyone who sees this post may offer a little help.
----------------------------------------update-------------------------------------------------------------------------
Update:
I used a sample to test if nose functions, and it did! And it did again!
Encouraged by the progress i rererepeated the steps in the book:
-
set docs bin NAME tests, 4 folders in \skeleton;
-
init.py in NAME and tests in NAME and tests
3 create setup.py in \skeleton and NAME_tests in \skeleton\tests
4 launch IDLE directly from win powershell, pasted code into setpy and NAME_tests and checked every letters in IDLE
5 run nosetests and python -m nose command after i kept \skeleton clean by removing all pycache folders,the \skeleton structure is totally same with in the book -
perfectly i got nothing.
Now i totally do not know what to do.
---------------UPDATE2-------------------------------------------------------------
well, i just tried once again:
- rename /skeleton/tests/NAME_tests.py to /skeleton/tests/test_tests.py, and move
it to /skeleton/, together with setup.py
2 run nosetests, succeed.
-
rename test_tests.py back to NAME_tests.py, succeed.
-
move test_tests.py back to /skeleton/tests, failed.
Confused about why this happens.
Thanks again!