From 0571fb054fe770b7deefc7ccb8880533cc8e1e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cardona?= Date: Wed, 24 Jun 2015 15:29:21 +0200 Subject: [test] Rework generate_manpage test to use a private __pkginfo__ Stop using lgc's own __pkginfo__ (which we may stop shipping/installing at some point). --- test/data/__pkginfo__.py | 57 ++++++++++++++++++++++++++++++++++++++++++ test/unittest_configuration.py | 7 ++++-- 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 test/data/__pkginfo__.py diff --git a/test/data/__pkginfo__.py b/test/data/__pkginfo__.py new file mode 100644 index 0000000..7ebce74 --- /dev/null +++ b/test/data/__pkginfo__.py @@ -0,0 +1,57 @@ +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr +# +# This file is part of logilab-common. +# +# logilab-common is free software: you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 2.1 of the License, or (at your option) any +# later version. +# +# logilab-common is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with logilab-common. If not, see . +"""logilab.common packaging information""" +__docformat__ = "restructuredtext en" +import sys +import os + +distname = 'logilab-common' +modname = 'common' +subpackage_of = 'logilab' +subpackage_master = True + +numversion = (0, 63, 2) +version = '.'.join([str(num) for num in numversion]) + +license = 'LGPL' # 2.1 or later +description = "collection of low-level Python packages and modules used by Logilab projects" +web = "http://www.logilab.org/project/%s" % distname +mailinglist = "mailto://python-projects@lists.logilab.org" +author = "Logilab" +author_email = "contact@logilab.fr" + + +from os.path import join +scripts = [join('bin', 'pytest')] +include_dirs = [join('test', 'data')] + +install_requires = [ + 'six >= 1.4.0', + ] +tests_require = ['pytz'] + +if sys.version_info < (2, 7): + install_requires.append('unittest2 >= 0.5.1') +if os.name == 'nt': + install_requires.append('colorama') + +classifiers = ["Topic :: Utilities", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 3", + ] diff --git a/test/unittest_configuration.py b/test/unittest_configuration.py index f8aceef..378b536 100644 --- a/test/unittest_configuration.py +++ b/test/unittest_configuration.py @@ -22,6 +22,7 @@ import re from sys import version_info +from logilab.common import attrdict from logilab.common.compat import StringIO from logilab.common.testlib import TestCase, unittest_main from logilab.common.optik_ext import OptionValueError @@ -320,8 +321,10 @@ options: def test_manpage(self): - from logilab.common import __pkginfo__ - self.cfg.generate_manpage(__pkginfo__, stream=StringIO()) + pkginfo = {} + with open(join(DATA, '__pkginfo__.py')) as fobj: + exec(fobj.read(), pkginfo) + self.cfg.generate_manpage(attrdict(pkginfo), stream=StringIO()) def test_rewrite_config(self): changes = [('renamed', 'renamed', 'choice'), -- cgit v1.2.1