summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Crosta <dcrosta@late.am>2012-01-31 10:37:22 -0500
committerDan Crosta <dcrosta@late.am>2012-01-31 10:37:22 -0500
commit330e2a74077be803f6301331c489ab181beae1da (patch)
treeb24fa84c6e568d35b4216a3c02bd1b320d20a009
parent6f9da3de694eee253aaa5dc9ed4ffbb7a9a0c4f8 (diff)
downloadmongo-330e2a74077be803f6301331c489ab181beae1da.tar.gz
roll back previous py-2.4 compatibility changes
-rwxr-xr-xbuildscripts/smoke.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/buildscripts/smoke.py b/buildscripts/smoke.py
index 97e3c16193d..c46b5d1879d 100755
--- a/buildscripts/smoke.py
+++ b/buildscripts/smoke.py
@@ -290,8 +290,8 @@ def runTest(test):
'TestData.testPath = "' + path + '";' +
'TestData.testFile = "' + os.path.basename( path ) + '";' +
'TestData.testName = "' + re.sub( ".js$", "", os.path.basename( path ) ) + '";' +
- 'TestData.noJournal = ' + ( no_journal and 'true' or 'false' ) + ";" +
- 'TestData.noJournalPrealloc = ' + ( no_preallocj and 'true' or 'false' ) + ";" ]
+ 'TestData.noJournal = ' + ( 'true' if no_journal else 'false' ) + ";" +
+ 'TestData.noJournalPrealloc = ' + ( 'true' if no_preallocj else 'false' ) + ";" ]
if argv[0].endswith( 'test' ) and no_preallocj :
argv = argv + [ '--nopreallocj' ]
@@ -320,7 +320,7 @@ def run_tests(tests):
# The reason we use with is so that we get __exit__ semantics
with mongod(small_oplog=small_oplog,no_journal=no_journal,no_preallocj=no_preallocj) as master:
- with small_oplog and mongod(slave=True) or Nothing() as slave:
+ with mongod(slave=True) if small_oplog else Nothing() as slave:
if small_oplog:
master.wait_for_repl()
@@ -346,7 +346,7 @@ def run_tests(tests):
def report():
- print "%d test%s succeeded" % (len(winners), len(winners) != 1 and 's' or '')
+ print "%d test%s succeeded" % (len(winners), '' if len(winners) == 1 else 's')
num_missed = len(tests) - (len(winners) + len(losers.keys()))
if num_missed:
print "%d tests didn't get run" % num_missed
@@ -426,7 +426,7 @@ def expand_suites(suites):
raise Exception('unknown test suite %s' % suite)
if globstr:
- globstr = os.path.join(mongo_repo, (os.path.join((globstr.endswith('.js') and 'jstests/' or ''), globstr)))
+ globstr = os.path.join(mongo_repo, (os.path.join(('jstests/' if globstr.endswith('.js') else ''), globstr)))
paths = glob.glob(globstr)
paths.sort()
tests += [(path, usedb) for path in paths]