Skip to content

Commit 564ebdc

Browse files
authored
Merge pull request #480 from radish-bdd/reduce-compat
Reduce compat
2 parents f989517 + 13584f9 commit 564ebdc

File tree

120 files changed

+77
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+77
-339
lines changed

Diff for: docs/conf.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
#
31
# radish documentation build configuration file, created by
42
# sphinx-quickstart on Sat Jun 13 21:58:55 2015.
53
#

Diff for: docs/quickstart.rst

-4

Diff for: radish/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
__DESCRIPTION__ = "Behaviour-Driven-Development tool for Python"
42
__LICENSE__ = "MIT"
53
__VERSION__ = "0.17.1"

Diff for: radish/background.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a representation of a Feature Background.
53
"""

Diff for: radish/compat.py

-17
This file was deleted.

Diff for: radish/core.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
Providing radish core functionality.
53
"""

Diff for: radish/customtyperegistry.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides the Argument-Expression Registry
53
"""

Diff for: radish/errororacle.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides some functionality to diagnose thrown exceptions
53
"""

Diff for: radish/examplescenario.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a class to represent one Scenario Outline Example
53
"""

Diff for: radish/exceptions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
from .terrain import world
42

53

Diff for: radish/extensionregistry.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
Provide plugin interface for radish extensions
53
"""

Diff for: radish/extensions/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# -*- coding: utf-8 -*-

Diff for: radish/extensions/bdd_xml_writer.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a hook which generates a BDD XML result file at the end of the run.
53
"""

Diff for: radish/extensions/codecoverage.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a radish extension to make
53
coverage measurements.

Diff for: radish/extensions/cucumber_json_writer.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a hook which generates a cucumber json result file at the end of the run.
53
"""

Diff for: radish/extensions/endreport_writer.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This radish extension module provide the functionality to write the end report
53
"""

Diff for: radish/extensions/failure_debugger.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides an extension which starts a debugger when a step fails
53
"""

Diff for: radish/extensions/failure_inspector.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides an extension which starts a python shell after a step failed
53
"""

Diff for: radish/extensions/formatters/dots.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This radish extension provides the functionality to write the feature file run to the console.
53
"""

Diff for: radish/extensions/formatters/gherkin.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This radish extension provides the functionality to write the feature file run to the console.
53
"""

Diff for: radish/extensions/junit_xml_writer.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a hook which generates a JUnit XML result file at the end of the run.
53
"""

Diff for: radish/extensions/syslog_writer.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides an extension to write all features, scenarios and steps to the syslog.
53
"""

Diff for: radish/extensions/time_recorder.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module is a REQUIRED extension to record the time of Features, Scenarios and Steps
53
"""

Diff for: radish/extensions/user_data.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a hook which processes user specified data on the command-line
53
and provides this data as a dictionary attached to the world.config object
64
as per Enhancement #124.
75
"""
6+
87
import re
98

109
from radish.terrain import world

Diff for: radish/feature.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a class to represent a Feature from a parsed feature file.
53
"""

Diff for: radish/hookregistry.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
4-
This module provides a registry for all hooks
2+
This module provides a registry for all hooks
53
"""
64

75
from singleton import singleton
@@ -127,8 +125,8 @@ def call(self, when, what, ascending, model, *args, **kwargs):
127125
"""
128126
for _, on_tags, func in sorted(self._hooks[what][when], key=lambda h: h[0], reverse=not ascending):
129127
if not self.__has_to_run(model, on_tags):
130-
# # this hook does not have to run because
131-
# # it was excluded due to the tags for this model
128+
# this hook does not have to run because
129+
# it was excluded due to the tags for this model
132130
continue
133131

134132
try:

Diff for: radish/iterationscenario.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a Scenario which represents one iteration in a ScenarioLoop
53
"""

Diff for: radish/loader.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module contains a class to load the step and terrain files
53
"""

Diff for: radish/main.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import os
42
import sys
53
import uuid

Diff for: radish/matcher.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a class to match the feature file steps with the registered steps from the registry
53
"""
@@ -11,7 +9,6 @@
119

1210
from .customtyperegistry import CustomTypeRegistry
1311
from .exceptions import StepDefinitionNotFoundError, StepPatternError
14-
from .compat import re_pattern
1512

1613
StepMatch = namedtuple("StepMatch", ["argument_match", "func"])
1714

@@ -89,7 +86,7 @@ def match_step(sentence, steps):
8986
"""
9087
potentional_matches = []
9188
for pattern, func in steps.items():
92-
if isinstance(pattern, re_pattern): # pylint: disable=protected-access
89+
if isinstance(pattern, re.Pattern): # pylint: disable=protected-access
9390
match = pattern.search(sentence)
9491
argument_match = RegexStepArguments(match)
9592
if match:

