I'm new to python, so I think it's more of an understanding thing that I am missing for this to not work.
I've started by creating a a new Pyramid project, so that my directory structure looks like:
MyProject /
- myproject /
- static
- templates
- tests.py
- views.py
- development.ini
- production.ini
- setup.py
- setup.cfg
How ever, I'm adding a lot of my business/service logic to a myprojectlib package under the root package directory, and also created a tests package, like so:
MyProject /
- myproject /
- tests.py
- views.py
- myprojectlib /
- user_service.py
- tests /
- user_tests.py
- setup.py
I've added the init.py files to the 'myprojectlib' and 'tests' folder to make them packages, but I can't seem to get the user_tests.py file (and subsequent test code) to be included in the python setup.py test
command. Only the myproject/tests.py tests are included.
My user_tests.py file contains a single test so far:
import unittest
class UserTests(unittest.TestCase):
def test_user_can_register(self):
#code removed for example
How I tell python to look for tests in the /tests directory also?
I've had a look at this post, and it seems I am doing all that it suggests: Having tests in multiple files
Thanks in advance for any help :)
Cheers,
Justin