pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

Creates path to json file if it does not exist

Open shawnemhe opened this issue 5 years ago • 3 comments

Minor change to prevent raising an error when attempting to create a cucumber json in a directory that has not been created yet. This breaks form with the standard pytest --junitxml functionality which would create the path in this situation.

shawnemhe avatar Feb 18 '20 07:02 shawnemhe

Codecov Report

Merging #347 into master will increase coverage by 0.83%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
+ Coverage   94.99%   95.82%   +0.83%     
==========================================
  Files          57       57              
  Lines        2217     2227      +10     
  Branches      185      188       +3     
==========================================
+ Hits         2106     2134      +28     
+ Misses         73       62      -11     
+ Partials       38       31       -7
Impacted Files Coverage Δ
tests/feature/test_cucumber_json.py 97.56% <100%> (+0.59%) :arrow_up:
pytest_bdd/cucumber_json.py 92.77% <100%> (+2.64%) :arrow_up:
pytest_bdd/feature.py 99.24% <0%> (+3%) :arrow_up:
pytest_bdd/parsers.py 87.75% <0%> (+4.08%) :arrow_up:
pytest_bdd/scripts.py 91.48% <0%> (+4.25%) :arrow_up:
tests/steps/test_unicode.py 100% <0%> (+6.45%) :arrow_up:
pytest_bdd/utils.py 100% <0%> (+22.22%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f3b92bd...1ec12d6. Read the comment docs.

codecov-io avatar Feb 18 '20 07:02 codecov-io

Hi @shawnemhe, thank you for this fix. Could you write a test for it too?

youtux avatar Mar 01 '20 14:03 youtux

Hi @youtux, it is testing now by parametrizing the testdir fixture so that of the cucumber tests run with and without a missing subdirectory.

shawnemhe avatar Mar 01 '20 22:03 shawnemhe