Skip to content

Commit e057a03

Browse files
committed
Fixed static test
1 parent d3037e9 commit e057a03

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_static_analysis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ def check_line_import_datetime(line, **_):
1111
return 'Importing datetime as a module is not allowed. Please use `from datetime import ...` to import the symbol you need.'
1212

1313

14-
def check_line_datetime_now(line, **_):
14+
def check_line_datetime_now(line, full_path, **_):
15+
if full_path.endswith('conf.py'):
16+
return
1517
if 'datetime.now()' in line:
1618
return "Don't use `datetime.now()`, you should use `django.timezone.now`"
1719
if 'datetime.utcnow()' in line:
@@ -54,7 +56,7 @@ def test_static_analysis():
5456
with open(full_path) as f:
5557
for i, line in enumerate(f.readlines(), start=1):
5658
for check in checks:
57-
message = check(line)
59+
message = check(line=line, full_path=full_path)
5860
if message:
5961
errors.append((full_path, i, line, message))
6062

0 commit comments

Comments
 (0)