Pylons / pyramid_tutorials

Tutorials for Pyramid
https://docs.pylonsproject.org/projects/pyramid/en/latest/
89 stars 63 forks source link

Updating the path of the development.ini #63

Closed voidz0r closed 10 years ago

voidz0r commented 10 years ago

Since the tutorial is based on the 'tutorial' subdirectory, development.ini is one dir up to the current dir.

mmerickel commented 10 years ago

This code is looking for the development.ini file in the current-working-directory of the process. This is the folder from which pserve or python was run, which is almost always the folder that contains the ini files. I'm not sure this fix is fixing what you're trying to fix.

Perhaps you can be more clear about the issue you're running into?

voidz0r commented 10 years ago

Yes sir, but the tests.py file is inside the tutorial package, not in the root directory. That's why i fixed it

mmerickel commented 10 years ago

Ah, but you should not be running the python tests.py file directly. Rather from the 11-sqlalchemy folder you would run nosetests leaving the CWD as the folder containing the development.ini file.

voidz0r commented 10 years ago

Ah...uhm...i just followed the preceding small tutorial of nosetests that was inside the tutorial package. So yes, in your way it will works, but you know..just for being "consistent" :)

mmerickel commented 10 years ago

Can you link me to the tutorial you're referencing? The way I described is what the 11-sqlalchemy and all other tutorials in the getting-started package intends.

voidz0r commented 10 years ago

The bottom page of 11-sqlalchemy (and previous) says:

(env33)$ nosetests .
..
-----------------------------------------------------------------
Ran 2 tests in 1.971s

OK

The link is: http://docs.pylonsproject.org/projects/pyramid-tutorials/en/latest/getting_started/11-sqlalchemy/index.html

mmerickel commented 10 years ago

Yup, but nowhere in the tutorial does it tell you to cd tutorial prior to running that command. And notably in the following step it says pserve development.ini which should make it obvious that you are still in the root folder.

My point is that if you were supposed to change folders then the tutorial would tell you to change folders. For example, in step 1 of "Steps to Initialize the Database" it explicitly says to cd .. prior to cp -r step10 step11.

voidz0r commented 10 years ago

Ohw...i misunderstood something. I tried now to launch a nosetests . in the root folder and tests are executed normally. I think i got a kind of "fixing-before-broken" issue in my mind.. Thanks for your info and sorry if i been so persistent with this :)

voidz0r commented 10 years ago

Closing the pull request