Diff for: radish/model.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This model provides a base class for all models:
53

Diff for: radish/parser.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
Feature file parser.
53
One Feature file parser instance is able to parse one feature file.
@@ -13,7 +11,6 @@
1311
import copy
1412
import string
1513

16-
from .compat import RecursionError
1714
from .exceptions import RadishError, FeatureFileSyntaxError, LanguageNotSupportedError
1815
from .feature import Feature
1916
from .scenario import Scenario
@@ -519,7 +516,7 @@ def _parse_precondition(self, arguments):
519516
try:
520517
current_tags = self._current_tags + self.feature.tags + self._inherited_tags
521518
feature = self._core.parse_feature(feature_file, self._tag_expr, inherited_tags=current_tags)
522-
except (RuntimeError, RecursionError) as e:
519+
except RecursionError as e:
523520
if str(e).startswith("maximum recursion depth exceeded"): # precondition cycling
524521
raise FeatureFileSyntaxError(
525522
"Your feature '{0}' has cycling preconditions with '{1}: {2}' starting at line {3}".format(

Diff for: radish/runner.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
Providing radish core functionality like the feature file Runner.
53
"""

Diff for: radish/scenario.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a class to represent a Scenario
53
"""

Diff for: radish/scenarioloop.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a Scenario type which represents a Scenario loop
53
"""

Diff for: radish/scenariooutline.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a class to represent a Scenario Outline
53
"""

Diff for: radish/stepmodel.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a class to represent a Step
53
"""

Diff for: radish/stepregistry.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a registry for all custom steps which were decorated with the @step-decorator.
53
"""
@@ -9,7 +7,6 @@
97
from singleton import singleton
108

119
from .exceptions import RadishError, SameStepError, StepRegexError
12-
from .compat import re_pattern
1310

1411

1512
@singleton()
@@ -141,7 +138,7 @@ def given(pattern):
141138
"""
142139
Step decorator prefixed with the Given-keyword.
143140
"""
144-
if isinstance(pattern, re_pattern): # pylint: disable=protected-access
141+
if isinstance(pattern, re.Pattern): # pylint: disable=protected-access
145142
return step(re.compile(r"Given {0}".format(pattern.pattern)))
146143
return step("Given {0}".format(pattern))
147144

@@ -150,7 +147,7 @@ def when(pattern):
150147
"""
151148
Step decorator prefixed with the When-keyword.
152149
"""
153-
if isinstance(pattern, re_pattern): # pylint: disable=protected-access
150+
if isinstance(pattern, re.Pattern): # pylint: disable=protected-access
154151
return step(re.compile(r"When {0}".format(pattern.pattern)))
155152
return step("When {0}".format(pattern))
156153

@@ -159,6 +156,6 @@ def then(pattern):
159156
"""
160157
Step decorator prefixed with the Then-keyword.
161158
"""
162-
if isinstance(pattern, re_pattern): # pylint: disable=protected-access
159+
if isinstance(pattern, re.Pattern): # pylint: disable=protected-access
163160
return step(re.compile(r"Then {0}".format(pattern.pattern)))
164161
return step("Then {0}".format(pattern))

Diff for: radish/terrain.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
Terrain module providing step overlapping data containers
53
"""

Diff for: radish/testing/__main__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides a script to test the
53
radish step implementations

Diff for: radish/testing/matches.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides functionaliy to test
53
if some sentences are matched with the expected

Diff for: radish/utils.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
42
This module provides several utility functions
53
"""

Diff for: setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# pylint: disable=missing-docstring
32

43
import os

Diff for: tests/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
# -*- coding: utf-8 -*-

Diff for: tests/conftest.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# -*- coding: utf-8 -*-
2-
31
"""
4-
radish
5-
~~~~~~
2+
radish
3+
~~~~~~
64
7-
Behavior Driven Development tool for Python - the root from red to green
5+
Behavior Driven Development tool for Python - the root from red to green
86
9-
Copyright: MIT, Timo Furrer <[email protected]>
7+
Copyright: MIT, Timo Furrer <[email protected]>
108
"""
119

1210
import os

Diff for: tests/data/radish/steps.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
import re
42
from radish.terrain import world
53
from radish.stepregistry import step

Diff for: tests/data/radish/terrain.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
3-
41
from radish import before
52

63

0 commit comments

Comments
 (0)