Skip to content

Add prospector-json as a Reporter#72

Open
laundmo wants to merge 5 commits intojayclassless:masterfrom
laundmo:master
Open

Add prospector-json as a Reporter#72
laundmo wants to merge 5 commits intojayclassless:masterfrom
laundmo:master

Conversation

@laundmo
Copy link

@laundmo laundmo commented Aug 1, 2021

Did this while trying to get tidpy to work in vscode, nothing too complex.
tries to as closely as possible emulate the prospector json format, though some things had to be faked such as start/end timestamps and duration, as i couldn't figure out whether those were collected or in any way accessible for a Reporter.

test suite + linter should have run and passed.

@jayclassless
Copy link
Owner

LGTM. Thanks for contributing!

If you could add a test for it (see test_report_structured.py for a simple example) and update the README.rst, I'll merge this right in.

@laundmo
Copy link
Author

laundmo commented Aug 9, 2021

@jayclassless i added a test now, but im unsure how to proceed since it will always fail due to the timestamp changing. i have to get a fake timestamp for the started/stopped keys, which is just the current time, This means that any example will be different from the run by some part of the timestamp.

how can i ignore the timestamps? should i parse the json and compare that way?

@jayclassless
Copy link
Owner

how can i ignore the timestamps? should i parse the json and compare that way?

You could parse it and check the resulting dictionary, or you could use something like freezegun to hardcode a "system" time for the duration of the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants