-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: do not assume parent directory name #30
Conversation
@@ -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']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please tell when does this test break and how can it be reproduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just by not having the name of the root directory of the project to be "json-log-formatter".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no plans to rename the directory name, so I am not sure how it can help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, i made a debian package python3-json-log-formatter
The source of that package, when being built in debian infrastructure, is put in some directory like
python-json-log-formatter_0.5.2/
Since the tests are run from that directory, one of them fail.
The change I propose here let the test work independently of the name of the parent directory where the test is run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that makes sense.
Could you please rebase your branch? |
Thank you 👍. |
No description provided.