Skip to content

Commit dbb9335

Browse files
authored
test: do not assume parent directory name
1 parent 6d054cb commit dbb9335

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
@@ -318,7 +319,7 @@ def test_logger_name_is_test(self):
318319
def test_path_name_is_test(self):
319320
logger.error('An error has occured')
320321
json_record = json.loads(log_buffer.getvalue())
321-
self.assertIn('json-log-formatter/tests.py', json_record['pathname'])
322+
self.assertIn(os.path.basename(os.path.abspath('.')) + '/tests.py', json_record['pathname'])
322323

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

0 commit comments

Comments
 (0)