Enabling hy2py test on Windows

This commit is contained in:
Bob Tolbert 2014-03-14 09:30:03 -04:00
parent 66dadf2d1a
commit bb567aab3e
3 changed files with 6 additions and 10 deletions

View File

@ -41,7 +41,7 @@ tox: venv
tox
flake:
flake8 hy
flake8 hy tests
clear:
clear

View File

@ -70,8 +70,8 @@ goto :EOF
if "%1" == "flake" (
:flake
echo.flake8 hy
flake8 hy
echo.flake8 hy tests
flake8 hy tests
goto :EOF
)

View File

@ -2,6 +2,7 @@
# -*- encoding: utf-8 -*-
# Copyright (c) 2013 Julien Danjou <julien@danjou.info>
# Copyright (c) 2013 Will Kahn-Greene <willg@bluesock.org>
# Copyright (c) 2014 Bob Tolbert <bob@tolbert.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@ -23,8 +24,6 @@
import os
import subprocess
from nose.plugins.skip import SkipTest
def run_cmd(cmd, stdin_data=None):
p = subprocess.Popen(cmd,
@ -125,16 +124,13 @@ def test_bin_hyc_missing_file():
def test_hy2py():
# and running this script this way doesn't work on Windows
if os.name == "nt":
raise SkipTest("doesn't work on Windows")
i = 0
for dirpath, dirnames, filenames in os.walk("tests/native_tests"):
for f in filenames:
if f.endswith(".hy"):
i += 1
ret = run_cmd("bin/hy2py -s -a " + os.path.join(dirpath, f))
ret = run_cmd("python bin/hy2py -s -a "
+ os.path.join(dirpath, f))
assert ret[0] == 0, f
assert len(ret[1]) > 1, f
assert len(ret[2]) == 0, f