Skip to content

Commit

Permalink
Merge branch 'master' into new-flash
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Jul 9, 2018
2 parents 58ea411 + 920b454 commit 246994d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
24 changes: 18 additions & 6 deletions make.py
Expand Up @@ -166,10 +166,17 @@ def check():
"""Run all the checkers and tests
"""
print("\nCheck")
clean()
pyflakes()
pycodestyle()
coverage()
funcs = [
clean,
pyflakes,
pycodestyle,
coverage
]
for func in funcs:
return_code = func()
if return_code != 0:
return return_code
return 0


@export
Expand All @@ -185,6 +192,7 @@ def clean():
_rmtree("lib")
_rmtree("pynsist_pkgs")
_rmfiles(".", "*.pyc")
return 0


@export
Expand Down Expand Up @@ -226,7 +234,7 @@ def run():
if not os.environ.get("VIRTUAL_ENV"):
raise RuntimeError("Cannot run Mu;"
"your Python virtualenv is not activated")
subprocess.run(["python", "-m", "mu"]).returncode
return subprocess.run(["python", "-m", "mu"]).returncode


@export
Expand All @@ -235,7 +243,9 @@ def dist():
"""
check()
print("Checks pass; good to package")
subprocess.run(["python", "setup.py", "sdist", "bdist_wheel"]).returncode
return subprocess.run(
["python", "setup.py", "sdist", "bdist_wheel"]
).returncode


@export
Expand Down Expand Up @@ -285,6 +295,8 @@ def docs():
os.chdir("docs")
try:
return subprocess.run(["cmd", "/c", "make.bat", "html"]).returncode
except Exception:
return 1
finally:
os.chdir(cwd)

Expand Down
2 changes: 1 addition & 1 deletion mu/debugger/client.py
Expand Up @@ -232,7 +232,7 @@ def breakpoint(self, breakpoint):
try:
if isinstance(breakpoint, tuple):
filename, line = breakpoint
filename = os.path.abspath(os.path.abspath(filename))
filename = os.path.normcase(os.path.abspath(filename))
return self.bp_index[filename][line]
else:
return self.bp_list[breakpoint]
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/test_panes.py
Expand Up @@ -631,7 +631,7 @@ def test_LocalFileList_contextMenuEvent():
with mock.patch('mu.interface.panes.QMenu', return_value=mock_menu):
mfs.contextMenuEvent(mock_event)
assert mfs.set_message.emit.call_count == 0
mock_open.assert_called_once_with('homepath/foo.py')
mock_open.assert_called_once_with(os.path.join('homepath', 'foo.py'))


def test_LocalFileList_contextMenuEvent_external():
Expand Down
4 changes: 4 additions & 0 deletions tests/test_init.py
Expand Up @@ -3,6 +3,7 @@
Tests for the module __init__ file.
"""
import os
import sys
import importlib
from unittest import mock

Expand All @@ -14,6 +15,9 @@ def test_gettext_translation():
Test the right translation is set based on the LC_ALL environmental
variable.
"""
if sys.platform == 'win32':
# Unix only test.
return
old_lc_all = os.environ.get('LC_ALL', None)
os.environ['LC_ALL'] = 'es_ES.UTF-8'

Expand Down

0 comments on commit 246994d

Please sign in to comment.