Skip to content

Using local copy of pylint.testutils if import fails #98

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
python test/test_func.py
python -m test.test_func
2 changes: 1 addition & 1 deletion scripts/travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ python scripts/travis_skip.py

if [ "$?" -eq "0" ]
then
coverage run test/test_func.py
coverage run -m test.test_func
else
echo "Skipping"
fi
Empty file added test/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion test/input/func_noerror_form_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ManyFieldsForm(forms.Form):
imagefield = forms.ImageField(name='test_image', upload_to='test')
# note: IPAdressField has been deprecated since django 1.7 so might not
# be available if using django 1.8+
ipaddressfield = getattr(forms, 'IPAddressField', 'GenericIPAddressField')()
ipaddressfield = getattr(forms, 'IPAddressField', getattr(forms, 'GenericIPAddressField'))()
intfield = forms.IntegerField(null=True)
nullbooleanfield = forms.NullBooleanField()
slugfield = forms.SlugField()
Expand Down
6 changes: 5 additions & 1 deletion test/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
import sys
import unittest
from django.conf import settings
from pylint.testutils import make_tests, LintTestUsingFile, cb_test_gen, linter
from pylint_django.compat import django_version

try:
from pylint.testutils import make_tests, LintTestUsingFile, cb_test_gen, linter
except ImportError:
from .testutils import make_tests, LintTestUsingFile, cb_test_gen, linter


settings.configure()

Expand Down
Loading