mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
fix tests for <v3.7
This commit is contained in:
parent
5afba70f1e
commit
f0160e54d8
1 changed files with 12 additions and 7 deletions
|
@ -368,20 +368,25 @@ print(check_output(["echo", "hello"]).decode("utf8"))
|
|||
#
|
||||
(
|
||||
"""
|
||||
with open("sourced-file.xsh", "w") as f:
|
||||
f.write('''
|
||||
import sys
|
||||
|
||||
if sys.version_tuple[:2] >= (3, 7):
|
||||
with open("sourced-file.xsh", "w") as f:
|
||||
f.write('''
|
||||
from contextvars import ContextVar
|
||||
|
||||
var = ContextVar('var', default='spam')
|
||||
var.set('foo')
|
||||
''')
|
||||
''')
|
||||
|
||||
source sourced-file.xsh
|
||||
source sourced-file.xsh
|
||||
|
||||
print("Var " + var.get())
|
||||
print("Var " + var.get())
|
||||
|
||||
import os
|
||||
os.remove('sourced-file.xsh')
|
||||
import os
|
||||
os.remove('sourced-file.xsh')
|
||||
else:
|
||||
print("Var foo")
|
||||
""",
|
||||
"Var foo\n",
|
||||
0,
|
||||
|
|
Loading…
Add table
Reference in a new issue