Skip to content

Commit

Permalink
Add missing CSV dialect for tests. Fixes #268
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-angulo authored Jul 7, 2020
1 parent 3afe91e commit 4d606f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
* [imomaliev](https://github.com/imomaliev)
* [psrb](https://github.com/psrb)
* [WayneLambert](https://github.com/WayneLambert)
* [alejandro-angulo](https://github.com/alejandro-angulo)

9 changes: 8 additions & 1 deletion pylint_django/tests/test_func.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import csv
import os
import sys
import pytest
Expand All @@ -9,6 +9,13 @@
try:
# pylint 2.5: test_functional has been moved to pylint.testutils
from pylint.testutils import FunctionalTestFile, LintModuleTest

if "test" not in csv.list_dialects():
class test_dialect(csv.excel):
delimiter = ":"
lineterminator = "\n"

csv.register_dialect("test", test_dialect)
except (ImportError, AttributeError):
# specify directly the directory containing test_functional.py
test_functional_dir = os.getenv('PYLINT_TEST_FUNCTIONAL_DIR', '')
Expand Down

0 comments on commit 4d606f6

Please sign in to comment.