def testInvalidVersionNumber(self, capsys, monkeypatch, prefix, suffix): def mockreturn(abbrev): return '%s0.0.0%s' % (prefix, suffix) import yaclifw.version monkeypatch.setattr(yaclifw.version, 'call_git_describe', mockreturn) with pytest.raises(ValueError): get_git_version(module_file)
def testVersionNumber(self, capsys, monkeypatch, prefix, suffix): def mockreturn(abbrev): return '%s0.0.0%s' % (prefix, suffix) import yaclifw.version monkeypatch.setattr(yaclifw.version, 'call_git_describe', mockreturn) version = get_git_version(module_file) assert version == '0.0.0%s' % suffix
self.test_args.extend(['--junitxml', self.junitxml]) if self.pdb: self.test_args.extend(['--pdb']) self.test_suite = True def run_tests(self): # import here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.test_args) sys.exit(errno) try: from yaclifw.version import get_git_version from scc import __file__ as module_file VERSION = get_git_version(module_file) except ImportError: VERSION = "UNKNOWN" ZIP_SAFE = False LONG_DESCRIPTION = open("README.rst", "r").read() CLASSIFIERS = [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2" " (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Version Control" ]
def testVersionOutput(self, capsys): main("test", ["version"], items=[("version", Version)]) out, err = capsys.readouterr() assert out.rstrip() == get_git_version(module_file)
self.test_args.extend(['-v']) if self.test_quiet: self.test_args.extend(['-q']) if self.junitxml is not None: self.test_args.extend(['--junitxml', self.junitxml]) if self.pdb: self.test_args.extend(['--pdb']) self.test_suite = True def run_tests(self): # import here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.test_args) sys.exit(errno) VERSION = get_git_version(module_file) ZIP_SAFE = False LONG_DESCRIPTION = open("README.rst", "r").read() CLASSIFIERS = ["Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2" " (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Version Control"] setup(name='yaclifw',