mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Fixed a flaw in the test setup. Tests pass now.
This commit is contained in:
parent
ef51910d2e
commit
aac8db471a
1 changed files with 7 additions and 3 deletions
|
@ -10,13 +10,19 @@ def test_load_xontrib_metadata():
|
|||
@pytest.yield_fixture
|
||||
def tmpmod(tmpdir):
|
||||
"""
|
||||
Same as tmpdir but also adds/removes it to the front of sys.path
|
||||
Same as tmpdir but also adds/removes it to the front of sys.path.
|
||||
|
||||
Also cleans out any modules loaded as part of the test.
|
||||
"""
|
||||
sys.path.insert(0, str(tmpdir))
|
||||
loadedmods = set(sys.modules.keys())
|
||||
try:
|
||||
yield tmpdir
|
||||
finally:
|
||||
del sys.path[0]
|
||||
newmods = set(sys.modules.keys()) - loadedmods
|
||||
for m in newmods:
|
||||
del sys.modules[m]
|
||||
|
||||
def test_noall(tmpmod):
|
||||
"""
|
||||
|
@ -46,7 +52,5 @@ eggs = 2
|
|||
_foobar = 3
|
||||
""")
|
||||
|
||||
print(xontrib_context)
|
||||
|
||||
ctx = xontrib_context('spameggs')
|
||||
assert ctx == {'spam': 1, '_foobar': 3}
|
Loading…
Add table
Reference in a new issue