<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div>Hi there,<br></div>
<div><br></div>
<div>A small (hopefully simple) about best practice for failing tests.<br></div>
<div><br></div>
<div>I'm building a library that communicates with an external service. That external service is run in production as a cluster with multiple nodes taking various responsibilities. As a result of this complication, the developer of the external service provides a fake of the edge of the service that I'm testing against. (That's a fake using the TotT definition as per <a href="https://testing.googleblog.com/2013/06/testing-on-toilet-fake-your-way-to.html">https://testing.googleblog.com/2013/06/testing-on-toilet-fake-your-way-to.html</a>)<br></div>
<div><br></div>
<div>However, the fake is not perfect - one tiny piece of functionality is missing in terms of how it keeps data up to date when new content is added. There is a flag provided in one of the API endpoints that allows for no stale data to be returned, but the fake does not implement this - it returns stale data even when that flag is passed.<br></div>
<div><br></div>
<div>So my question is how should I test against this in pytest?<br></div>
<div><br></div>
<div>I have a failing test where the test adds new content and queries for all content with the no stale flag passed, but the test fails because the new content is not returned. I know that this works in production against a full cluster, it's the limitation of the fake that breaks the test.<br></div>
<div><br></div>
<div>In terms of best practice (what you would like to see if you were reading my test suite), what would you recommend for this test and why? I can see some options...<br></div>
<div><br></div>
<div>* Mark the test as xfail?<br></div>
<div><br></div>
<div>* Adjust the test to pass when stale data is returned?<br></div>
<div><br></div>
<div>* Remove the test from the suite and say the functionality is untested?<br></div>
<div><br></div>
<div>Or maybe something else?<br></div>
<div><br></div>
<div>Thanks for any suggestions.<br></div>
<div><br></div>
<div>James<br></div>
<div><br></div>
<div>ps. Ideally I'd be able to extend the fake to cover this new functionality by my Go skill is just not good enough :(<br></div>
</body>
</html>