Skip to content

Commit bf41c57

Browse files
authored
Merge pull request #30 from kapouer/patch-1
test: do not assume parent directory name
2 parents 6141b3a + b29dc07 commit bf41c57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import unittest
55
import logging
66
import json
7+
import os.path
78

89

910
from django.core.handlers.wsgi import WSGIRequest
@@ -319,7 +320,7 @@ def test_logger_name_is_test(self):
319320
def test_path_name_is_test(self):
320321
logger.error('An error has occured')
321322
json_record = json.loads(log_buffer.getvalue())
322-
self.assertIn('json-log-formatter/tests.py', json_record['pathname'])
323+
self.assertIn(os.path.basename(os.path.abspath('.')) + '/tests.py', json_record['pathname'])
323324

324325
def test_process_name_is_MainProcess(self):
325326
logger.error('An error has occured')

0 commit comments

Comments
 (0)