Skip to content

Cleanups in tests and in framework #3696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions test/SConscript/SConscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
test.write('SConstruct', """\
import os
import foo
from collections import UserList

assert foo.foo == 4

Expand Down Expand Up @@ -71,10 +72,6 @@

SConscript('SConscript5')

try:
from collections import UserList
except ImportError:
from UserList import UserList
x7 = "SConstruct x7"
x8 = "SConstruct x8"
x9 = SConscript('SConscript6', UserList(["x7", "x8"]))
Expand Down
13 changes: 2 additions & 11 deletions test/option/option_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,9 @@

__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"

import sys

# TODO: Fixup StringIO usage when Py2.7 is dropped.
# cheat a little bit: io.StringIO is "preferred" in Py2.7
# since it forces you to be explicit about strings (it is unicode-only)
# It's easier to use the unaware version. Which also doesn't come
# with a context manager, so use contextlib.closing
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import contextlib
import sys
from io import StringIO

import TestSCons

Expand Down
14 changes: 2 additions & 12 deletions test/redirection.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,20 @@

test.write('cat.py', r"""
import sys
PY3K = sys.version_info >= (3, 0)

# write binary to stdout
if sys.platform == "win32":
import os, msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)


try:
with open(sys.argv[1], 'rb') as f:
indata = f.read()
except IndexError:
if PY3K:
source = sys.stdin.buffer
else:
source = sys.stdin
indata = source.read()
indata = sys.stdin.buffer.read()

if PY3K:
sys.stdout.buffer.write(indata)
else:
sys.stdout.write(indata)

sys.stdout.buffer.write(indata)
sys.exit(0)
""")

Expand Down
Loading