Skip to content

Commit

Permalink
Fix tests/feature/test_cucumber_json.py::test_step_trace
Browse files Browse the repository at this point in the history
This test was failing when run as part of the entire test suite and
passing when run on its own. When the first part of the  expected[0].id
path was changed from test_step_trace0 to test_step_trace1, the results
reversed - it passed as part of the entire suite and failed on its own.
This behavior was not observed prior to the async changed.

I suspect that this is caused by the addition of
test_async_steps.py::test_step_trace, which caused this to no longer
be the first test with the name `test_step_trace` to run as part of the
entire suite. Since there are several other tests with the same name,
it seems like the best course here would be to ensure that this test
has a unique name so that it is more resilient to ordering.
  • Loading branch information
maafy6 committed Apr 16, 2023
1 parent d45c543 commit 8fd0fd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/feature/test_cucumber_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __eq__(self, other: object) -> bool:
return isinstance(other, self.type) if self.type else True


def test_step_trace(pytester):
def test_cucumber_json_step_trace(pytester):
"""Test step trace."""
pytester.makefile(
".ini",
Expand Down Expand Up @@ -222,7 +222,7 @@ def test_passing_outline():
"name": "Passing outline",
},
],
"id": os.path.join("test_step_trace0", "test.feature"),
"id": os.path.join("test_cucumber_json_step_trace0", "test.feature"),
"keyword": "Feature",
"line": 2,
"name": "One passing scenario, one failing scenario",
Expand Down

0 comments on commit 8fd0fd5

Please sign in to comment.