Quantcast
Viewing latest article 10
Browse Latest Browse All 40

use sessions everywhere and betamax for all queries

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 latest article 10
Browse Latest Browse All 40

Trending Articles