<div dir="ltr"><div dir="ltr"><div>Hi there</div><div><br></div><div>Not sure if I'm missing something in the docs. I'm trying to add a marker to every test that's decorated with a given fixture. What I have currently is this:</div><div><span style="font-family:monospace,monospace"><br></span><blockquote><span style="font-family:monospace,monospace">def pytest_itemcollected(item):</span><br><span style="font-family:monospace,monospace">    if 'solr' in item.fixturenames:</span><br><span style="font-family:monospace,monospace">        # so you can skip it with "-m 'not solr'"</span><br><span style="font-family:monospace,monospace">        item.add_marker('solr')</span><br><span style="font-family:monospace,monospace"></span></blockquote></div><div><br></div><div>This sort of works ( the marker is present by the time the test runs), but command-line filtering options (`-m 'not solr'`) don't filter based on it. I guess this hook is running after those options have been consulted?<br></div><div><br></div><div>I also tried the same thing in pytest_collection_modifyitems, but that happens later so is even less likely to work.</div><div><br></div><div>Is there an earlier hook where I can modify an item before the command line filtering options are checked?</div><div><br></div><div>Thanks</div><div>Craig<br></div></div></div>