Apple sauce chicken

Posted:
Tags:  apple chicken kitchen oven recipe

I sometimes like to get my thoughts into kitchen and cook something tasty. I might not look like, but I like to eat. One of my recent adventures was Apple sauce chicken. Whole idea of such chicken seems more difficult, than it actually is.

Read more…

Comments

Easy way to debug email communication in python

Posted:
Tags:  email python smtp tip

I might not be fond of Django itself, but one can learn a thing or two from it. For example, if it wasn't for working with Django, I'd probably miss the fact, that you can start a simple smtp server to debug email communications in your apps (no matter the programming language).

python -m smtpd -n -c DebuggingServer localhost:1025

It's simple as that. Now you can just configure your app to use smtp connection as passed to smtpd server here.

Comments

Gathering tests coverage for subprocesses in python

Posted:
Tags:  coverage pytest python testing

Recently at work I've stumbled across quite a problem, how do You check your code coverage, especially in integration tests, when portions of your code are running as subprocesses?

tl;dr: Be gentle.

Read more…

Comments

pyramid_fullauth 0.2.0

Posted:
Tags:  csrf fullauth pyramid release

I've just released new version of pyramid_fullauth v0.2.0. It gained License, test were rewritten to py.test, and CSRF token handling seen major overhaul.

Read more…

Comments

pytest_sauce, a helpful companion to your selenium tests written in pytest

Posted:
Tags:  pytest python saucelabs selenium

Last week, our team at Clearcode has released package to PyPI, that takes most of the tedious tasks when writing and running selenium tests of Ones shoulder. It main tasks is to take prepared configuration file, which tells paytest_sauce what tests and what browser should the tests be run in, and then run them. But that's not all.

Read more…

Comments

SQLAlchemy speed tests on postgres and mysql

Posted:
Tags:  mysql postgresql python sqlalchemy

10 months ago, I run sqlalchemy tests against mysql server on different mysql dialects. This time, I did the same, but for both postgres and mysql dialects.

Read more…

Comments

Powerline-shell - beautify your shell

Posted:
Tags:  shell tip

There are hacks to make your terminal more developer friendly. Like displaying current virtual env, and git branch. But there are ways to display these things more clearly as well. One of such ways is Powerline-shell

Read more…

Comments

Travis-CI - continuous integration for your python project

Posted:
Tags:  continuous integration howto python

A long while ago, with help of Tomek Święcicki, I've discovered Travis-CI, a service that provides Continuous integration, to both open source, and enterprise projects, and that's quite easy to connect to Github repository.

Read more…

Comments

pyramid_fullauth can speak Your language now

Posted:
Tags:  authentication pyramid python

A couple of days ago, I completed and released new version of pyramid_fullauth, now at 0.1. This package aims to provide full authorization and authentication functionality for Your pyramid application. It provides standard email authentication, and by integrating velruse, it also allows for broad spectrum of social and oauth2 services authentication, by just the means of settings config! So what's new in version 0.1?

Read more…

Comments

unicode is faster than decode

Posted:
Tags:  benchmark python tip

This might come as a surprise, but in python 2.7, it's actually faster to decode strigs with unicode function, than decode method.

>>> from timeit import Timer
>>> s = "grzegrzółka"
>>> ts = Timer(lambda: s.decode('utf-8'))
>>> ts.timeit()
1.4051871299743652
>>> tu = Timer(lambda: unicode(s, 'utf-8'))
>>> tu.timeit()
0.4272959232330322

Of course, unicode method isn't valid for python3, but you can always mock it's behaviour for py3 in some compat.py file, but... strings in python3 are finally unicode, not ascii like in python2.7,so unless you develop some nice library, you probably know what python version will be running your project.

Comments