praw-dev / praw

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
http://praw.readthedocs.io/
BSD 2-Clause "Simplified" License
3.51k stars 460 forks source link

An effort should be made to patch every integration test #1405

Closed PythonCoderAS closed 4 years ago

PythonCoderAS commented 4 years ago

An effort should be made to patch every integration test. There are a lot of tests that only work because they have not been rebuilt. While that makes it work, if any significant revision leads to the rebuilding of tests, then all of the new tests will fail.

Originally posted by @PythonCoderAS in https://github.com/praw-dev/praw/pull/1403

jarhill0 commented 4 years ago

I don't believe this is an issue in general. In #1403 you modified the behavior to change what used to be a single request into multiple. That change led to rate-limiting behavior kicking in, where it hadn't before.

What's more, since re-recording cassettes is fairly rare, it's easy enough to just update any patching when that is done on a case-by-case basis.

PythonCoderAS commented 4 years ago

I'm saying that it's a good future-proofing technique.

jarhill0 commented 4 years ago

Right, I hear you. I'm just saying that those tests didn't need to be patched until you updated the code that it was testing. There's no use in patching a test before it needs it.

PythonCoderAS commented 4 years ago

I'm just marking it is an issue so that it can be used to track patching efforts.

jarhill0 commented 4 years ago

There are no tests that call sleep but do not patch it — after all, if there were, those tests would fail. And tests that do not call sleep should not patch it.

Re-recording cassettes does not cause sleep behavior to change. Changing the underlying PRAW behavior is what causes that. Please close the issue.

PythonCoderAS commented 4 years ago

I see, it's a fundamental misunderstanding on my part. Sorry for wasting your time.

jarhill0 commented 4 years ago

No worries! I see where you're coming from.