Skip to content

Commit

Permalink
removes unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfalcao committed Dec 16, 2023
1 parent 8e1ae1d commit 4402669
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 477 deletions.
Empty file modified setup.py
100755 → 100644
Empty file.
236 changes: 0 additions & 236 deletions sure/actors.py

This file was deleted.

96 changes: 0 additions & 96 deletions sure/agents.py

This file was deleted.

2 changes: 1 addition & 1 deletion sure/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from sure.importer import resolve_path
from sure.runner import Runner
from sure.reporters import gather_reporter_names, CoReporter
from sure.reporters import gather_reporter_names
from sure.errors import ExitError, ExitFailure


Expand Down
15 changes: 11 additions & 4 deletions sure/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ def exit_code(codeword: str) -> int:
return reduce(xor, list(map(ord, codeword)))


class ImmediateAbort(Exception):
"""base-exception to immediate runtime abortion"""
def __init__(self, code):
sys.stderr.write(f"IMMEDIATE ABORT [{code}]")
sys.exit(code)


class RuntimeInterruption(Exception):
def __init__(self, scenario_result):
self.result = scenario_result
Expand All @@ -53,13 +60,13 @@ def __init__(self, scenario_result):
super().__init__(scenario_result)


class ExitError(SystemExit):
class ExitError(ImmediateAbort):
def __init__(self, context, result):
context.reporter.on_failure(result.scenario, result.succinct_error)
context.reporter.on_errorure(result.errored_features[0].errored_scenarios[0], result.succinct_error)
return super().__init__(exit_code('ERROR'))


class ExitFailure(SystemExit):
class ExitFailure(ImmediateAbort):
def __init__(self, context, result):
context.reporter.on_failure(result.scenario, result.succinct_failure)
context.reporter.on_failure(result.failed_features[0].failed_scenarios[0], result.succinct_failure)
return super().__init__(exit_code('FAILURE'))

0 comments on commit 4402669

Please sign in to comment.