In this work, we present an abstract error analysis framework for the approximation of linear partial differential equation problems in weak formulation. We consider approximation methods in fully discrete formulation, where the discrete and continuous spaces are possibly not embedded in a common space. A proper notion of consistency is designed, and, under a classical inf–sup condition, it is shown to bound the approximation error. This error estimate result is in the spirit of Strang’s first and second lemmas, but applicable in situations not covered by these lemmas (because of a fully discrete approximation space). An improved estimate is also established in a weaker norm, using the Aubin–Nitsche trick. We then apply these abstract estimates to an anisotropic heterogeneous diffusion model and two classical families of schemes for this model: virtual element and finite volume methods. For each of these methods, we show that the abstract results yield new error estimates with a precise and mild dependency on the local anisotropy ratio. A key intermediate step to derive such estimates for virtual element methods is proving optimal approximation properties of the oblique elliptic projector in weighted Sobolev seminorms. This is a result whose interest goes beyond the specific model and methods considered here. We also obtain, to our knowledge, the first clear notion of consistency for finite volume methods, which leads to a generic error estimate involving the fluxes and valid for a wide range of finite volume schemes. An important application is the first error estimate for multi-point flux approximation L and G methods.