<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DevOps Fundamentals: 08 - Creating and Executing Unit Tests: Instructions doesn't match code in Certifications</title>
    <link>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/174802#M5171</link>
    <description>&lt;P&gt;Thanks for the reporting link. I wonder though why users should be reporting these errors when review by AI is so effective. Just review all the notebooks with AI and improve the quality in one fell swoop.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daniel_B_0-1793138207065.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/32618i964B8A40C3EF4E3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daniel_B_0-1793138207065.png" alt="Daniel_B_0-1793138207065.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2026 21:58:30 GMT</pubDate>
    <dc:creator>Daniel_B</dc:creator>
    <dc:date>2026-10-27T21:58:30Z</dc:date>
    <item>
      <title>DevOps Fundamentals: 08 - Creating and Executing Unit Tests: Instructions doesn't match code</title>
      <link>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/173951#M5127</link>
      <description>&lt;P&gt;Instructions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;To execute pytest within Databricks complete the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;sys.dont_write_bytecode = True - By default, Python generates .pyc bytecode files in a &lt;STRONG&gt;pycache&lt;/STRONG&gt; directory. Setting it to True prevents this, which is useful in read-only environments.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Code in cell directly underneath:&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;sys.dont_write_bytecode &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;False&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Thanks. I hereby claim my $1000000 bug bounty. You're welcome.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2026 21:04:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/173951#M5127</guid>
      <dc:creator>Daniel_B</dc:creator>
      <dc:date>2026-10-19T21:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: DevOps Fundamentals: 08 - Creating and Executing Unit Tests: Instructions doesn't match code</title>
      <link>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/174086#M5129</link>
      <description>&lt;P&gt;Good catch - the instruction text is right and the code cell is the typo. It should be sys.dont_write_bytecode = True. With False (Python's default) the tests still run, since Python silently ignores a failed .pyc write, but on a writable Git folder you end up with __pycache__ folders next to your test files.&lt;/P&gt;&lt;P&gt;Use the same pattern as the Databricks unit-testing docs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import pytest, sys&lt;/P&gt;&lt;P&gt;sys.dont_write_bytecode = True&amp;nbsp; # skip .pyc files on a read-only filesystem&lt;/P&gt;&lt;P&gt;retcode = pytest.main([".", "-v", "-p", "no:cacheprovider"])&amp;nbsp; # no .pytest_cache either&lt;/P&gt;&lt;P&gt;assert retcode == 0, "The pytest invocation failed. See the log for details."&lt;/P&gt;&lt;P&gt;-p no:cacheprovider is the companion setting - it stops pytest writing its .pytest_cache folder for the same reason.&lt;/P&gt;&lt;P&gt;If you already ran the lab with False and see __pycache__ folders in your repo, delete them (or add __pycache__/ to .gitignore) so they don't get committed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the notebook fixed for other learners, report it to the Academy team: &lt;A href="https://help.databricks.com/s/contact-us?ReqType=training" target="_blank"&gt;https://help.databricks.com/s/contact-us?ReqType=training&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/aws/en/notebooks/testing" target="_blank"&gt;https://docs.databricks.com/aws/en/notebooks/testing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2026 19:45:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/174086#M5129</guid>
      <dc:creator>SumeshKashyap</dc:creator>
      <dc:date>2026-10-20T19:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: DevOps Fundamentals: 08 - Creating and Executing Unit Tests: Instructions doesn't match code</title>
      <link>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/174802#M5171</link>
      <description>&lt;P&gt;Thanks for the reporting link. I wonder though why users should be reporting these errors when review by AI is so effective. Just review all the notebooks with AI and improve the quality in one fell swoop.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daniel_B_0-1793138207065.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/32618i964B8A40C3EF4E3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daniel_B_0-1793138207065.png" alt="Daniel_B_0-1793138207065.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2026 21:58:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/certifications/devops-fundamentals-08-creating-and-executing-unit-tests/m-p/174802#M5171</guid>
      <dc:creator>Daniel_B</dc:creator>
      <dc:date>2026-10-27T21:58:30Z</dc:date>
    </item>
  </channel>
</rss>

