From 5ce83fc4de896705652525d6abfd5effea4be9f6 Mon Sep 17 00:00:00 2001 From: iElectric Date: Mon, 3 May 2010 10:52:26 +0200 Subject: [PATCH] skip runpy tests on python2.4 --- tests/versioning/test_shell.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/versioning/test_shell.py b/tests/versioning/test_shell.py index 985e6b0..9a38f92 100644 --- a/tests/versioning/test_shell.py +++ b/tests/versioning/test_shell.py @@ -2,10 +2,15 @@ # -*- coding: utf-8 -*- import os +import sys import tempfile -from runpy import run_module +try: + from runpy import run_module +except ImportError: + pass #python2.4 from sqlalchemy import MetaData, Table +from nose.plugins.skip import SkipTest from migrate.versioning.repository import Repository from migrate.versioning import genmodel, shell, api @@ -44,13 +49,18 @@ class TestShellCommands(Shell): # TODO: assert logging messages to 0 shell.main(['version', repos], logging=False) - def test_main(self): - """Test main() function""" - # TODO: test output? + def test_main_with_runpy(self): + if sys.version_info[:2] == (2, 4): + raise SkipTest("runpy is not part of python2.4") + asd try: run_module('migrate.versioning.shell', run_name='__main__') except: pass + + def test_main(self): + """Test main() function""" + # TODO: test output? repos = self.tmp_repos() shell.main(['help']) shell.main(['help', 'create'])