@@ -1,8 +1,9 @@
|
||||
import sys
|
||||
|
||||
import _pytest
|
||||
import pytest
|
||||
import os
|
||||
import shutil
|
||||
import py
|
||||
|
||||
pytest_plugins = "pytester",
|
||||
|
||||
@@ -129,6 +130,7 @@ def test_cache_show(testdir):
|
||||
|
||||
|
||||
class TestLastFailed:
|
||||
|
||||
def test_lastfailed_usecase(self, testdir, monkeypatch):
|
||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", 1)
|
||||
p = testdir.makepyfile("""
|
||||
@@ -143,7 +145,7 @@ class TestLastFailed:
|
||||
result.stdout.fnmatch_lines([
|
||||
"*2 failed*",
|
||||
])
|
||||
p.write(py.code.Source("""
|
||||
p.write(_pytest._code.Source("""
|
||||
def test_1():
|
||||
assert 1
|
||||
|
||||
@@ -175,11 +177,11 @@ class TestLastFailed:
|
||||
])
|
||||
|
||||
def test_failedfirst_order(self, testdir):
|
||||
testdir.tmpdir.join('test_a.py').write(py.code.Source("""
|
||||
testdir.tmpdir.join('test_a.py').write(_pytest._code.Source("""
|
||||
def test_always_passes():
|
||||
assert 1
|
||||
"""))
|
||||
testdir.tmpdir.join('test_b.py').write(py.code.Source("""
|
||||
testdir.tmpdir.join('test_b.py').write(_pytest._code.Source("""
|
||||
def test_always_fails():
|
||||
assert 0
|
||||
"""))
|
||||
@@ -218,7 +220,7 @@ class TestLastFailed:
|
||||
result.stdout.fnmatch_lines([
|
||||
"*1 failed*",
|
||||
])
|
||||
p2.write(py.code.Source("""
|
||||
p2.write(_pytest._code.Source("""
|
||||
def test_b1():
|
||||
assert 1
|
||||
"""))
|
||||
@@ -238,7 +240,7 @@ class TestLastFailed:
|
||||
assert 0
|
||||
""")
|
||||
p2 = testdir.tmpdir.join("test_something.py")
|
||||
p2.write(py.code.Source("""
|
||||
p2.write(_pytest._code.Source("""
|
||||
def test_2():
|
||||
assert 0
|
||||
"""))
|
||||
|
||||
Reference in New Issue
Block a user