From d672ca12689001ece4f1218d10f311ac739446a4 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Thu, 11 Feb 2016 18:37:13 +0100 Subject: [PATCH] improve packaging and test environment --- setup.py | 10 +++++----- test/test_load_module.py | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 06b2933..ca26552 100755 --- a/setup.py +++ b/setup.py @@ -38,10 +38,10 @@ class Tox(TestCommand): sys.exit(errno) setup( - name='escpos', - version='1.0.9', - url='https://github.com/manpaz/python-escpos', - download_url='https://github.com/manpaz/python-escpos.git', + name='python-escpos', + version='1.0.9-dev', + url='https://github.com/python-escpos/python-escpos', + download_url='https://github.com/python-escpos/python-escpos/archive/master.zip', description='Python library to manipulate ESC/POS Printers', license='GNU GPL v3', long_description=read('README'), @@ -71,6 +71,6 @@ setup( 'qrcode>=4.0', 'pyserial', ], - tests_require=['tox'], + tests_require=['tox', 'nose'], cmdclass={'test': Tox}, ) diff --git a/test/test_load_module.py b/test/test_load_module.py index 455b074..9603cf1 100644 --- a/test/test_load_module.py +++ b/test/test_load_module.py @@ -1,8 +1,8 @@ #!/usr/bin/python """very basic test cases that load the classes -:author: `Patrick Kanzler `_ and others -:organization: Bashlinux and `python-escpos `_ +:author: `Patrick Kanzler `_ +:organization: `python-escpos `_ :copyright: Copyright (c) 2016 `python-escpos `_ :license: GNU GPL v3 """ @@ -12,20 +12,22 @@ from nose.tools import with_setup import escpos.printer as printer import os +devfile = 'testfile' + def setup_testfile(): """create a testfile as devfile""" - fhandle = open('testfile', 'a') + fhandle = open(devfile, 'a') try: - os.utime('testfile', None) + os.utime(devfile, None) finally: fhandle.close() def teardown_testfile(): """destroy testfile again""" - os.remove('testfile') + os.remove(devfile) @with_setup(setup_testfile, teardown_testfile) def test_instantiation(): """test the instantiation of a escpos-printer class and basic printing""" - instance = printer.File(devfile='testfile') + instance = printer.File(devfile=devfile) instance.text('This is a test\n')