#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup

setup(
    name="myLwM2M",
    version="1.0.0",
    description="Lightweight M2M server written in Python",
    author="Alexander Ellwein",
    author_email="mylwm2m@ellwein.net",
    license="MIT License",
    install_requires=["aiocoap"],
    tests_require=["pytest"]
)
@@ -40,16 +40,27 @@
 -8 -*-%0A%0A
+import sys%0A
 from set
@@ -80,16 +80,601 @@
 t setup%0A
+from setuptools.command.test import test as TestCommand%0A%0A%0Aclass PyTest(TestCommand):%0A    user_options = %5B('pytest-args=', 'a', %22Arguments to pass to py.test%22)%5D%0A%0A    def initialize_options(self):%0A        TestCommand.initialize_options(self)%0A        self.pytest_args = %5B%5D%0A%0A    def finalize_options(self):%0A        TestCommand.finalize_options(self)%0A        self.test_args = %5B%5D%0A        self.test_suite = True%0A%0A    def run_tests(self):%0A        # import here, cause outside the eggs aren't loaded%0A        import pytest%0A%0A        errno = pytest.main(self.pytest_args)%0A        sys.exit(errno)%0A%0A
 %0Asetup(%0A
@@ -907,16 +907,16 @@
 coap%22%5D,%0A
-
     test
@@ -935,10 +935,41 @@
 pytest%22%5D
+,%0A    cmdclass=%7B'test': PyTest%7D
 %0A)

enable test command for setup.py/setuptools