Skip to content

Commit 96de0ba

Browse files
committed
276 - Adding test to make sure the Pylint plugin is picklable
1 parent 200bee9 commit 96de0ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pylint_django/tests/test_func.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import csv
22
import os
3+
import pickle
34
import sys
45

56
import pylint
@@ -112,5 +113,15 @@ def test_migrations_plugin(test_file):
112113
LintTest._runTest()
113114

114115

116+
@pytest.mark.parametrize("test_file", MIGRATIONS_TESTS[:1], ids=MIGRATIONS_TESTS_NAMES[:1])
117+
def test_linter_should_be_pickleable_with_pylint_djang_plugin_installed(test_file):
118+
LintTest = PylintDjangoMigrationsTest(test_file)
119+
LintTest.setUp()
120+
121+
# LintModuleTest sets reporter to instance of FunctionalTestReporter that is not picklable
122+
LintTest._linter.reporter = None
123+
pickle.dumps(LintTest._linter)
124+
125+
115126
if __name__ == "__main__":
116127
sys.exit(pytest.main(sys.argv))

0 commit comments

Comments
 (0)