From de8ebdddf698b2578940e7582a1e8ce6cc640ae4 Mon Sep 17 00:00:00 2001 From: "Mr. Senko" Date: Sun, 4 Mar 2018 23:24:54 +0200 Subject: [PATCH] Move tests under pylint_django. Fixes #129 --- .coveragerc | 4 +++- {test => pylint_django/tests}/__init__.py | 0 {test => pylint_django/tests}/input/__init__.py | 0 .../input/external_django_tables2_noerror_meta_class.py | 0 .../tests}/input/external_drf_noerror_serializer.py | 0 .../tests}/input/external_drf_noerror_serializer.rc | 0 .../tests}/input/external_psycopg2_noerror_postgres_fields.py | 0 .../tests}/input/external_psycopg2_noerror_postgres_fields.rc | 0 .../tests}/input/func_model_does_not_use_unicode_py33.py | 0 .../tests}/input/func_model_does_not_use_unicode_py33.txt | 0 .../tests}/input/func_noerror_classviews.py | 0 .../input/func_noerror_duplicate_except_doesnotexist.py | 0 .../tests}/input/func_noerror_foreign_key_attributes.py | 0 .../tests}/input/func_noerror_foreign_key_ids.py | 0 .../tests}/input/func_noerror_foreign_key_sets.py | 0 .../tests}/input/func_noerror_foreignkeys.py | 0 .../tests}/input/func_noerror_form_fields.py | 0 .../tests}/input/func_noerror_forms_py33.py | 0 .../tests}/input/func_noerror_formview_ancestors.py | 0 .../tests}/input/func_noerror_ignore_meta_subclass.py | 0 {test => pylint_django/tests}/input/func_noerror_import_q.py | 0 {test => pylint_django/tests}/input/func_noerror_issue_46.py | 0 .../tests}/input/func_noerror_manytomanyfield.py | 0 .../tests}/input/func_noerror_model_fields.py | 0 .../tests}/input/func_noerror_model_methods.py | 0 .../tests}/input/func_noerror_model_unicode_callable.py | 0 .../tests}/input/func_noerror_model_unicode_lambda.py | 0 .../tests}/input/func_noerror_models_py33.py | 0 .../tests}/input/func_noerror_protected_meta_access.py | 0 .../tests}/input/func_noerror_ugettext_lazy_format.py | 0 .../tests}/input/func_noerror_unicode_py2_compatible.py | 0 {test => pylint_django/tests}/input/func_noerror_urls.py | 0 .../tests}/input/func_noerror_uuid_field.py | 0 {test => pylint_django/tests}/test_func.py | 3 +++ scripts/test.sh | 2 +- tox.ini | 2 +- 36 files changed, 8 insertions(+), 3 deletions(-) rename {test => pylint_django/tests}/__init__.py (100%) rename {test => pylint_django/tests}/input/__init__.py (100%) rename {test => pylint_django/tests}/input/external_django_tables2_noerror_meta_class.py (100%) rename {test => pylint_django/tests}/input/external_drf_noerror_serializer.py (100%) rename {test => pylint_django/tests}/input/external_drf_noerror_serializer.rc (100%) rename {test => pylint_django/tests}/input/external_psycopg2_noerror_postgres_fields.py (100%) rename {test => pylint_django/tests}/input/external_psycopg2_noerror_postgres_fields.rc (100%) rename {test => pylint_django/tests}/input/func_model_does_not_use_unicode_py33.py (100%) rename {test => pylint_django/tests}/input/func_model_does_not_use_unicode_py33.txt (100%) rename {test => pylint_django/tests}/input/func_noerror_classviews.py (100%) rename {test => pylint_django/tests}/input/func_noerror_duplicate_except_doesnotexist.py (100%) rename {test => pylint_django/tests}/input/func_noerror_foreign_key_attributes.py (100%) rename {test => pylint_django/tests}/input/func_noerror_foreign_key_ids.py (100%) rename {test => pylint_django/tests}/input/func_noerror_foreign_key_sets.py (100%) rename {test => pylint_django/tests}/input/func_noerror_foreignkeys.py (100%) rename {test => pylint_django/tests}/input/func_noerror_form_fields.py (100%) rename {test => pylint_django/tests}/input/func_noerror_forms_py33.py (100%) rename {test => pylint_django/tests}/input/func_noerror_formview_ancestors.py (100%) rename {test => pylint_django/tests}/input/func_noerror_ignore_meta_subclass.py (100%) rename {test => pylint_django/tests}/input/func_noerror_import_q.py (100%) rename {test => pylint_django/tests}/input/func_noerror_issue_46.py (100%) rename {test => pylint_django/tests}/input/func_noerror_manytomanyfield.py (100%) rename {test => pylint_django/tests}/input/func_noerror_model_fields.py (100%) rename {test => pylint_django/tests}/input/func_noerror_model_methods.py (100%) rename {test => pylint_django/tests}/input/func_noerror_model_unicode_callable.py (100%) rename {test => pylint_django/tests}/input/func_noerror_model_unicode_lambda.py (100%) rename {test => pylint_django/tests}/input/func_noerror_models_py33.py (100%) rename {test => pylint_django/tests}/input/func_noerror_protected_meta_access.py (100%) rename {test => pylint_django/tests}/input/func_noerror_ugettext_lazy_format.py (100%) rename {test => pylint_django/tests}/input/func_noerror_unicode_py2_compatible.py (100%) rename {test => pylint_django/tests}/input/func_noerror_urls.py (100%) rename {test => pylint_django/tests}/input/func_noerror_uuid_field.py (100%) rename {test => pylint_django/tests}/test_func.py (89%) diff --git a/.coveragerc b/.coveragerc index 6bbc560b..b2fdd994 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,5 @@ - [run] source=pylint_django + +[report] +omit=pylint_django/tests/* diff --git a/test/__init__.py b/pylint_django/tests/__init__.py similarity index 100% rename from test/__init__.py rename to pylint_django/tests/__init__.py diff --git a/test/input/__init__.py b/pylint_django/tests/input/__init__.py similarity index 100% rename from test/input/__init__.py rename to pylint_django/tests/input/__init__.py diff --git a/test/input/external_django_tables2_noerror_meta_class.py b/pylint_django/tests/input/external_django_tables2_noerror_meta_class.py similarity index 100% rename from test/input/external_django_tables2_noerror_meta_class.py rename to pylint_django/tests/input/external_django_tables2_noerror_meta_class.py diff --git a/test/input/external_drf_noerror_serializer.py b/pylint_django/tests/input/external_drf_noerror_serializer.py similarity index 100% rename from test/input/external_drf_noerror_serializer.py rename to pylint_django/tests/input/external_drf_noerror_serializer.py diff --git a/test/input/external_drf_noerror_serializer.rc b/pylint_django/tests/input/external_drf_noerror_serializer.rc similarity index 100% rename from test/input/external_drf_noerror_serializer.rc rename to pylint_django/tests/input/external_drf_noerror_serializer.rc diff --git a/test/input/external_psycopg2_noerror_postgres_fields.py b/pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py similarity index 100% rename from test/input/external_psycopg2_noerror_postgres_fields.py rename to pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.py diff --git a/test/input/external_psycopg2_noerror_postgres_fields.rc b/pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.rc similarity index 100% rename from test/input/external_psycopg2_noerror_postgres_fields.rc rename to pylint_django/tests/input/external_psycopg2_noerror_postgres_fields.rc diff --git a/test/input/func_model_does_not_use_unicode_py33.py b/pylint_django/tests/input/func_model_does_not_use_unicode_py33.py similarity index 100% rename from test/input/func_model_does_not_use_unicode_py33.py rename to pylint_django/tests/input/func_model_does_not_use_unicode_py33.py diff --git a/test/input/func_model_does_not_use_unicode_py33.txt b/pylint_django/tests/input/func_model_does_not_use_unicode_py33.txt similarity index 100% rename from test/input/func_model_does_not_use_unicode_py33.txt rename to pylint_django/tests/input/func_model_does_not_use_unicode_py33.txt diff --git a/test/input/func_noerror_classviews.py b/pylint_django/tests/input/func_noerror_classviews.py similarity index 100% rename from test/input/func_noerror_classviews.py rename to pylint_django/tests/input/func_noerror_classviews.py diff --git a/test/input/func_noerror_duplicate_except_doesnotexist.py b/pylint_django/tests/input/func_noerror_duplicate_except_doesnotexist.py similarity index 100% rename from test/input/func_noerror_duplicate_except_doesnotexist.py rename to pylint_django/tests/input/func_noerror_duplicate_except_doesnotexist.py diff --git a/test/input/func_noerror_foreign_key_attributes.py b/pylint_django/tests/input/func_noerror_foreign_key_attributes.py similarity index 100% rename from test/input/func_noerror_foreign_key_attributes.py rename to pylint_django/tests/input/func_noerror_foreign_key_attributes.py diff --git a/test/input/func_noerror_foreign_key_ids.py b/pylint_django/tests/input/func_noerror_foreign_key_ids.py similarity index 100% rename from test/input/func_noerror_foreign_key_ids.py rename to pylint_django/tests/input/func_noerror_foreign_key_ids.py diff --git a/test/input/func_noerror_foreign_key_sets.py b/pylint_django/tests/input/func_noerror_foreign_key_sets.py similarity index 100% rename from test/input/func_noerror_foreign_key_sets.py rename to pylint_django/tests/input/func_noerror_foreign_key_sets.py diff --git a/test/input/func_noerror_foreignkeys.py b/pylint_django/tests/input/func_noerror_foreignkeys.py similarity index 100% rename from test/input/func_noerror_foreignkeys.py rename to pylint_django/tests/input/func_noerror_foreignkeys.py diff --git a/test/input/func_noerror_form_fields.py b/pylint_django/tests/input/func_noerror_form_fields.py similarity index 100% rename from test/input/func_noerror_form_fields.py rename to pylint_django/tests/input/func_noerror_form_fields.py diff --git a/test/input/func_noerror_forms_py33.py b/pylint_django/tests/input/func_noerror_forms_py33.py similarity index 100% rename from test/input/func_noerror_forms_py33.py rename to pylint_django/tests/input/func_noerror_forms_py33.py diff --git a/test/input/func_noerror_formview_ancestors.py b/pylint_django/tests/input/func_noerror_formview_ancestors.py similarity index 100% rename from test/input/func_noerror_formview_ancestors.py rename to pylint_django/tests/input/func_noerror_formview_ancestors.py diff --git a/test/input/func_noerror_ignore_meta_subclass.py b/pylint_django/tests/input/func_noerror_ignore_meta_subclass.py similarity index 100% rename from test/input/func_noerror_ignore_meta_subclass.py rename to pylint_django/tests/input/func_noerror_ignore_meta_subclass.py diff --git a/test/input/func_noerror_import_q.py b/pylint_django/tests/input/func_noerror_import_q.py similarity index 100% rename from test/input/func_noerror_import_q.py rename to pylint_django/tests/input/func_noerror_import_q.py diff --git a/test/input/func_noerror_issue_46.py b/pylint_django/tests/input/func_noerror_issue_46.py similarity index 100% rename from test/input/func_noerror_issue_46.py rename to pylint_django/tests/input/func_noerror_issue_46.py diff --git a/test/input/func_noerror_manytomanyfield.py b/pylint_django/tests/input/func_noerror_manytomanyfield.py similarity index 100% rename from test/input/func_noerror_manytomanyfield.py rename to pylint_django/tests/input/func_noerror_manytomanyfield.py diff --git a/test/input/func_noerror_model_fields.py b/pylint_django/tests/input/func_noerror_model_fields.py similarity index 100% rename from test/input/func_noerror_model_fields.py rename to pylint_django/tests/input/func_noerror_model_fields.py diff --git a/test/input/func_noerror_model_methods.py b/pylint_django/tests/input/func_noerror_model_methods.py similarity index 100% rename from test/input/func_noerror_model_methods.py rename to pylint_django/tests/input/func_noerror_model_methods.py diff --git a/test/input/func_noerror_model_unicode_callable.py b/pylint_django/tests/input/func_noerror_model_unicode_callable.py similarity index 100% rename from test/input/func_noerror_model_unicode_callable.py rename to pylint_django/tests/input/func_noerror_model_unicode_callable.py diff --git a/test/input/func_noerror_model_unicode_lambda.py b/pylint_django/tests/input/func_noerror_model_unicode_lambda.py similarity index 100% rename from test/input/func_noerror_model_unicode_lambda.py rename to pylint_django/tests/input/func_noerror_model_unicode_lambda.py diff --git a/test/input/func_noerror_models_py33.py b/pylint_django/tests/input/func_noerror_models_py33.py similarity index 100% rename from test/input/func_noerror_models_py33.py rename to pylint_django/tests/input/func_noerror_models_py33.py diff --git a/test/input/func_noerror_protected_meta_access.py b/pylint_django/tests/input/func_noerror_protected_meta_access.py similarity index 100% rename from test/input/func_noerror_protected_meta_access.py rename to pylint_django/tests/input/func_noerror_protected_meta_access.py diff --git a/test/input/func_noerror_ugettext_lazy_format.py b/pylint_django/tests/input/func_noerror_ugettext_lazy_format.py similarity index 100% rename from test/input/func_noerror_ugettext_lazy_format.py rename to pylint_django/tests/input/func_noerror_ugettext_lazy_format.py diff --git a/test/input/func_noerror_unicode_py2_compatible.py b/pylint_django/tests/input/func_noerror_unicode_py2_compatible.py similarity index 100% rename from test/input/func_noerror_unicode_py2_compatible.py rename to pylint_django/tests/input/func_noerror_unicode_py2_compatible.py diff --git a/test/input/func_noerror_urls.py b/pylint_django/tests/input/func_noerror_urls.py similarity index 100% rename from test/input/func_noerror_urls.py rename to pylint_django/tests/input/func_noerror_urls.py diff --git a/test/input/func_noerror_uuid_field.py b/pylint_django/tests/input/func_noerror_uuid_field.py similarity index 100% rename from test/input/func_noerror_uuid_field.py rename to pylint_django/tests/input/func_noerror_uuid_field.py diff --git a/test/test_func.py b/pylint_django/tests/test_func.py similarity index 89% rename from test/test_func.py rename to pylint_django/tests/test_func.py index b6fd2745..e712ee2d 100644 --- a/test/test_func.py +++ b/pylint_django/tests/test_func.py @@ -8,6 +8,9 @@ sys.path.append(os.path.join(os.path.dirname(pylint.__file__), 'test')) import test_functional +# alter sys.path again because the tests now live as a subdirectory +# of pylint_django +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) from pylint_django.compat import django_version diff --git a/scripts/test.sh b/scripts/test.sh index 32d97261..9f734e67 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,2 +1,2 @@ #!/bin/bash -PYTHONPATH=. python test/test_func.py +python pylint_django/tests/test_func.py diff --git a/tox.ini b/tox.ini index 5f4cbe54..3f374773 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ commands = flake8: flake8 pylint: pylint --rcfile=tox.ini pylint_django setup readme: python setup.py check --restructuredtext --strict - py{27,34,35,36}-django{111,20}: coverage run test/test_func.py + py{27,34,35,36}-django{111,20}: coverage run pylint_django/tests/test_func.py clean: find . -type f -name '*.pyc' -delete clean: find . -type d -name __pycache__ -delete clean: rm -rf build/ .cache/ dist/ .eggs/ pylint_django.egg-info/ .tox/