# HG changeset patch -- Bitbucket.org
# Project pytest
# URL http://bitbucket.org/hpk42/pytest/overview
# User holger krekel <hol...@merlinux.eu>
# Date 1289088615 -3600
# Node ID 0ce9db200a51ce2de73ba3b2a009c08b975a058d
# Parent  8dad8f0e7649d22b6ffae74c9a806324460c871b
some python3 related fixes

--- a/testing/acceptance_test.py
+++ b/testing/acceptance_test.py
@@ -325,6 +325,11 @@ class TestInvocationVariants:
         result.stdout.fnmatch_lines([
             "*1 passed*"
         ])
+        result = testdir.runpytest("--pyargs", ".")
+        assert result.ret == 0
+        result.stdout.fnmatch_lines([
+            "*2 passed*"
+        ])
 
     def test_cmdline_python_package_not_exists(self, testdir):
         result = testdir.runpytest("--pyargs", "tpkgwhatv")
@@ -342,7 +347,7 @@ class TestInvocationVariants:
                 def test_hello(self):
                     assert self.attr
 
-            class RealTest(TestHello, unittest.TestCase):
+            class RealTest(unittest.TestCase, TestHello):
                 attr = 42
         """)
         reprec = testdir.inline_run(testpath)

--- a/testing/test_config.py
+++ b/testing/test_config.py
@@ -40,6 +40,17 @@ class TestParseIni:
             "*tox.ini:2*requires*9.0*actual*"
         ])
 
+    @py.test.mark.xfail(reason="probably not needed")
+    def test_confcutdir(self, testdir):
+        sub = testdir.mkdir("sub")
+        sub.chdir()
+        testdir.makeini("""
+            [pytest]
+            addopts = --qwe
+        """)
+        result = testdir.runpytest("--confcutdir=.")
+        assert result.ret == 0
+    
 class TestConfigCmdlineParsing:
     def test_parsing_again_fails(self, testdir):
         config = testdir.reparseconfig([testdir.tmpdir])

--- a/pytest/plugin/session.py
+++ b/pytest/plugin/session.py
@@ -437,7 +437,7 @@ class Collection(FSCollector):
     def _tryconvertpyarg(self, x):
         try:
             mod = __import__(x, None, None, ['__doc__'])
-        except ImportError:
+        except (ValueError, ImportError):
             return x
         p = py.path.local(mod.__file__)
         if p.purebasename == "__init__":

--- a/pytest/plugin/unittest.py
+++ b/pytest/plugin/unittest.py
@@ -33,6 +33,10 @@ class UnitTestCase(py.test.collect.Class
             meth()
 
 class TestCaseFunction(py.test.collect.Function):
+    def setup(self):
+        pass
+    def teardown(self):
+        pass
     def startTest(self, testcase):
         pass
     def addError(self, testcase, rawexcinfo):

--- a/pytest/main.py
+++ b/pytest/main.py
@@ -68,8 +68,11 @@ class PluginManager(object):
         self.trace = TagTracer().get("pluginmanage")
         if os.environ.get('PYTEST_DEBUG'):
             err = sys.stderr
-            if hasattr(os, 'dup'):
-                err = py.io.dupfile(err)
+            encoding = getattr(err, 'encoding', 'utf8')
+            try:
+                err = py.io.dupfile(err, encoding=encoding)
+            except Exception:
+                pass
             self.trace.root.setwriter(err.write)
         self.hook = HookRelay([hookspec], pm=self)
         self.register(self)

--- a/testing/test_collection.py
+++ b/testing/test_collection.py
@@ -496,8 +496,6 @@ class Test_getinitialnodes:
         config = testdir.reparseconfig([x])
         col = testdir.getnode(config, x)
         assert isinstance(col, py.test.collect.Module)
-        print col.obj
-        print col.listchain()
         assert col.name == 'subdir/x.py'
         assert col.parent.parent is None
         for col in col.listchain():
_______________________________________________
py-svn mailing list
py-svn@codespeak.net
http://codespeak.net/mailman/listinfo/py-svn

Reply via email to