Quantcast
Channel: feed2exec:73760056a5833ddfbcaa6725b4c6780380f5c771 commits
Viewing all articles
Browse latest Browse all 40

use sessions everywhere and betamax for all queries

$
0
0
using sessions allows us to override the user-agent reliably everywhere. our pattern is less than ideal, however: we use a global session whereas we should probably create a FeedFetcher class. our approach currently makes it clunky to expose the global session, as we can see in the wayback plugin. we switch to the betamax plugin as its configuration is slightly easier to use: we can have a global toggle in conftest.py and use pytest fixtures for tests that require them (and only those, so we can bypass them easily). this, in turn, means we completely eliminate any potential network interactions during tests by committing the "cassettes", the recorded request results.

Viewing all articles
Browse latest Browse all 40

Trending Articles