Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates path to json file if it does not exist #347

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shawnemhe
Copy link

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.

Fixes error when attempting to create a cucumber json in a directory
has not been created yet.
@codecov-io
Copy link

codecov-io commented Feb 18, 2020

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%) ⬆️
pytest_bdd/cucumber_json.py 92.77% <100%> (+2.64%) ⬆️
pytest_bdd/feature.py 99.24% <0%> (+3%) ⬆️
pytest_bdd/parsers.py 87.75% <0%> (+4.08%) ⬆️
pytest_bdd/scripts.py 91.48% <0%> (+4.25%) ⬆️
tests/steps/test_unicode.py 100% <0%> (+6.45%) ⬆️
pytest_bdd/utils.py 100% <0%> (+22.22%) ⬆️

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.

@youtux
Copy link
Contributor

youtux commented Mar 1, 2020

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

Modified runandparse to check if the new test has added a
"missing_subdirectory" attribute. Verified that this doesn't break the
functionality of the already existing cucumber tests.
Using a fixture now to run all cucumber tests with and without
missing subdirectory.
Also fixed formatting issues identified in build test.
@shawnemhe
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants