Permalink
Browse files

Merge remote-tracking branch 'gabrielfalcao/master'

  • Loading branch information...
2 parents 74037a1 + 36ffa10 commit 4539b446e3b75f8420b7cf4bcab6552cd47adfc6 @akaihola akaihola committed Nov 16, 2012
Showing with 1,087 additions and 196 deletions.
  1. +0 −1 .travis.yml
  2. +15 −0 CONTRIBUTING.md
  3. +1 −17 README.md
  4. +14 −4 lettuce/__init__.py
  5. +8 −1 lettuce/bin.py
  6. +164 −32 lettuce/core.py
  7. +4 −1 lettuce/exceptions.py
  8. +16 −0 lettuce/languages.py
  9. +13 −3 lettuce/plugins/colored_shell_output.py
  10. +4 −2 lettuce/plugins/dots.py
  11. +4 −2 lettuce/plugins/scenario_names.py
  12. +10 −1 lettuce/plugins/shell_output.py
  13. +8 −5 lettuce/plugins/xunit_output.py
  14. +6 −2 lettuce/registry.py
  15. +2 −2 lettuce/strings.py
  16. +1 −0 lettuce/terrain.py
  17. +3 −5 requirements.txt
  18. +1 −1 setup.py
  19. +26 −4 tests/asserts.py
  20. +18 −0 tests/functional/bg_features/header/header.feature
  21. +14 −0 tests/functional/bg_features/naked/naked.feature
  22. +10 −0 tests/functional/bg_features/simple/simple.feature
  23. +26 −0 tests/functional/bg_features/simple/steps.py
  24. +8 −0 tests/functional/language_specific_features/fr/success/dumb.feature
  25. +7 −0 tests/functional/language_specific_features/fr/success/dumb_steps.py
  26. +19 −0 tests/functional/language_specific_features/fr/success/outlines.feature
  27. +19 −0 tests/functional/language_specific_features/fr/success/outlines2.feature
  28. +41 −0 tests/functional/language_specific_features/fr/success/outlines_steps.py
  29. +13 −0 tests/functional/language_specific_features/fr/success/table.feature
  30. +7 −0 tests/functional/language_specific_features/fr/success/table_steps.py
  31. +161 −0 tests/functional/language_specific_features/test_fr.py
  32. +1 −1 tests/functional/output_features/fail_outline/fail_outline.feature
  33. +1 −1 tests/functional/output_features/failed_table/failed_table.feature
  34. +1 −1 tests/functional/output_features/success_outline/success_outline.feature
  35. +1 −1 tests/functional/output_features/success_table/success_table.feature
  36. +311 −102 tests/functional/test_runner.py
  37. +4 −4 tests/unit/test_core.py
  38. +118 −1 tests/unit/test_feature_parser.py
  39. +1 −1 tests/unit/test_main.py
  40. +6 −1 tests/unit/test_terrain.py
View
@@ -1,6 +1,5 @@
language: python
python:
- - "2.5"
- "2.6"
- "2.7"
# command to install dependencies
View
@@ -0,0 +1,15 @@
+# Contributing
+
+1. fork and clone the project
+2. install the dependencies above
+3. run the tests with make:
+ > make unit functional integration doctest
+4. hack at will
+5. commit, push etc
+6. send a pull request
+
+## keep in mind
+
+![your lack of tests if disturbing the force](http://farm3.static.flickr.com/2248/2282734669_a7f431e660_o.jpg)
+
+### that lettuce is a testing software, patches and pull requests must come with automated tests, and if suitable, with proper documentation.
View
@@ -1,5 +1,5 @@
# lettuce
-> Version 0.2.8 - kryptonite
+> Version 0.2.10 - kryptonite
## On release names
@@ -51,22 +51,6 @@ all them are used within lettuce tests
* [django](http://djangoproject.com/)
> [sudo] pip install django
-# Contributing
-
-1. fork and clone the project
-2. install the dependencies above
-3. run the tests with make:
- > make unit functional integration doctest
-4. hack at will
-5. commit, push etc
-6. send a pull request
-
-## keep in mind
-
-![your lack of tests if disturbing the force](http://farm3.static.flickr.com/2248/2282734669_a7f431e660_o.jpg)
-
-### that lettuce is a testing software, patches and pull requests must come with automated tests, and if suitable, with proper documentation.
-
# mailing list
## for users
View
@@ -15,14 +15,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-version = '0.2.8'
+version = '0.2.10'
release = 'kryptonite'
import os
import sys
import traceback
-from imp import reload
+try:
+ from imp import reload
+except ImportError:
+ # python 2.5 fallback
+ pass
+
from datetime import datetime
+import random
from lettuce.core import Feature, TotalResult
@@ -76,7 +82,7 @@ class Runner(object):
Takes a base path as parameter (string), so that it can look for
features and step definitions on there.
"""
- def __init__(self, base_path, scenarios=None, verbosity=0,
+ def __init__(self, base_path, scenarios=None, verbosity=0, random=False,
enable_xunit=False, xunit_filename=None, tags=None):
""" lettuce.Runner will try to find a terrain.py file and
import it from within `base_path`
@@ -107,6 +113,8 @@ def __init__(self, base_path, scenarios=None, verbosity=0,
else:
from lettuce.plugins import colored_shell_output as output
+ self.random = random
+
if enable_xunit:
xunit_output.enable(filename=xunit_filename)
@@ -132,6 +140,8 @@ def run(self):
features_files = [self.single_feature]
else:
features_files = self.loader.find_feature_files()
+ if self.random:
+ random.shuffle(features_files)
if not features_files:
self.output.print_no_features_found(self.loader.base_dir)
@@ -142,7 +152,7 @@ def run(self):
for filename in features_files:
feature = Feature.from_file(filename)
results.append(
- feature.run(self.scenarios, tags=self.tags))
+ feature.run(self.scenarios, tags=self.tags, random=self.random))
except exceptions.LettuceSyntaxError, e:
sys.stderr.write(e.msg)
View
@@ -47,6 +47,12 @@ def main(args=sys.argv[1:]):
'(prefixing tags with "-" will exclude them and '
'prefixing with "~" will match approximate words)')
+ parser.add_option("-r", "--random",
+ dest="random",
+ action="store_true",
+ default=False,
+ help="Run scenarios in a more random order to avoid interference")
+
parser.add_option("--with-xunit",
dest="enable_xunit",
action="store_true",
@@ -60,7 +66,7 @@ def main(args=sys.argv[1:]):
help='Write JUnit XML to this file. Defaults to '
'lettucetests.xml')
- options, args = parser.parse_args()
+ options, args = parser.parse_args(args)
if args:
base_path = os.path.abspath(args[0])
@@ -73,6 +79,7 @@ def main(args=sys.argv[1:]):
base_path,
scenarios=options.scenarios,
verbosity=options.verbosity,
+ random=options.random,
enable_xunit=options.enable_xunit,
xunit_filename=options.xunit_file,
tags=options.tags,
Oops, something went wrong.

0 comments on commit 4539b44

Please sign in to comment.