Extremely weird behavior when running anything other than the example project
tjh2822 opened this issue · comments
Description
Extremely weird behavior when running anything other than the example project.
Steps to reproduce
- use spec file attached below
- gauge run specs
Information that will help us debug
[]$ gauge run specs -v
Python: 3.6.8
# Specification Heading
## Vowel counts in single word
* Vowels in English language are "aeiou"2. ...[FAIL]
Failed Step: Vowels in English language are "aeiou"2.
Specification: specs/example.spec:11
Error Message: None is not a callable object
Stacktrace:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/getgauge/executor.py", line 32, in execute_method
params = _get_args(params, step)
File "/usr/local/lib/python3.6/site-packages/getgauge/executor.py", line 50, in _get_args
args_length = len(inspect.signature(hook_or_step.impl).parameters)
File "/usr/lib64/python3.6/inspect.py", line 3065, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/usr/lib64/python3.6/inspect.py", line 2815, in from_callable
follow_wrapper_chains=follow_wrapped)
File "/usr/lib64/python3.6/inspect.py", line 2193, in _signature_from_callable
raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: None is not a callable object
## Vowel counts in multiple word
* Vowels in English language are "aeiou"2. ...[FAIL]
Failed Step: Vowels in English language are "aeiou"2.
Specification: specs/example.spec:11
Error Message: None is not a callable object
Stacktrace:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/getgauge/executor.py", line 32, in execute_method
params = _get_args(params, step)
File "/usr/local/lib/python3.6/site-packages/getgauge/executor.py", line 50, in _get_args
args_length = len(inspect.signature(hook_or_step.impl).parameters)
File "/usr/lib64/python3.6/inspect.py", line 3065, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/usr/lib64/python3.6/inspect.py", line 2815, in from_callable
follow_wrapper_chains=follow_wrapped)
File "/usr/lib64/python3.6/inspect.py", line 2193, in _signature_from_callable
raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: None is not a callable object
Successfully generated html-report to => /home/$/$/gauge-tests/reports/html-report/index.html
Specifications: 1 executed 0 passed 1 failed 0 skipped
Scenarios: 2 executed 0 passed 2 failed 0 skipped
Total time taken: 462ms
[]$
spec file
# Specification Heading
This is an executable specification file. This file follows markdown syntax.
Every heading in this file denotes a scenario. Every bulleted point denotes a step.
To execute this specification, run
gauge run specs
* Vowels in English language are "aeiou"2.
## Vowel counts in single word
tags: single word
* The word "gauge" has "3" vowels2.
## Vowel counts in multiple word
This is the second scenario in this specification
Here's a step that takes a table
* Almost all words have vowels
|Word |Vowel Count|
|------|-----------|
|Gauge |3 |
|Mingle|2 |
|Snap |1 |
|GoCD |1 |
|Rhythm|0 |
On Centos 8.2
[]$ gauge -v
Gauge version: 1.1.4
Commit Hash: c982558
Plugins
html-report (4.0.12)
js (2.3.13)
python (0.3.12)
screenshot (0.0.1)
step_impl.py (edited to fail but not for the reasons above)
from getgauge.python import step, before_scenario, Messages
vowels = ["a", "e", "i", "o", "u"]
def number_of_vowels(word):
return -99
--------------------------
Gauge step implementations
--------------------------
@step("The word has vowels2.")
def assert_no_of_vowels_in(word, number):
assert str(number) == str(number_of_vowels(word))
@step("Vowels in English language are 2.")
def assert_default_vowels(given_vowels):
Messages.write_message("Given vowels are {0}".format(given_vowels))
assert given_vowels == "".join(vowels)
@step("Almost all words have vowels
")def assert_words_vowel_count(table):
actual = [str(number_of_vowels(word)) for word in table.get_column_values_with_name("Word")]
expected = [str(count) for count in table.get_column_values_with_name("Vowel Count")]
assert expected == actual
---------------
Execution Hooks
---------------
@before_scenario()
def before_scenario_hook():
assert "".join(vowels) == "aeiou"