#27 Add tox to run tests
Merged 6 years ago by cqi. Opened 6 years ago by cqi.
cqi/libpagure tox  into  master

file added
+3
@@ -0,0 +1,3 @@ 

+ include LICENSE.txt README.md

+ include requirements.txt test-requirements.txt

+ include tox.ini

file modified
+1 -1
@@ -1,3 +1,3 @@ 

  # -*- coding: utf-8 -*-

  

- from .libpagure import *

+ from .libpagure import *  # noqa

file modified
+5 -2
@@ -11,6 +11,7 @@ 

      def emit(self, record):

          pass

  

+ 

  LOG = logging.getLogger("libpagure")

  

  # Add the null handler to top-level logger used by the library
@@ -338,12 +339,14 @@ 

          :param tags: filers the tags of the issues

          :param assignee: filters the assignee of the issues

          :param author: filters the author of the issues

-         :param milestones: filters the milestones of the issues (list of strings)

+         :param milestones: filters the milestones of the issues (list of

+             strings)

          :param priority: filters the priority of the issues

          :param no_stones: If True returns only the issues having no milestone,

              if False returns only the issues having a milestone

          :param since: Filters the issues updated after this date.

-             The date can either be provided as an unix date or in the format Y-M-D

+             The date can either be provided as an unix date or in the format

+             Y-M-D

          :return:

          """

          if self.username is None:

file added
+1
@@ -0,0 +1,1 @@ 

+ requests 

\ No newline at end of file

file modified
+12 -1
@@ -6,6 +6,16 @@ 

      from distutils.core import setup

  

  

+ def get_install_requires():

+     with open('requirements.txt', 'r') as f:

+         return [line.strip() for line in f]

+ 

+ 

+ def get_test_requires():

+     with open('test-requirements.txt', 'r') as f:

+         return [line.strip() for line in f if not line.startswith('-r ')]

+ 

+ 

  setup(

      name='libpagure',

      packages=['libpagure'],
@@ -30,5 +40,6 @@ 

  

      ],

      license='GNU General Public License v2.0',

-     install_requires=['requests'],

+     install_requires=get_install_requires(),

+     test_requires=get_test_requires(),

  )

@@ -0,0 +1,7 @@ 

+ -r requirements.txt

+ 

+ flake8

+ mock

+ pytest

+ pytest-cov

+ tox 

\ No newline at end of file

file added
+15
@@ -0,0 +1,15 @@ 

+ [tox]

+ envlist = py26,py27,py34,py35,py36,flake8

+ 

+ [testenv]

+ deps = -r{toxinidir}/test-requirements.txt

+ whitelist_externals =

+     flake8

+     pytest

+ commands =

+     # Remove comment when first test is added

+     # py.test --cov {envsitepackagesdir}/libpagure {posargs}

+ 

+ [testenv:flake8]

+ deps = flake8 >= 2.5.5

+ commands = flake8 libpagure/