<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Coding on Home</title>
    <link>https://borisquiroz.dev/tags/coding/</link>
    <description>Recent content in Coding on Home</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>&lt;&lt; end &gt;&gt;</copyright>
    <lastBuildDate>Sat, 10 Oct 2020 21:38:39 -0400</lastBuildDate>
    <atom:link href="https://borisquiroz.dev/tags/coding/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>🐍 Testing exit codes with Pytest</title>
      <link>https://borisquiroz.dev/posts/testing-python-exit-codes/</link>
      <pubDate>Sat, 10 Oct 2020 21:38:39 -0400</pubDate>
      <guid>https://borisquiroz.dev/posts/testing-python-exit-codes/</guid>
      <description>&lt;p&gt;As almost every other sysadmin I know, python is the language of choice to do some scripting. And, as we all know, testing is an important part of any development.&lt;/p&gt;&#xA;&lt;p&gt;My code is a simple parser that interacts with some Linux commands using &lt;a href=&#34;https://docs.python.org/3/library/subprocess.html#module-subprocess&#34;&gt;subprocess&lt;/a&gt;, which instead of raising an exception it returns something != 0. In fact, the exit code is 2. How to test that with pytest? This is what I did (which might not be &lt;em&gt;the best&lt;/em&gt; way to do it):&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
