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

Add and Fix docs for split_unescape #460

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Add and Fix docs for split_unescape #460

merged 2 commits into from
Oct 12, 2023

Conversation

ajratnam
Copy link
Contributor

split_unescape function didn't have its docstring completly written.
The example in the doc had a mistake, raw strings also cannot end with a single backslash.

@fliiiix
Copy link
Member

fliiiix commented Oct 11, 2023

Do you have any idea why

>>> split_unescape(r'foo\|bar', '|')
['foo|bar']

leads to
radish/utils.py:190: DeprecationWarning: invalid escape sequence |

because i think that should not happen because we us a raw string

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (a515e15) 87.26% compared to head (46580cc) 87.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #460   +/-   ##
=======================================
  Coverage   87.26%   87.26%           
=======================================
  Files          39       39           
  Lines        2380     2380           
=======================================
  Hits         2077     2077           
  Misses        303      303           
Flag Coverage Δ
unittests 87.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
radish/utils.py 69.38% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ajratnam
Copy link
Contributor Author

ajratnam commented Oct 11, 2023

I think that's because you normally use r strings to unescape any escaped sequence
but in our case \| isn't an escape sequence so nothing is being escaped

>>> r'\|' == '\|'
True
>>> print(r'\|')
\|
>>> print('\|')
\|

imo, the fix for it would be using normal string with \\ or I think it maybe some issue with flake8 also

@ajratnam
Copy link
Contributor Author

Yeah, I changed it to that, and my linter doesn't show me that error anymore. I think this fixes #443

@fliiiix fliiiix merged commit 7af5ba7 into radish-bdd:main Oct 12, 2023
11 checks passed
@fliiiix fliiiix mentioned this pull request Oct 12, 2023
@fliiiix
Copy link
Member

fliiiix commented Oct 13, 2023

thanks again merged and release with 0.17.0

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.

2 participants