From 91880ffc19da435c26d62dcde92b451d774f8cc3 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 14 May 2010 12:02:43 +0200 Subject: [PATCH] adding three x-failing tests for issue88, issue93 and related issues --HG-- branch : trunk --- ISSUES.txt | 9 ++++++++ testing/acceptance_test.py | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/ISSUES.txt b/ISSUES.txt index b2b5562ce..7af899123 100644 --- a/ISSUES.txt +++ b/ISSUES.txt @@ -167,3 +167,12 @@ objects containing global state. Often using them is not neccessary. This is about trying to get rid of them, i.e. deprecating them and checking with PyPy's usages as well as others. + +remove deprecated bits in collect.py +------------------------------------------------------------------- +tags: feature 1.4 + +In an effort to further simplify code, review and remove deprecated bits +in collect.py. Probably good: +- inline consider_file/dir methods, no need to have them + subclass-overridable because of hooks diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index f3222aa4f..ddde21d37 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -105,3 +105,45 @@ class TestGeneralUsage: "*1 passed*", "*1 passed*", ]) + + + @py.test.mark.xfail + def test_early_skip(self, testdir): + testdir.mkdir("xyz") + testdir.makeconftest(""" + import py + def pytest_collect_directory(): + py.test.skip("early") + """) + result = testdir.runpytest() + assert result.ret == 0 + result.stdout.fnmatch_lines([ + "*1 skip*" + ]) + + + @py.test.mark.xfail + def test_issue88_initial_file_multinodes(self, testdir): + testdir.makeconftest(""" + import py + class MyFile(py.test.collect.File): + def collect(self): + return + def pytest_collect_file(path, parent): + return MyFile(path, parent) + """) + p = testdir.makepyfile("def test_hello(): pass") + result = testdir.runpytest(p, "--collectonly") + result.stdout.fnmatch_lines([ + "*MyFile*test_issue88*", + "*Module*test_issue88*", + ]) + + @py.test.mark.xfail + def test_issue93_initialnode_importing_capturing(self, testdir): + testdir.makeconftest(""" + print "should not be seen" + """) + result = testdir.runpytest() + assert result.ret == 0 + assert "should not be seen" not in result.stdout.str()