Monday, February 8, 2021

Test and Code: 143: pytest markers - Anthony Sottile

Completely nerding out about pytest markers with Anthony Sottile.

Some of what we talk about:

  • Running a subset of tests with markers.
  • Using marker expressions with and, or, not, and parentheses.
  • Keyword expressions also can use and, or, not, and parentheses.
  • Markers and pytest functionality that use mark, such as parametrize, skipif, etc.
  • Accessing markers with itermarkers and get_closest_marker through item.
  • Passing values, metadata through markers to fixtures or hook functions.

Special Guest: Anthony Sottile.

Sponsored By:

Support Test & Code : Python Testing for Software Engineering

Links:

<p>Completely nerding out about pytest markers with Anthony Sottile.</p> <p>Some of what we talk about:</p> <ul> <li>Running a subset of tests with markers.</li> <li>Using marker expressions with <code>and</code>, <code>or</code>, <code>not</code>, and parentheses.</li> <li>Keyword expressions also can use <code>and</code>, <code>or</code>, <code>not</code>, and parentheses.</li> <li>Markers and pytest functionality that use mark, such as <code>parametrize</code>, <code>skipif</code>, etc.</li> <li>Accessing markers with <code>itermarkers</code> and <code>get_closest_marker</code> through <code>item</code>.</li> <li>Passing values, <code>metadata</code> through markers to fixtures or hook functions.</li> </ul><p>Special Guest: Anthony Sottile.</p><p>Sponsored By:</p><ul><li><a href="https://ift.tt/2JDHRTz" rel="nofollow">PyCharm Professional</a>: <a href="https://ift.tt/2JDHRTz" rel="nofollow">Try PyCharm Pro for 4 months and learn how PyCharm will save you time.</a> Promo Code: TESTANDCODE21</li></ul><p><a href="https://ift.tt/2tzXV5e" rel="payment">Support Test & Code : Python Testing for Software Engineering</a></p><p>Links:</p><ul><li><a href="https://ift.tt/2O6j9mz" title="Registering markers" rel="nofollow">Registering markers</a></li><li><a href="https://ift.tt/3tEx9ED" title="slow marker example in pytest documentation" rel="nofollow">slow marker example in pytest documentation</a> &mdash; Control skipping of tests according to command line option</li><li><a href="https://ift.tt/3tAK6z6" title="pytest-repeat · PyPI" rel="nofollow">pytest-repeat · PyPI</a></li><li><a href="https://ift.tt/39WYDgB" title="source code for pytest-repeat" rel="nofollow">source code for pytest-repeat</a></li><li><a href="https://ift.tt/2MJeU02" title="Working with custom markers — pytest documentation" rel="nofollow">Working with custom markers — pytest documentation</a></li><li><a href="https://ift.tt/3tEYKoU" title="Using -k expr to select tests based on their name" rel="nofollow">Using -k expr to select tests based on their name</a></li><li><a href="https://ift.tt/3jqEZNr" title="Marker revamp and iteration, Historical Notes — pytest documentation" rel="nofollow">Marker revamp and iteration, Historical Notes — pytest documentation</a></li></ul>

from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...