Skip to content

Remove QueueListener test#101

Merged
tonybaloney merged 1 commit into
microsoft:mainfrom
aminalaee:remove-queue-listener-test
Nov 2, 2022
Merged

Remove QueueListener test#101
tonybaloney merged 1 commit into
microsoft:mainfrom
aminalaee:remove-queue-listener-test

Conversation

@aminalaee

@aminalaee aminalaee commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

I think there's no issue with the QueueListener hut as explained it's a testing limitation with pytest caplog.
closes #90

@Goldziher

Copy link
Copy Markdown
Contributor

This is no way to test this - either adjust the test to make it pass, if you think it's faulty, or identify the issue.

I know for a fact this is not working because I tested it on my end, see the link. But even if that was not the case, simply removing the test without a clear assertion there is no issue (via working test), is imho wrong.

@aminalaee

Copy link
Copy Markdown
Contributor Author

Well there was already a test for this that’s why I suggested to remove it.

assert stream.getvalue() == "test\n"

But if it’s different or I made a mistake we van close this.

@Goldziher Goldziher mentioned this pull request Sep 26, 2022
@Goldziher

Copy link
Copy Markdown
Contributor

@aminalaee --> #102

@Goldziher

Copy link
Copy Markdown
Contributor

Well there was already a test for this that’s why I suggested to remove it.

assert stream.getvalue() == "test\n"

But if it’s different or I made a mistake we van close this.

that test only shows that the value is written to the stream. Yet the tests I added demonstrate that this is not written into the output captured by pytest. Something is not right - somewhere.

@aminalaee

aminalaee commented Sep 26, 2022

Copy link
Copy Markdown
Contributor Author

I don't think the tests you updated are the same.
In stdlib logging you are writing to stdout but in picologging test you are writing to a StringIO so you can't check caplog.

I might be wrong though, let's wait for the maintainers to review.

@Goldziher

Copy link
Copy Markdown
Contributor

I don't think the tests you updated are the same. In stdlib logging you are writing to stdout but in picologging test you are writing to a StringIO so you can't check caplog.

I might be wrong though, let's wait for the maintainers to review.

I simply used the example in the docs for the tests. In starlite I do not use the same code, and it still fails.

@pamelafox

Copy link
Copy Markdown
Member

[Posting on both relevant PRs]
To keep our discussion in one place for now, let's keep discussing in #90 and then figure out what code change to make.
Thank you!

@aminalaee
aminalaee marked this pull request as draft September 27, 2022 07:36
@pamelafox
pamelafox marked this pull request as ready for review October 30, 2022 00:58
@pamelafox

Copy link
Copy Markdown
Member

This is fine to remove now since the test based on it is now checked in:
https://github.com/microsoft/picologging/pull/122/files#diff-9860c055bbe5b5def7a4f1ca7574748b0afad2904461493c41a631559f5fb97eR48

@tonybaloney
tonybaloney merged commit 4c8641d into microsoft:main Nov 2, 2022
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.

Bug: QueueListener doesn't work

4 participants