Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-setuptest ignores subdirs in django 1.4 #9

Open
tampakrap opened this issue Aug 28, 2012 · 0 comments
Open

django-setuptest ignores subdirs in django 1.4 #9

tampakrap opened this issue Aug 28, 2012 · 0 comments

Comments

@tampakrap
Copy link

In django 1.4, I have created a project with the following structure:

example_project/
├── example_app_outside
│   ├── example_app_inside2
│   │   ├── __init__.py
│   │   ├── models.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── example_project
│   ├── example_app_inside
│   │   ├── __init__.py
│   │   ├── models.py
│   │   ├── tests.py
│   │   └── views.py
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── manage.py
├── setup.py
└── test_settings.py

(The repository can also be found here)

Below are the results for commands python manage.py test and python setup.py test:

$ python manage.py test example_app_outside example_app_inside example_app_inside2
Creating test database for alias 'default'...
FFF
======================================================================
FAIL: test_basic_addition (example_app_outside.tests.SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tampakrap/Source_Code/example_project/example_app_outside/tests.py", line 16, in test_basic_addition
    self.assertEqual(1 + 1, 3)
AssertionError: 2 != 3

======================================================================
FAIL: test_basic_addition (example_project.example_app_inside.tests.SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tampakrap/Source_Code/example_project/example_project/example_app_inside/tests.py", line 16, in test_basic_addition
    self.assertEqual(1 + 1, 4)
AssertionError: 2 != 4

======================================================================
FAIL: test_basic_addition (example_app_outside.example_app_inside2.tests.SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tampakrap/Source_Code/example_project/example_app_outside/example_app_inside2/tests.py", line 16, in test_basic_addition
    self.assertEqual(1 + 1, 5)
AssertionError: 2 != 5

----------------------------------------------------------------------
Ran 3 tests in 0.000s

FAILED (failures=3)
Destroying test database for alias 'default'...

(I specified the apps as parameters in order to avoid running the embedded django tests. The same result is even without the parameters though)

$ python setup.py test
running test
running egg_info
writing example_project.egg-info/PKG-INFO
writing top-level names to example_project.egg-info/top_level.txt
writing dependency_links to example_project.egg-info/dependency_links.txt
reading manifest file 'example_project.egg-info/SOURCES.txt'
writing manifest file 'example_project.egg-info/SOURCES.txt'
running build_ext
/usr/lib64/python2.7/site-packages/setuptools/command/test.py:115: UserWarning: Module argparse was already imported from /usr/lib64/python2.7/argparse.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path
  add_activation_listener(lambda dist: dist.activate())
Warning: App with label example_project could not be found
Creating test database for alias 'default'...
test_basic_addition (example_app_outside.tests.SimpleTest) ... FAIL
Destroying test database for alias 'default'...

Coverage Report:
Name                                               Stmts   Miss  Cover   Missing
--------------------------------------------------------------------------------
example_app_outside/__init__                           0      0   100%   
example_app_outside/example_app_inside2/__init__       0      0   100%   
example_app_outside/example_app_inside2/models         1      0   100%   
example_app_outside/models                             1      0   100%   
example_project/__init__                               0      0   100%   
example_project/example_app_inside/__init__            0      0   100%   
example_project/example_app_inside/models              1      0   100%   
--------------------------------------------------------------------------------
TOTAL                                                  3      0   100%   

PEP8 Report:
example_project/settings.py:14:80: E501 line too long (108 > 79 characters)
example_project/settings.py:15:80: E501 line too long (96 > 79 characters)
example_project/settings.py:18:80: E501 line too long (100 > 79 characters)
example_project/settings.py:19:80: E501 line too long (98 > 79 characters)
example_project/settings.py:14:48: E261 at least two spaces before inline comment
example_project/settings.py:77:1: E122 continuation line missing indentation or outdented
example_project/settings.py:87:1: E122 continuation line missing indentation or outdented
example_project/settings.py:106:80: E501 line too long (88 > 79 characters)
example_project/urls.py:8:5: E128 continuation line under-indented for visual indent
example_project/urls.py:9:5: E128 continuation line under-indented for visual indent
example_project/urls.py:10:5: E128 continuation line under-indented for visual indent
example_project/urls.py:12:5: E128 continuation line under-indented for visual indent
example_project/urls.py:13:5: E128 continuation line under-indented for visual indent
example_project/urls.py:15:5: E128 continuation line under-indented for visual indent
example_project/urls.py:16:5: E128 continuation line under-indented for visual indent
example_project/urls.py:17:1: E124 closing bracket does not match visual indentation


======================================================================
FAIL: test_basic_addition (example_app_outside.tests.SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tampakrap/Source_Code/example_project/example_app_outside/tests.py", line 16, in test_basic_addition
    self.assertEqual(1 + 1, 3)
AssertionError: 2 != 3

----------------------------------------------------------------------
Ran 1 test in 0.023s

FAILED (failures=1)

Only the app that is in the same directory level with setup.py was taken into consideration. Expected behavior would be to run the tests from all subdirectories, like manage.py test does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant