-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add pformat to config object #33
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
61bf837
Add pformat to config and use 3rd party printers if available
danr f1367de
Fix tests for 3.4 which can't pp
alexmojaki 9efcf02
Refactor third party pprint imports, catch all exceptions just in case
alexmojaki 69c90a0
Add documentation and add 3rd party pp libs to tests
danr aef660b
Fix tests
alexmojaki 605a7b0
Describe pformat in the README Output configuration
danr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Test with custom pformat | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... x = custom(1) | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... pp(x) + y = custom(3) | ||
12:34:56.78 LOG: | ||
12:34:56.78 ............ x = 1 | ||
12:34:56.78 ............ y = 2 | ||
12:34:56.78 ........ x + y = 3 | ||
12:34:56.78 ........ y = 2 | ||
12:34:56.78 .... (x + y) + y = custom(5) | ||
12:34:56.78 >>> Enter with block in test_misc in File "/path/to_file.py", line 11 | ||
12:34:56.78 .......... x = 1 | ||
12:34:56.78 .......... y = 2 | ||
12:34:56.78 12 | y = 3 # custom pformat is not used here | ||
12:34:56.78 .............. y = 3 | ||
12:34:56.78 <<< Exit with block in test_misc | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = custom(['a long key to be pretty printed prettily', ['prettyprinter prints datetime with keyword arguments:', datetime.datetime(1970, 1, 1, 0, 0, 42)]]) | ||
|
||
Test without prettyprinter and without pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = ['a long key to be pretty printed prettily', | ||
12:34:56.78 ['prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42)]] | ||
|
||
Test with prettyprinter and without pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = ['a long key to be pretty printed prettily', | ||
12:34:56.78 ['prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42)]] | ||
|
||
Test without prettyprinter and with pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42), | ||
12:34:56.78 ], | ||
12:34:56.78 ] | ||
|
||
Test with prettyprinter and with pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42), | ||
12:34:56.78 ], | ||
12:34:56.78 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Test with custom pformat | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = custom(1) | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = custom(3) | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = custom(5) | ||
12:34:56.78 >>> Enter with block in test_misc in File "/path/to_file.py", line 11 | ||
12:34:56.78 .......... x = 1 | ||
12:34:56.78 .......... y = 2 | ||
12:34:56.78 12 | y = 3 # custom pformat is not used here | ||
12:34:56.78 .............. y = 3 | ||
12:34:56.78 <<< Exit with block in test_misc | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = custom(['a long key to be pretty printed prettily', ['prettyprinter prints datetime with keyword arguments:', datetime.datetime(1970, 1, 1, 0, 0, 42)]]) | ||
|
||
Test without prettyprinter and without pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = ['a long key to be pretty printed prettily', | ||
12:34:56.78 ['prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42)]] | ||
|
||
Test with prettyprinter and without pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = ['a long key to be pretty printed prettily', | ||
12:34:56.78 ['prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42)]] | ||
|
||
Test without prettyprinter and with pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42), | ||
12:34:56.78 ], | ||
12:34:56.78 ] | ||
|
||
Test with prettyprinter and with pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... <argument> = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42), | ||
12:34:56.78 ], | ||
12:34:56.78 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
Test with custom pformat | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... x = custom(1) | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... pp(x) + y = custom(3) | ||
12:34:56.78 LOG: | ||
12:34:56.78 ............ x = 1 | ||
12:34:56.78 ............ y = 2 | ||
12:34:56.78 ........ x + y = 3 | ||
12:34:56.78 ........ y = 2 | ||
12:34:56.78 .... (x + y) + y = custom(5) | ||
12:34:56.78 >>> Enter with block in test_misc in File "/path/to_file.py", line 11 | ||
12:34:56.78 .......... x = 1 | ||
12:34:56.78 .......... y = 2 | ||
12:34:56.78 12 | y = 3 # custom pformat is not used here | ||
12:34:56.78 .............. y = 3 | ||
12:34:56.78 <<< Exit with block in test_misc | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = custom(['a long key to be pretty printed prettily', ['prettyprinter prints datetime with keyword arguments:', datetime.datetime(1970, 1, 1, 0, 0, 42)]]) | ||
|
||
Test without prettyprinter and without pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = ['a long key to be pretty printed prettily', | ||
12:34:56.78 ['prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42)]] | ||
|
||
Test with prettyprinter and without pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime( | ||
12:34:56.78 year=1970, | ||
12:34:56.78 month=1, | ||
12:34:56.78 day=1, | ||
12:34:56.78 hour=0, | ||
12:34:56.78 minute=0, | ||
12:34:56.78 second=42 | ||
12:34:56.78 ) | ||
12:34:56.78 ] | ||
12:34:56.78 ] | ||
|
||
Test without prettyprinter and with pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime(1970, 1, 1, 0, 0, 42), | ||
12:34:56.78 ], | ||
12:34:56.78 ] | ||
|
||
Test with prettyprinter and with pprintpp | ||
12:34:56.78 LOG: | ||
12:34:56.78 .... d = [ | ||
12:34:56.78 'a long key to be pretty printed prettily', | ||
12:34:56.78 [ | ||
12:34:56.78 'prettyprinter prints datetime with keyword arguments:', | ||
12:34:56.78 datetime.datetime( | ||
12:34:56.78 year=1970, | ||
12:34:56.78 month=1, | ||
12:34:56.78 day=1, | ||
12:34:56.78 hour=0, | ||
12:34:56.78 minute=0, | ||
12:34:56.78 second=42 | ||
12:34:56.78 ) | ||
12:34:56.78 ] | ||
12:34:56.78 ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please also mention the pformat argument here and under Output configuration.
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.
It is mentioned there (?) I pushed a new commit which adds it to the README's Output configuration section.
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.
lol my brain only saw mention of the libraries and not the argument.