Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
150d4c45
Commit
150d4c45
authored
Apr 21, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The pystache-tests script now accepts a spec test directory argument.
parent
ae755339
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
pystache/tests/main.py
+9
-2
pystache/tests/test_mustachespec.py
+7
-3
tox.ini
+3
-1
No files found.
pystache/tests/main.py
View file @
150d4c45
...
...
@@ -32,10 +32,17 @@ def run_tests(sys_argv):
try
:
# TODO: use optparse command options instead.
project_dir
=
sys_argv
[
1
]
sys_argv
.
pop
()
sys_argv
.
pop
(
1
)
except
IndexError
:
project_dir
=
PROJECT_DIR
try
:
# TODO: use optparse command options instead.
spec_test_dir
=
sys_argv
[
1
]
sys_argv
.
pop
(
1
)
except
IndexError
:
spec_test_dir
=
SPEC_TEST_DIR
if
len
(
sys_argv
)
<=
1
or
sys_argv
[
-
1
]
.
startswith
(
"-"
):
# Then no explicit module or test names were provided, so
# auto-detect all unit tests.
...
...
@@ -43,7 +50,7 @@ def run_tests(sys_argv):
sys_argv
.
extend
(
module_names
)
_PystacheTestProgram
.
_text_doctest_dir
=
project_dir
_PystacheTestProgram
.
_spec_test_dir
=
SPEC_TEST_DIR
_PystacheTestProgram
.
_spec_test_dir
=
spec_test_dir
# We pass None for the module because we do not want the unittest
# module to resolve module names relative to a given module.
...
...
pystache/tests/test_mustachespec.py
View file @
150d4c45
...
...
@@ -77,14 +77,18 @@ def get_spec_tests(spec_test_dir):
case
=
_deserialize_spec_test
(
data
,
path
)
cases
.
append
(
case
)
# Store this as a value so that CheckSpecTestsFound is not checking
# a reference to cases that contains itself.
spec_test_count
=
len
(
cases
)
# This test case lets us alert the user that spec tests are missing.
class
CheckSpecTestsFound
(
unittest
.
TestCase
):
def
runTest
(
self
):
if
len
(
cases
)
>
0
:
if
spec_test_count
>
0
:
return
raise
Exception
(
"Spec tests not found
in:
%
s
\n
"
"Consult the README file on how to add the Mustache spec tests."
%
repr
(
spec_test_dir
))
raise
Exception
(
"Spec tests not found
--
\n
in
%
s
\n
"
"
Consult the README file on how to add the Mustache spec tests."
%
repr
(
spec_test_dir
))
case
=
CheckSpecTestsFound
()
cases
.
append
(
case
)
...
...
tox.ini
View file @
150d4c45
...
...
@@ -6,7 +6,9 @@
envlist
=
py24,py25,py26,py27,py31,py32
[testenv]
# Change the working directory so that we don't import the pystache located
# in the original location.
changedir
=
{envbindir}
commands
=
pystache-test
{toxinidir}
pystache-test
{toxinidir}
{toxinidir}/ext/spec/specs
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment