Skip to content

Commit 4848a5a

Browse files
committed
test_cache_writefail_permissions: ignore any other plugins
1 parent 8c2e871 commit 4848a5a

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

testing/test_cacheprovider.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def test_cache_writefail_permissions(self, testdir):
5959
@pytest.mark.filterwarnings(
6060
"ignore:could not create cache path:pytest.PytestWarning"
6161
)
62-
def test_cache_failure_warns(self, testdir):
62+
def test_cache_failure_warns(self, testdir, monkeypatch):
63+
monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
6364
cache_dir = str(testdir.tmpdir.ensure_dir(".pytest_cache"))
6465
mode = os.stat(cache_dir)[stat.ST_MODE]
6566
testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0)
@@ -277,8 +278,10 @@ def test_3(): assert 0
277278
result.stdout.fnmatch_lines(["*1 failed*2 passed*"])
278279

279280
def test_failedfirst_order(self, testdir):
280-
testdir.makepyfile(**{"test_a.py": "def test_always_passes(): pass"})
281-
testdir.makepyfile(**{"test_b.py": "def test_always_fails(): assert 0"})
281+
testdir.makepyfile(
282+
test_a="def test_always_passes(): pass",
283+
test_b="def test_always_fails(): assert 0",
284+
)
282285
result = testdir.runpytest()
283286
# Test order will be collection order; alphabetical
284287
result.stdout.fnmatch_lines(["test_a.py*", "test_b.py*"])
@@ -288,10 +291,8 @@ def test_failedfirst_order(self, testdir):
288291

289292
def test_lastfailed_failedfirst_order(self, testdir):
290293
testdir.makepyfile(
291-
**{
292-
"test_a.py": "def test_always_passes(): assert 1",
293-
"test_b.py": "def test_always_fails(): assert 0",
294-
}
294+
test_a="def test_always_passes(): assert 1",
295+
test_b="def test_always_fails(): assert 0",
295296
)
296297
result = testdir.runpytest()
297298
# Test order will be collection order; alphabetical
@@ -304,13 +305,11 @@ def test_lastfailed_failedfirst_order(self, testdir):
304305
def test_lastfailed_difference_invocations(self, testdir, monkeypatch):
305306
monkeypatch.setattr("sys.dont_write_bytecode", True)
306307
testdir.makepyfile(
307-
**{
308-
"test_a": """
308+
test_a="""
309309
def test_a1(): assert 0
310310
def test_a2(): assert 1
311311
""",
312-
"test_b": "def test_b1(): assert 0",
313-
}
312+
test_b="def test_b1(): assert 0",
314313
)
315314
p = testdir.tmpdir.join("test_a.py")
316315
p2 = testdir.tmpdir.join("test_b.py")
@@ -329,7 +328,7 @@ def test_a2(): assert 1
329328
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
330329
monkeypatch.setattr("sys.dont_write_bytecode", True)
331330
testdir.makepyfile(
332-
"def test_1(): assert 0", **{"test_something.py": "def test_2(): assert 0"}
331+
"def test_1(): assert 0", test_something="def test_2(): assert 0"
333332
)
334333
p2 = testdir.tmpdir.join("test_something.py")
335334
result = testdir.runpytest()

0 commit comments

Comments
 (0)