From 68c17f118199e2ca7be4549ddd890a2c60901233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Elsd=C3=B6rfer?= Date: Tue, 30 Aug 2016 13:33:35 +0200 Subject: [PATCH 1/2] Generate coverage reports. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 5412ac3..362f2a6 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = nose pytest pytest-cov hypothesis -commands = py.test +commands = py.test --cov escpos [testenv:docs] basepython = python From 58ea206c36e42a30435ea63fe860d1a357a6948c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Elsd=C3=B6rfer?= Date: Tue, 30 Aug 2016 16:13:38 +0200 Subject: [PATCH 2/2] Avoid mutable default argumet. --- src/escpos/capabilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/escpos/capabilities.py b/src/escpos/capabilities.py index 9ae0e79..3dd5c32 100644 --- a/src/escpos/capabilities.py +++ b/src/escpos/capabilities.py @@ -92,11 +92,11 @@ def clean(s): # For users, who want to provide their profile class Profile(get_profile_class('default')): - def __init__(self, columns=None, features={}): + def __init__(self, columns=None, features=None): super(Profile, self).__init__() self.columns = columns - self.features = features + self.features = features or {} def get_columns(self, font): if self.columns is not None: