reindent a few of the blockquotes in these tests
This commit is contained in:
parent
b1595d3f61
commit
17e1106584
|
@ -320,8 +320,8 @@ class TestRewriteOnImport:
|
||||||
def test_pycache_is_a_file(self, testdir):
|
def test_pycache_is_a_file(self, testdir):
|
||||||
testdir.tmpdir.join("__pycache__").write("Hello")
|
testdir.tmpdir.join("__pycache__").write("Hello")
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
def test_rewritten():
|
def test_rewritten():
|
||||||
assert "@py_builtins" in globals()""")
|
assert "@py_builtins" in globals()""")
|
||||||
assert testdir.runpytest().ret == 0
|
assert testdir.runpytest().ret == 0
|
||||||
|
|
||||||
def test_pycache_is_readonly(self, testdir):
|
def test_pycache_is_readonly(self, testdir):
|
||||||
|
@ -329,8 +329,8 @@ def test_rewritten():
|
||||||
old_mode = cache.stat().mode
|
old_mode = cache.stat().mode
|
||||||
cache.chmod(old_mode ^ stat.S_IWRITE)
|
cache.chmod(old_mode ^ stat.S_IWRITE)
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
def test_rewritten():
|
def test_rewritten():
|
||||||
assert "@py_builtins" in globals()""")
|
assert "@py_builtins" in globals()""")
|
||||||
try:
|
try:
|
||||||
assert testdir.runpytest().ret == 0
|
assert testdir.runpytest().ret == 0
|
||||||
finally:
|
finally:
|
||||||
|
@ -347,9 +347,9 @@ def test_rewritten():
|
||||||
f.close()
|
f.close()
|
||||||
z.chmod(256)
|
z.chmod(256)
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
import sys
|
import sys
|
||||||
sys.path.append(%r)
|
sys.path.append(%r)
|
||||||
import test_gum.test_lizard""" % (z_fn,))
|
import test_gum.test_lizard""" % (z_fn,))
|
||||||
assert testdir.runpytest().ret == 0
|
assert testdir.runpytest().ret == 0
|
||||||
|
|
||||||
def test_readonly(self, testdir):
|
def test_readonly(self, testdir):
|
||||||
|
@ -358,7 +358,7 @@ import test_gum.test_lizard""" % (z_fn,))
|
||||||
py.builtin._totext("""
|
py.builtin._totext("""
|
||||||
def test_rewritten():
|
def test_rewritten():
|
||||||
assert "@py_builtins" in globals()
|
assert "@py_builtins" in globals()
|
||||||
""").encode("utf-8"), "wb")
|
""").encode("utf-8"), "wb")
|
||||||
old_mode = sub.stat().mode
|
old_mode = sub.stat().mode
|
||||||
sub.chmod(320)
|
sub.chmod(320)
|
||||||
try:
|
try:
|
||||||
|
@ -368,11 +368,11 @@ def test_rewritten():
|
||||||
|
|
||||||
def test_dont_write_bytecode(self, testdir, monkeypatch):
|
def test_dont_write_bytecode(self, testdir, monkeypatch):
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
import os
|
import os
|
||||||
def test_no_bytecode():
|
def test_no_bytecode():
|
||||||
assert "__pycache__" in __cached__
|
assert "__pycache__" in __cached__
|
||||||
assert not os.path.exists(__cached__)
|
assert not os.path.exists(__cached__)
|
||||||
assert not os.path.exists(os.path.dirname(__cached__))""")
|
assert not os.path.exists(os.path.dirname(__cached__))""")
|
||||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", "1")
|
||||||
assert testdir.runpytest().ret == 0
|
assert testdir.runpytest().ret == 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue