<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cases (Posts about python)</title><link>https://fizyk.dev/</link><description></description><atom:link href="https://fizyk.dev/tags/python.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Thu, 27 Nov 2025 12:02:29 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Running python tests on Travis's OSX workers</title><link>https://fizyk.dev/blog/running-python-tests-on-traviss-osx-workers/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;I, and my colleages are running tests mostly on linux, since our packages usually are clean python implementation.
However, for &lt;a class="reference external" href="https://pypi.python.org/pypi/mirakuru/"&gt;mirakuru&lt;/a&gt;, which we use to govern processes in tests,
and by extension &lt;a class="reference external" href="https://pypi.python.org/pypi/pytest-dbfixtures/"&gt;pytest-dbfixtures&lt;/a&gt;,
which has predefined process fixtures for pytest, we wanted to run tests also on osx. Travis.ci for
a long time had option to configure osx workers and linux, however python builds on osx are kind of broken by default.&lt;/p&gt;
&lt;p&gt;Travis.ci has a long standing &lt;a class="reference external" href="https://github.com/travis-ci/travis-ci/issues/2312"&gt;bug report&lt;/a&gt; for this issue,
which will get 2 years old in this May. Apparently, just setting python as a language and osx among
the system to test on won't work for apple's operating system.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/running-python-tests-on-traviss-osx-workers/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>osx</category><category>python</category><category>tests</category><category>travis</category><guid>https://fizyk.dev/blog/running-python-tests-on-traviss-osx-workers/</guid><pubDate>Sun, 20 Mar 2016 20:44:55 GMT</pubDate></item><item><title>Creating a timestamp in python - difference between calendar.timegm and time.mktime</title><link>https://fizyk.dev/blog/creating-a-timestamp-in-python-difference-between-calendartimegm-and-timemktime/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;If think most of python programmers realise that there are two ways of getting timestamp with only the
help of stdlib libraries. It's &lt;a class="reference external" href="https://docs.python.org/3.5/library/time.html#time.mktime"&gt;time.mktime&lt;/a&gt;
and weirdly placed &lt;a class="reference external" href="https://docs.python.org/3.5/library/calendar.html#calendar.timegm"&gt;calendar.timegm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are two things people are probably not aware. First one can be attributed due to the fact that
their docs are not being read properly, or more often skipped is that &lt;strong&gt;time.mktime&lt;/strong&gt; function treats
timetuple as if it were representing date and time in machine local time. This means even if you
extract timetuple from your datetime object using
&lt;a class="reference external" href="https://docs.python.org/3.5/library/datetime.html#datetime.datetime.utctimetuple"&gt;utctimetuple&lt;/a&gt; method
resulting timestamp will still be a given date in your system local time zone. Might not be a problem
at all on production, but will be a much bigger issue on your machine, when you pull some data to analyse.
&lt;strong&gt;calendar.timegm&lt;/strong&gt; on the other hand, treats all input data as if it were passed in utc.&lt;/p&gt;
&lt;p&gt;Speaking of which, none of those two functions accepts a parameter that would tell which timezone the
timetuple is in. The only difference is that &lt;strong&gt;time.mktime&lt;/strong&gt; returns a float and &lt;strong&gt;calendar.timegm&lt;/strong&gt;
returns an integer.&lt;/p&gt;
&lt;p&gt;Second things - timegm function is faster than mktime! See the short benchmarks below:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/creating-a-timestamp-in-python-difference-between-calendartimegm-and-timemktime/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>calendar</category><category>performance</category><category>python</category><category>time</category><guid>https://fizyk.dev/blog/creating-a-timestamp-in-python-difference-between-calendartimegm-and-timemktime/</guid><pubDate>Wed, 25 Nov 2015 19:18:16 GMT</pubDate></item><item><title>Measuring test coverage of py.test plugins</title><link>https://fizyk.dev/blog/measuring-test-coverage-of-pytest-plugins/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;Measuring your code's test coverage is important, though not definitive metric
to tell that Your code is well tested. But to measure coverage properly, tests
have to be properly initialized as well. And today I asked myself a question,
how do I measure properly test coverage of &lt;a class="reference external" href="http://pytest.org/"&gt;py.test&lt;/a&gt;
plugins?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/measuring-test-coverage-of-pytest-plugins/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>coverage</category><category>pytest</category><category>python</category><guid>https://fizyk.dev/blog/measuring-test-coverage-of-pytest-plugins/</guid><pubDate>Sun, 16 Nov 2014 15:54:42 GMT</pubDate></item><item><title>pytest-dbfixtures now works with python 3</title><link>https://fizyk.dev/blog/pytest-dbfixtures-now-works-with-python-3/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;Few days ago we've released a python3 compatible version of pytest-dbfixtures,
a pytest plugin with fixtures and factories that can start fresh
mysql, postgresql, elasticsearch, redis, rabbitmq and mongodb processes for Your tests -
and clean their data afterwards. It also provides factories for fixtures
if you'd need more processes of one kind or with different settings.&lt;/p&gt;
&lt;p&gt;Unfortunately, if You've been using rabbitmq and/or mysql related fixtures,
please check your tests carefuly, as these fixtures got most backward incompatible changes.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/pytest-dbfixtures-now-works-with-python-3/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>dbfixtures</category><category>pytest</category><category>python</category><guid>https://fizyk.dev/blog/pytest-dbfixtures-now-works-with-python-3/</guid><pubDate>Sat, 08 Nov 2014 18:16:25 GMT</pubDate></item><item><title>pyramid_fullauth 0.4 - python3 and few fixes</title><link>https://fizyk.dev/blog/pyramid_fullauth-04-python3-and-few-fixes/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;I've just released version 0.4 of my pyramid extension,
&lt;a class="reference external" href="https://pypi.python.org/pypi/pyramid_fullauth"&gt;pyramid_fullauth&lt;/a&gt;.
It's goal is to allow to add authentication abilities - both password- and
social-based authentication - to pyramid based apps by the means of configuration mostly.&lt;/p&gt;
&lt;p&gt;This version comes with limited python3 compatibility, and two bugfixes.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/pyramid_fullauth-04-python3-and-few-fixes/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>authentication</category><category>fullauth</category><category>pyramid</category><category>python</category><guid>https://fizyk.dev/blog/pyramid_fullauth-04-python3-and-few-fixes/</guid><pubDate>Sun, 02 Nov 2014 18:46:35 GMT</pubDate></item><item><title>Commit a day, will scratch Your itch away</title><link>https://fizyk.dev/blog/commit-a-day-will-scratch-your-itch-away/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;At August's &lt;strong&gt;wroc.py&lt;/strong&gt; meeting I had a brief discussion with &lt;a class="reference external" href="http://www.bthlabs.pl/"&gt;Tomek Wójcik&lt;/a&gt; about &lt;a class="reference external" href="http://tomekwojcik.github.io/envelopes/"&gt;Envelopes&lt;/a&gt;'s state, and those long opened issues at his issue tracker.&lt;/p&gt;
&lt;p&gt;While thinking about what Tomek said, I remembered reading &lt;a class="reference external" href="http://jeffknupp.com/"&gt;Jeff Knupp's&lt;/a&gt; post about &lt;a class="reference external" href="http://jeffknupp.com/blog/2014/05/30/you-need-to-start-a-whizbang-project-immediately/"&gt;whizbang project&lt;/a&gt;, a highly motivational post about willingness to do something - and it got me thinking... What makes project tick? Why does Django, Twisted, Celery have grown so big?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/commit-a-day-will-scratch-your-itch-away/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>community</category><category>open source</category><category>python</category><guid>https://fizyk.dev/blog/commit-a-day-will-scratch-your-itch-away/</guid><pubDate>Thu, 04 Sep 2014 21:03:07 GMT</pubDate></item><item><title>My first bump with pypy</title><link>https://fizyk.dev/blog/my-first-bump-with-pypy/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;Just until two weeks ago, I was only reading about PyPy. My though about it was somewhat simple: that's the interpreter, that speeds up python code. I expected that some changes to python code, that's supposed to run in PyPy will be required, but I thought it will be easy to spot. I haven't been more wrong.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/my-first-bump-with-pypy/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>pypy</category><category>python</category><guid>https://fizyk.dev/blog/my-first-bump-with-pypy/</guid><pubDate>Thu, 21 Aug 2014 20:34:42 GMT</pubDate></item><item><title>mirakuru 0.2 released</title><link>https://fizyk.dev/blog/mirakuru-02-released/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;Last Thursday, we released new minor version of mirakuru.
Mirakuru is a helpful tools that lets add superpowers to Your tests, or maybe
other scripts that need other processes to run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Changes introduced to mirakuru 0.2 - are:&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;context managers (for both starting and stopping)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ability to detect if resources required by executors (TCP or HTTP) aren't already used.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and a fix, for killing executors started with their own shell.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/mirakuru-02-released/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>mirakuru</category><category>python</category><category>testing</category><guid>https://fizyk.dev/blog/mirakuru-02-released/</guid><pubDate>Sat, 16 Aug 2014 19:21:07 GMT</pubDate></item><item><title>mirakuru, your tests little helper</title><link>https://fizyk.dev/blog/mirakuru-your-tests-little-helper/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;Just yesterday, we released first version of mirakuru.
Mirakuru is a helpful tools that lets add superpowers to Your tests, or maybe
other scripts that need other processes to run.&lt;/p&gt;
&lt;p&gt;With few lines of code, mirakuru guarantees, that when running, your script will
start it's own database instance, or the webserver you've just wrote, and need
to test it by sending real requests to it - automatically.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/mirakuru-your-tests-little-helper/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>mirakuru</category><category>python</category><category>testing</category><guid>https://fizyk.dev/blog/mirakuru-your-tests-little-helper/</guid><pubDate>Thu, 03 Jul 2014 18:19:11 GMT</pubDate></item><item><title>Deploying python packages with travis-ci</title><link>https://fizyk.dev/blog/deploying-python-packages-with-travis-ci/</link><dc:creator>Grzegorz Śliwiński</dc:creator><description>&lt;div&gt;&lt;p&gt;Deploying applications is tedious, so is deployin packages, no matter the package repository.
For example after applying changes to codebase, the code needs to be tagged,
as to not loose the point of release from sight, after that the packages needs
to be built and uploaded. It's far too many commands that need to be done.
One might develop some deployment scripts. Sure, but what, if we could use something else to
deploy packages for us?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://fizyk.dev/blog/deploying-python-packages-with-travis-ci/"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>pypi</category><category>python</category><category>travis</category><guid>https://fizyk.dev/blog/deploying-python-packages-with-travis-ci/</guid><pubDate>Sun, 04 May 2014 17:21:09 GMT</pubDate></item></channel></rss>