Skip to content

Commit

Permalink
Merge pull request #30 from kapouer/patch-1
Browse files Browse the repository at this point in the history
test: do not assume parent directory name
  • Loading branch information
marselester authored Jan 6, 2024
2 parents 6141b3a + b29dc07 commit bf41c57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
import logging
import json
import os.path


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

def test_process_name_is_MainProcess(self):
logger.error('An error has occured')
Expand Down

0 comments on commit bf41c57

Please sign in to comment.