mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 00:41:00 +01:00
commit
6052a36531
3 changed files with 34 additions and 1 deletions
13
news/win_test_fixes.rst
Normal file
13
news/win_test_fixes.rst
Normal file
|
@ -0,0 +1,13 @@
|
|||
**Added:** None
|
||||
|
||||
**Changed:** None
|
||||
|
||||
**Deprecated:** None
|
||||
|
||||
**Removed:** None
|
||||
|
||||
**Fixed:**
|
||||
|
||||
* Fix some test problems when win_unicode_console was installed on windows.
|
||||
|
||||
**Security:** None
|
|
@ -9,7 +9,7 @@ from xonsh.built_ins import ensure_list_of_strs
|
|||
from xonsh.execer import Execer
|
||||
from xonsh.tools import XonshBlockError
|
||||
from xonsh.events import events
|
||||
|
||||
from xonsh.platform import ON_WINDOWS
|
||||
from tools import DummyShell, sp
|
||||
|
||||
|
||||
|
@ -65,3 +65,16 @@ def xonsh_builtins():
|
|||
del builtins.compilex
|
||||
del builtins.aliases
|
||||
del builtins.events
|
||||
|
||||
|
||||
if ON_WINDOWS:
|
||||
try:
|
||||
import win_unicode_console
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
@pytest.fixture(autouse=True)
|
||||
def disable_win_unicode_console(monkeypatch):
|
||||
""" Disable win_unicode_console if it is present since it collides with
|
||||
pytests ouptput capture"""
|
||||
monkeypatch.setattr(win_unicode_console, 'enable', lambda: None)
|
||||
|
|
|
@ -23,6 +23,13 @@ from xonsh.dirstack import _unc_tempDrives
|
|||
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||
PARENT = os.path.dirname(HERE)
|
||||
|
||||
def drive_in_use(letter):
|
||||
return ON_WINDOWS and os.system('vol {}: 2>nul>nul'.format(letter)) == 0
|
||||
|
||||
pytestmark = pytest.mark.skipif(any(drive_in_use(l) for l in 'ywzx'),
|
||||
reason='Drive letters used by tests are '
|
||||
'are already used by Windows.')
|
||||
|
||||
|
||||
@pytest.yield_fixture(scope="module")
|
||||
def shares_setup(tmpdir_factory):
|
||||
|
|
Loading…
Add table
Reference in a new issue