<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Python%2Fpytest</id>
	<title>Python/pytest - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Python%2Fpytest"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Python/pytest&amp;action=history"/>
	<updated>2026-05-07T04:21:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Python/pytest&amp;diff=6047&amp;oldid=prev</id>
		<title>Kenneth at 15:41, 29 August 2022</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Python/pytest&amp;diff=6047&amp;oldid=prev"/>
		<updated>2022-08-29T15:41:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Pytest ==&lt;br /&gt;
&lt;br /&gt;
Looks for scripts named test_*.py or *_test.py&lt;br /&gt;
&lt;br /&gt;
== Setup and Teardown ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import pytest&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture(autouse=True)&lt;br /&gt;
def run_before_and_after_tests(tmpdir):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Fixture to execute asserts before and after a test is run&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    # Setup: fill with any logic you want&lt;br /&gt;
&lt;br /&gt;
    yield # this is where the testing happens&lt;br /&gt;
&lt;br /&gt;
    # Teardown : fill with any logic you want&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ref: [https://stackoverflow.com/questions/22627659/run-code-before-and-after-each-test-in-py-test]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>