Skip to content

Commit

Permalink
test: do not assume parent directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
kapouer authored Jan 6, 2024
1 parent 6d054cb commit dbb9335
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 @@ -318,7 +319,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 dbb9335

Please sign in to comment.